@lcap/nasl 1.0.1 → 2.12.0-beta.1

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 (364) hide show
  1. package/out/automate/engine/index.d.ts +1 -0
  2. package/out/automate/engine/index.js +34 -12
  3. package/out/automate/engine/index.js.map +1 -1
  4. package/out/automate/engine/operators.d.ts +10 -2
  5. package/out/automate/engine/operators.js +105 -7
  6. package/out/automate/engine/operators.js.map +1 -1
  7. package/out/automate/engine/uniqueName.d.ts +8 -2
  8. package/out/automate/engine/uniqueName.js +72 -4
  9. package/out/automate/engine/uniqueName.js.map +1 -1
  10. package/out/automate/engine/utils.d.ts +1 -0
  11. package/out/automate/engine/utils.js +108 -67
  12. package/out/automate/engine/utils.js.map +1 -1
  13. package/out/automate/template/process.d.ts +9 -0
  14. package/out/automate/template/process.js +10976 -0
  15. package/out/automate/template/process.js.map +1 -0
  16. package/out/bak/translator.js +1 -0
  17. package/out/bak/translator.js.map +1 -1
  18. package/out/common/BaseNode.d.ts +6 -1
  19. package/out/common/BaseNode.js +37 -6
  20. package/out/common/BaseNode.js.map +1 -1
  21. package/out/concepts/App__.d.ts +52 -49
  22. package/out/concepts/App__.js +89 -53
  23. package/out/concepts/App__.js.map +1 -1
  24. package/out/concepts/Assignee__.d.ts +11 -0
  25. package/out/concepts/Assignee__.js +34 -0
  26. package/out/concepts/Assignee__.js.map +1 -1
  27. package/out/concepts/BindAttribute__.js +2 -2
  28. package/out/concepts/BindAttribute__.js.map +1 -1
  29. package/out/concepts/BindDirective__.js +10 -3
  30. package/out/concepts/BindDirective__.js.map +1 -1
  31. package/out/concepts/BindEvent__.js +15 -6
  32. package/out/concepts/BindEvent__.js.map +1 -1
  33. package/out/concepts/BooleanLiteral__.d.ts +4 -0
  34. package/out/concepts/BooleanLiteral__.js +11 -0
  35. package/out/concepts/BooleanLiteral__.js.map +1 -1
  36. package/out/concepts/CallFunction__.js +9 -4
  37. package/out/concepts/CallFunction__.js.map +1 -1
  38. package/out/concepts/CallLogic__.js +48 -30
  39. package/out/concepts/CallLogic__.js.map +1 -1
  40. package/out/concepts/CallQueryComponent__.d.ts +34 -4
  41. package/out/concepts/CallQueryComponent__.js +340 -95
  42. package/out/concepts/CallQueryComponent__.js.map +1 -1
  43. package/out/concepts/Comment__.js +1 -1
  44. package/out/concepts/Comment__.js.map +1 -1
  45. package/out/concepts/ConfigGroup__.d.ts +1 -0
  46. package/out/concepts/ConfigGroup__.js +7 -0
  47. package/out/concepts/ConfigGroup__.js.map +1 -1
  48. package/out/concepts/ConfigProperty__.d.ts +1 -0
  49. package/out/concepts/ConfigProperty__.js +3 -0
  50. package/out/concepts/ConfigProperty__.js.map +1 -1
  51. package/out/concepts/Configuration__.d.ts +1 -0
  52. package/out/concepts/Configuration__.js +3 -0
  53. package/out/concepts/Configuration__.js.map +1 -1
  54. package/out/concepts/Constant__.js +6 -6
  55. package/out/concepts/Constant__.js.map +1 -1
  56. package/out/concepts/DataSource__.d.ts +143 -0
  57. package/out/concepts/DataSource__.js +318 -0
  58. package/out/concepts/DataSource__.js.map +1 -0
  59. package/out/concepts/Destination__.js +22 -8
  60. package/out/concepts/Destination__.js.map +1 -1
  61. package/out/concepts/End__.js +2 -2
  62. package/out/concepts/End__.js.map +1 -1
  63. package/out/concepts/EntityIndex__.d.ts +5 -0
  64. package/out/concepts/EntityIndex__.js +10 -2
  65. package/out/concepts/EntityIndex__.js.map +1 -1
  66. package/out/concepts/EntityProperty__.d.ts +9 -0
  67. package/out/concepts/EntityProperty__.js +22 -7
  68. package/out/concepts/EntityProperty__.js.map +1 -1
  69. package/out/concepts/Entity__.d.ts +6 -0
  70. package/out/concepts/Entity__.js +27 -11
  71. package/out/concepts/Entity__.js.map +1 -1
  72. package/out/concepts/Enum__.d.ts +1 -0
  73. package/out/concepts/Enum__.js +14 -4
  74. package/out/concepts/Enum__.js.map +1 -1
  75. package/out/concepts/ForEachStatement__.js +2 -2
  76. package/out/concepts/ForEachStatement__.js.map +1 -1
  77. package/out/concepts/Function__.d.ts +18 -0
  78. package/out/concepts/Function__.js +96 -1
  79. package/out/concepts/Function__.js.map +1 -1
  80. package/out/concepts/Identifier__.js +5 -14
  81. package/out/concepts/Identifier__.js.map +1 -1
  82. package/out/concepts/IfStatement__.js +8 -8
  83. package/out/concepts/IfStatement__.js.map +1 -1
  84. package/out/concepts/InterfaceParam__.js +9 -4
  85. package/out/concepts/InterfaceParam__.js.map +1 -1
  86. package/out/concepts/Interface__.js +19 -12
  87. package/out/concepts/Interface__.js.map +1 -1
  88. package/out/concepts/JSBlock__.js +3 -5
  89. package/out/concepts/JSBlock__.js.map +1 -1
  90. package/out/concepts/Logic__.js +44 -44
  91. package/out/concepts/Logic__.js.map +1 -1
  92. package/out/concepts/Module__.d.ts +116 -194
  93. package/out/concepts/Module__.js +31 -114
  94. package/out/concepts/Module__.js.map +1 -1
  95. package/out/concepts/Namespace__.d.ts +0 -86
  96. package/out/concepts/Namespace__.js +1 -108
  97. package/out/concepts/Namespace__.js.map +1 -1
  98. package/out/concepts/Param__.d.ts +3 -2
  99. package/out/concepts/Param__.js +15 -8
  100. package/out/concepts/Param__.js.map +1 -1
  101. package/out/concepts/ProcessElement__.js +38 -12
  102. package/out/concepts/ProcessElement__.js.map +1 -1
  103. package/out/concepts/Process__.d.ts +1 -1
  104. package/out/concepts/Process__.js +17 -10
  105. package/out/concepts/Process__.js.map +1 -1
  106. package/out/concepts/QueryAggregateExpression__.js +1 -1
  107. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  108. package/out/concepts/QueryFieldExpression__.d.ts +1 -0
  109. package/out/concepts/QueryFieldExpression__.js +11 -1
  110. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  111. package/out/concepts/QueryFromExpression__.d.ts +4 -0
  112. package/out/concepts/QueryFromExpression__.js +13 -2
  113. package/out/concepts/QueryFromExpression__.js.map +1 -1
  114. package/out/concepts/QueryGroupByExpression__.d.ts +3 -0
  115. package/out/concepts/QueryGroupByExpression__.js +20 -0
  116. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  117. package/out/concepts/QueryJoinExpression__.d.ts +4 -0
  118. package/out/concepts/QueryJoinExpression__.js +14 -3
  119. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  120. package/out/concepts/Return__.d.ts +1 -1
  121. package/out/concepts/Return__.js +16 -11
  122. package/out/concepts/Return__.js.map +1 -1
  123. package/out/concepts/Role__.js +10 -3
  124. package/out/concepts/Role__.js.map +1 -1
  125. package/out/concepts/SqlQueryComponent__.d.ts +14 -0
  126. package/out/concepts/SqlQueryComponent__.js +48 -5
  127. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  128. package/out/concepts/StringLiteral__.d.ts +1 -1
  129. package/out/concepts/StringLiteral__.js +2 -9
  130. package/out/concepts/StringLiteral__.js.map +1 -1
  131. package/out/concepts/StructureProperty__.js +11 -10
  132. package/out/concepts/StructureProperty__.js.map +1 -1
  133. package/out/concepts/Structure__.js +19 -12
  134. package/out/concepts/Structure__.js.map +1 -1
  135. package/out/concepts/SwitchCase__.d.ts +1 -1
  136. package/out/concepts/SwitchCase__.js +23 -25
  137. package/out/concepts/SwitchCase__.js.map +1 -1
  138. package/out/concepts/SwitchStatement__.js +1 -6
  139. package/out/concepts/SwitchStatement__.js.map +1 -1
  140. package/out/concepts/TypeAnnotation__.d.ts +8 -0
  141. package/out/concepts/TypeAnnotation__.js +53 -3
  142. package/out/concepts/TypeAnnotation__.js.map +1 -1
  143. package/out/concepts/Variable__.d.ts +1 -1
  144. package/out/concepts/Variable__.js +16 -11
  145. package/out/concepts/Variable__.js.map +1 -1
  146. package/out/concepts/ViewElement__.js +25 -20
  147. package/out/concepts/ViewElement__.js.map +1 -1
  148. package/out/concepts/View__.d.ts +1 -3
  149. package/out/concepts/View__.js +42 -36
  150. package/out/concepts/View__.js.map +1 -1
  151. package/out/concepts/WhileStatement__.js +4 -4
  152. package/out/concepts/WhileStatement__.js.map +1 -1
  153. package/out/concepts/basics/stdlib/nasl.auth.js +20 -0
  154. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
  155. package/out/concepts/basics/stdlib/nasl.configuration.js +1 -1
  156. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
  157. package/out/concepts/basics/stdlib/nasl.interface.d.ts +2 -0
  158. package/out/concepts/basics/stdlib/nasl.interface.js +4 -4
  159. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
  160. package/out/concepts/basics/stdlib/nasl.process.d.ts +4 -0
  161. package/out/concepts/basics/stdlib/nasl.process.js +410 -0
  162. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
  163. package/out/concepts/basics/stdlib/nasl.ui.js +1 -11
  164. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  165. package/out/concepts/basics/stdlib/nasl.util.js +270 -8
  166. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  167. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +1 -1
  168. package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -1
  169. package/out/concepts/basics/types/index.d.ts +2 -0
  170. package/out/concepts/basics/types/index.js +6 -1
  171. package/out/concepts/basics/types/index.js.map +1 -1
  172. package/out/concepts/index__.d.ts +1 -0
  173. package/out/concepts/index__.js +1 -0
  174. package/out/concepts/index__.js.map +1 -1
  175. package/out/enums/KEYWORDS.js +0 -7
  176. package/out/enums/KEYWORDS.js.map +1 -1
  177. package/out/generator/genBundleFiles.d.ts +3 -1
  178. package/out/generator/genBundleFiles.js +23 -5
  179. package/out/generator/genBundleFiles.js.map +1 -1
  180. package/out/generator/genMetaData.d.ts +1 -0
  181. package/out/generator/genMetaData.js +20 -12
  182. package/out/generator/genMetaData.js.map +1 -1
  183. package/out/index.d.ts +1 -1
  184. package/out/index.js +2 -1
  185. package/out/index.js.map +1 -1
  186. package/out/manager/diagnostic.d.ts +1 -1
  187. package/out/server/createUiTs.js +1 -0
  188. package/out/server/createUiTs.js.map +1 -1
  189. package/out/{test/integration/connect-file copy.d.ts → server/extendBaseNode.d.ts} +0 -0
  190. package/out/server/extendBaseNode.js +323 -0
  191. package/out/server/extendBaseNode.js.map +1 -0
  192. package/out/server/getLogics.js +49 -2
  193. package/out/server/getLogics.js.map +1 -1
  194. package/out/server/getMemberIdentifier.js +52 -2
  195. package/out/server/getMemberIdentifier.js.map +1 -1
  196. package/out/server/getProcesses.d.ts +8 -2
  197. package/out/server/getProcesses.js +228 -20
  198. package/out/server/getProcesses.js.map +1 -1
  199. package/out/server/getScope.d.ts +1 -0
  200. package/out/server/getScope.js +4 -0
  201. package/out/server/getScope.js.map +1 -1
  202. package/out/server/index.d.ts +1 -0
  203. package/out/server/index.js +1 -0
  204. package/out/server/index.js.map +1 -1
  205. package/out/server/naslServer.d.ts +8 -5
  206. package/out/server/naslServer.js +314 -383
  207. package/out/server/naslServer.js.map +1 -1
  208. package/out/server/process2LogicNamespace.js +10 -1
  209. package/out/server/process2LogicNamespace.js.map +1 -1
  210. package/out/server/translator.d.ts +1 -1
  211. package/out/server/translator.js +40 -2
  212. package/out/server/translator.js.map +1 -1
  213. package/out/service/creator/errHandles.js +5 -0
  214. package/out/service/creator/errHandles.js.map +1 -1
  215. package/out/service/storage/init.d.ts +1 -0
  216. package/out/service/storage/init.js +113 -94
  217. package/out/service/storage/init.js.map +1 -1
  218. package/out/templator/genCreateBlock.js +34 -24
  219. package/out/templator/genCreateBlock.js.map +1 -1
  220. package/out/templator/genCurdEditMultipleKeyBlock.js +28 -18
  221. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  222. package/out/templator/genCurdMultipleKeyBlock.js +45 -29
  223. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  224. package/out/templator/genEditTableBlock.js +15 -13
  225. package/out/templator/genEditTableBlock.js.map +1 -1
  226. package/out/templator/genEnumSelectBlock.js +1 -1
  227. package/out/templator/genEnumSelectBlock.js.map +1 -1
  228. package/out/templator/genGetBlock.js +1 -1
  229. package/out/templator/genGetBlock.js.map +1 -1
  230. package/out/templator/genGridViewBlock.js +29 -24
  231. package/out/templator/genGridViewBlock.js.map +1 -1
  232. package/out/templator/genListViewBlock.js +7 -5
  233. package/out/templator/genListViewBlock.js.map +1 -1
  234. package/out/templator/genQueryComponent.js +31 -29
  235. package/out/templator/genQueryComponent.js.map +1 -1
  236. package/out/templator/genSelectBlock.js +13 -22
  237. package/out/templator/genSelectBlock.js.map +1 -1
  238. package/out/templator/genTableBlock.js +31 -21
  239. package/out/templator/genTableBlock.js.map +1 -1
  240. package/out/templator/genUpdateBlock.js +35 -25
  241. package/out/templator/genUpdateBlock.js.map +1 -1
  242. package/out/templator/utils.d.ts +5 -3
  243. package/out/templator/utils.js +2 -1
  244. package/out/templator/utils.js.map +1 -1
  245. package/out/test/integration/connect-file.js +6 -6
  246. package/out/test/integration/connect-file.js.map +1 -1
  247. package/out/translator/index.js +1 -1
  248. package/out/translator/index.js.map +1 -1
  249. package/out/utils/index.d.ts +5 -0
  250. package/out/utils/index.js +50 -1
  251. package/out/utils/index.js.map +1 -1
  252. package/package.json +1 -2
  253. package/src/automate/engine/index.js +33 -8
  254. package/src/automate/engine/operators.js +114 -17
  255. package/src/automate/engine/uniqueName.js +77 -9
  256. package/src/automate/engine/utils.js +110 -69
  257. package/src/automate/template/process.js +10999 -0
  258. package/src/bak/translator.js +1 -0
  259. package/src/common/BaseNode.ts +35 -7
  260. package/src/concepts/App__.ts +132 -131
  261. package/src/concepts/Assignee__.ts +30 -0
  262. package/src/concepts/BindAttribute__.ts +2 -2
  263. package/src/concepts/BindDirective__.ts +9 -7
  264. package/src/concepts/BindEvent__.ts +14 -6
  265. package/src/concepts/BooleanLiteral__.ts +12 -0
  266. package/src/concepts/CallFunction__.ts +7 -4
  267. package/src/concepts/CallLogic__.ts +47 -32
  268. package/src/concepts/CallQueryComponent__.ts +352 -101
  269. package/src/concepts/Comment__.ts +1 -1
  270. package/src/concepts/ConfigGroup__.ts +3 -1
  271. package/src/concepts/ConfigProperty__.ts +4 -0
  272. package/src/concepts/Configuration__.ts +3 -0
  273. package/src/concepts/Constant__.ts +6 -6
  274. package/src/concepts/DataSource__.ts +391 -0
  275. package/src/concepts/Destination__.ts +22 -8
  276. package/src/concepts/End__.ts +2 -2
  277. package/src/concepts/EntityIndex__.ts +11 -2
  278. package/src/concepts/EntityProperty__.ts +23 -7
  279. package/src/concepts/Entity__.ts +38 -14
  280. package/src/concepts/Enum__.ts +15 -4
  281. package/src/concepts/ForEachStatement__.ts +2 -2
  282. package/src/concepts/Function__.ts +95 -1
  283. package/src/concepts/Identifier__.ts +5 -14
  284. package/src/concepts/IfStatement__.ts +9 -9
  285. package/src/concepts/InterfaceParam__.ts +9 -4
  286. package/src/concepts/Interface__.ts +20 -12
  287. package/src/concepts/JSBlock__.ts +3 -12
  288. package/src/concepts/Logic__.ts +45 -79
  289. package/src/concepts/Module__.ts +141 -342
  290. package/src/concepts/Namespace__.ts +1 -204
  291. package/src/concepts/Param__.ts +17 -9
  292. package/src/concepts/ProcessElement__.ts +42 -15
  293. package/src/concepts/Process__.ts +18 -12
  294. package/src/concepts/QueryAggregateExpression__.ts +1 -1
  295. package/src/concepts/QueryFieldExpression__.ts +13 -1
  296. package/src/concepts/QueryFromExpression__.ts +13 -2
  297. package/src/concepts/QueryGroupByExpression__.ts +23 -0
  298. package/src/concepts/QueryJoinExpression__.ts +14 -3
  299. package/src/concepts/Return__.ts +16 -11
  300. package/src/concepts/Role__.ts +10 -4
  301. package/src/concepts/SqlQueryComponent__.ts +47 -11
  302. package/src/concepts/StringLiteral__.ts +2 -9
  303. package/src/concepts/StructureProperty__.ts +11 -14
  304. package/src/concepts/Structure__.ts +19 -11
  305. package/src/concepts/SwitchCase__.ts +23 -27
  306. package/src/concepts/SwitchStatement__.ts +1 -5
  307. package/src/concepts/TypeAnnotation__.ts +52 -3
  308. package/src/concepts/Variable__.ts +16 -11
  309. package/src/concepts/ViewElement__.ts +26 -39
  310. package/src/concepts/View__.ts +45 -38
  311. package/src/concepts/WhileStatement__.ts +4 -4
  312. package/src/concepts/basics/stdlib/nasl.auth.ts +20 -0
  313. package/src/concepts/basics/stdlib/nasl.configuration.ts +1 -1
  314. package/src/concepts/basics/stdlib/nasl.interface.ts +1 -1
  315. package/src/concepts/basics/stdlib/nasl.process.ts +406 -0
  316. package/src/concepts/basics/stdlib/nasl.ui.ts +1 -11
  317. package/src/concepts/basics/stdlib/nasl.util.ts +271 -8
  318. package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
  319. package/src/concepts/basics/types/index.ts +2 -0
  320. package/src/concepts/index__.ts +1 -0
  321. package/src/enums/KEYWORDS.ts +0 -7
  322. package/src/generator/genBundleFiles.ts +28 -7
  323. package/src/generator/genMetaData.ts +22 -13
  324. package/src/index.ts +1 -1
  325. package/src/manager/diagnostic.ts +1 -1
  326. package/src/server/createUiTs.ts +1 -0
  327. package/src/server/extendBaseNode.ts +318 -0
  328. package/src/server/getLogics.ts +51 -5
  329. package/src/server/getMemberIdentifier.ts +53 -2
  330. package/src/server/getProcesses.ts +238 -21
  331. package/src/server/getScope.ts +5 -0
  332. package/src/server/index.ts +1 -0
  333. package/src/server/naslServer.ts +322 -380
  334. package/src/server/process2LogicNamespace.ts +29 -19
  335. package/src/server/translator.ts +42 -2
  336. package/src/service/creator/errHandles.js +6 -0
  337. package/src/service/storage/init.ts +115 -97
  338. package/src/templator/genCreateBlock.ts +35 -26
  339. package/src/templator/genCurdEditMultipleKeyBlock.ts +29 -21
  340. package/src/templator/genCurdMultipleKeyBlock.ts +46 -31
  341. package/src/templator/genEditTableBlock.ts +17 -14
  342. package/src/templator/genEnumSelectBlock.ts +1 -1
  343. package/src/templator/genGetBlock.ts +1 -1
  344. package/src/templator/genGridViewBlock.ts +30 -25
  345. package/src/templator/genListViewBlock.ts +10 -7
  346. package/src/templator/genQueryComponent.ts +34 -30
  347. package/src/templator/genSelectBlock.ts +14 -23
  348. package/src/templator/genTableBlock.ts +32 -23
  349. package/src/templator/genUpdateBlock.ts +36 -26
  350. package/src/templator/utils.ts +5 -2
  351. package/src/test/integration/connect-file.ts +6 -6
  352. package/src/translator/index.ts +1 -1
  353. package/src/utils/index.ts +51 -0
  354. package/out/concepts/basics/stdlib/nasl.browser copy.d.ts +0 -3
  355. package/out/concepts/basics/stdlib/nasl.browser copy.js +0 -70
  356. package/out/concepts/basics/stdlib/nasl.browser copy.js.map +0 -1
  357. package/out/terms/LEVEL_NAME_MAP.d.ts +0 -26
  358. package/out/terms/LEVEL_NAME_MAP.js +0 -30
  359. package/out/terms/LEVEL_NAME_MAP.js.map +0 -1
  360. package/out/test/integration/connect-file copy.js +0 -50
  361. package/out/test/integration/connect-file copy.js.map +0 -1
  362. package/out/test/integration/node-nasl-server.d.ts +0 -1
  363. package/out/test/integration/node-nasl-server.js +0 -41
  364. package/out/test/integration/node-nasl-server.js.map +0 -1
@@ -416,6 +416,29 @@ export default new Namespace({
416
416
  }),
417
417
  ],
418
418
  }),
419
+ new Function({
420
+ name: 'AddAll',
421
+ description: '为集合添加多项内容,并返回集合长度',
422
+ params: [
423
+ new Param({
424
+ name: 'list',
425
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
426
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
427
+ }),
428
+ }),
429
+ new Param({
430
+ name: 'addlist',
431
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
432
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
433
+ }),
434
+ }),
435
+ ],
436
+ returns: [
437
+ new Return({
438
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
439
+ }),
440
+ ],
441
+ }),
419
442
  new Function({
420
443
  name: 'Insert',
421
444
  description: '为集合指定索引插入项(原索引项依次后推)',
@@ -555,7 +578,7 @@ export default new Namespace({
555
578
  new Param({
556
579
  name: 'digits',
557
580
  typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
558
- description: "保留小数位数",
581
+ description: '保留小数位数',
559
582
  defaultValue: '2',
560
583
  defaultExpression: new NumericLiteral({ value: '2' }),
561
584
  }),
@@ -568,7 +591,7 @@ export default new Namespace({
568
591
  { text: 'true', value: 'true' },
569
592
  { text: 'false', value: 'false' },
570
593
  ],
571
- description: "是否显示千分位:true显示,false不显示",
594
+ description: '是否显示千分位:true显示,false不显示',
572
595
  }),
573
596
  ],
574
597
  returns: [
@@ -718,18 +741,258 @@ export default new Namespace({
718
741
  ],
719
742
  }),
720
743
  new Function({
721
- name: 'GetProperties',
722
- description: '获取应用配置参数',
744
+ name: 'CreatePageOf',
745
+ description: '将List<T>集合转换为分页集合PageOf<T>',
723
746
  params: [
724
747
  new Param({
725
- name: 'name',
726
- typeAnnotation: TypeAnnotation.createPrimitive('String'),
727
- useComponent: { type: 's-config-select' },
748
+ name: 'list',
749
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
750
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
751
+ }),
752
+ }),
753
+ new Param({
754
+ name: 'page',
755
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
756
+ }),
757
+ new Param({
758
+ name: 'size',
759
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
760
+ }),
761
+ new Param({
762
+ name: 'total',
763
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
728
764
  }),
729
765
  ],
730
766
  returns: [
731
767
  new Return({
732
- typeAnnotation: TypeAnnotation.createPrimitive('String'),
768
+ typeAnnotation: TypeAnnotation.createPrimitive('PageOf', {
769
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
770
+ }),
771
+ }),
772
+ ],
773
+ }),
774
+ new Function({
775
+ name: 'ListSort',
776
+ description: '为集合按规则排序',
777
+ params: [
778
+ new Param({
779
+ name: 'list',
780
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
781
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
782
+ }),
783
+ }),
784
+ new Param({
785
+ name: 'by',
786
+ defaultExpression: new Function({
787
+ name: '',
788
+ description: '',
789
+ params: [
790
+ new Param({
791
+ name: 'item',
792
+ typeAnnotation: null,
793
+ }),
794
+ ],
795
+ }),
796
+ }),
797
+ new Param({
798
+ name: 'sort',
799
+ description: '下拉选择升序、降序',
800
+ typeAnnotation: TypeAnnotation.createPrimitive('Boolean'),
801
+ defaultValue: 'asc',
802
+ defaultExpression: new BooleanLiteral({ value: 'true' }),
803
+ options: [
804
+ { text: 'asc', value: 'true' },
805
+ { text: 'desc', value: 'false' },
806
+ ],
807
+ }),
808
+ ],
809
+ returns: [],
810
+ }),
811
+ new Function({
812
+ name: 'ListFind',
813
+ description: '筛选符合条件的第一个项',
814
+ params: [
815
+ new Param({
816
+ name: 'list',
817
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
818
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
819
+ }),
820
+ }),
821
+ new Param({
822
+ name: 'by',
823
+ defaultExpression: new Function({
824
+ name: '',
825
+ description: '',
826
+ params: [
827
+ new Param({
828
+ name: 'item',
829
+ typeAnnotation: null,
830
+ }),
831
+ ],
832
+ }),
833
+ }),
834
+ ],
835
+ returns: [
836
+ new Return({
837
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
838
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
839
+ }),
840
+ }),
841
+ ],
842
+ }),
843
+ new Function({
844
+ name: 'ListFindIndex',
845
+ description: '筛选符合条件的第一个项的索引值',
846
+ params: [
847
+ new Param({
848
+ name: 'list',
849
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
850
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
851
+ }),
852
+ }),
853
+ new Param({
854
+ name: 'by',
855
+ defaultExpression: new Function({
856
+ name: '',
857
+ description: '',
858
+ params: [
859
+ new Param({
860
+ name: 'item',
861
+ typeAnnotation: null,
862
+ }),
863
+ ],
864
+ }),
865
+ }),
866
+ ],
867
+ returns: [
868
+ new Return({
869
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
870
+ }),
871
+ ],
872
+ }),
873
+ new Function({
874
+ name: 'ListFindAll',
875
+ description: '筛选符合条件的所有项',
876
+ params: [
877
+ new Param({
878
+ name: 'list',
879
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
880
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
881
+ }),
882
+ }),
883
+ new Param({
884
+ name: 'by',
885
+ defaultExpression: new Function({
886
+ name: '',
887
+ description: '',
888
+ params: [
889
+ new Param({
890
+ name: 'item',
891
+ typeAnnotation: null,
892
+ }),
893
+ ],
894
+ }),
895
+ }),
896
+ ],
897
+ returns: [
898
+ new Return({
899
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
900
+ }),
901
+ ],
902
+ }),
903
+ new Function({
904
+ name: 'ListReverse',
905
+ description: '为集合反向排序',
906
+ params: [
907
+ new Param({
908
+ name: 'list',
909
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
910
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
911
+ }),
912
+ }),
913
+ ],
914
+ returns: [],
915
+ }),
916
+ new Function({
917
+ name: 'ListDistinct',
918
+ description: '为集合去除重复项',
919
+ params: [
920
+ new Param({
921
+ name: 'list',
922
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
923
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
924
+ }),
925
+ }),
926
+ ],
927
+ returns: [],
928
+ }),
929
+ new Function({
930
+ name: 'ListSlice',
931
+ description: '将集合按照规则切片,返回切片后的子集合',
932
+ params: [
933
+ new Param({
934
+ name: 'list',
935
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
936
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
937
+ }),
938
+ }),
939
+ new Param({
940
+ name: 'start',
941
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
942
+ }),
943
+ new Param({
944
+ name: 'end',
945
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
946
+ }),
947
+ ],
948
+ returns: [
949
+ new Return({
950
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
951
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
952
+ }),
953
+ }),
954
+ ],
955
+ }),
956
+ new Function({
957
+ name: 'ListSliceToPageOf',
958
+ description: '将集合按照规则切片,返回切片后的PageOf集合',
959
+ params: [
960
+ new Param({
961
+ name: 'list',
962
+ typeAnnotation: TypeAnnotation.createGeneric('List', {
963
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
964
+ }),
965
+ }),
966
+ new Param({
967
+ name: 'page',
968
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
969
+ }),
970
+ new Param({
971
+ name: 'size',
972
+ typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
973
+ }),
974
+ ],
975
+ returns: [
976
+ new Return({
977
+ typeAnnotation: TypeAnnotation.createGeneric('PageOf', {
978
+ typeArguments: [TypeAnnotation.createTypeParam('T')],
979
+ }),
980
+ }),
981
+ ],
982
+ }),
983
+ new Function({
984
+ name: 'New',
985
+ description: '根据参数选择的类型,返回该参数的实例化对象',
986
+ typeParams: [
987
+ new TypeParam({
988
+ name: 'T',
989
+ }),
990
+ ],
991
+ params: [
992
+ ],
993
+ returns: [
994
+ new Return({
995
+ typeAnnotation: TypeAnnotation.createTypeParam('T'),
733
996
  }),
734
997
  ],
735
998
  }),
@@ -9,7 +9,7 @@ import Enum from '../../Enum__';
9
9
  import TypeAnnotation from '../../TypeAnnotation__';
10
10
  import { primitiveTypeList } from '../types/coreTypeList';
11
11
 
12
- export function reference2TypeAnnotationList(list: Array<Entity | Structure | Enum>, namespace: string) {
12
+ export function reference2TypeAnnotationList(list: Array<Entity | Structure | Enum> = [], namespace: string) {
13
13
  return list.map((item) => {
14
14
  if (item instanceof Structure && item.typeParams?.length > 0) {
15
15
  return TypeAnnotation.createReference(item.name, {
@@ -16,5 +16,7 @@ primitiveTypeList.forEach((typeAnnotation) => {
16
16
  });
17
17
 
18
18
  export { collectionStructures, collectionTypeList } from '../stdlib/nasl.collection';
19
+ export { processStructures, processTypeList } from '../stdlib/nasl.process';
19
20
  export { uiStructures, uiTypeList } from '../stdlib/nasl.ui';
20
21
  export { interfaceTypeList } from '../stdlib/nasl.interface';
22
+ export { interfaceStructures } from '../stdlib/nasl.interface';
@@ -8,6 +8,7 @@ export * from './StructureProperty__';
8
8
  export * from './Enum__';
9
9
  export * from './EnumItem__';
10
10
  export * from './DataElement__';
11
+ export * from './DataSource__';
11
12
  export * from './Entity__';
12
13
  export * from './EntityProperty__';
13
14
  export * from './EntityIndex__';
@@ -789,7 +789,6 @@ export const ENTITY_KEYWORDS = [
789
789
  'PROTECTED',
790
790
  'PUBLIC',
791
791
  'PURGE',
792
- 'Page',
793
792
  'Pageable',
794
793
  'PaginationUtil',
795
794
  'PutMapping',
@@ -912,14 +911,12 @@ export const ENTITY_KEYWORDS = [
912
911
  'SHUTDOWN',
913
912
  'SIGNAL',
914
913
  'SIMILAR',
915
- 'SIZE',
916
914
  'SKIP',
917
915
  'SKIP_UNUSABLE_INDEXES',
918
916
  'SLOW',
919
917
  'SMALLINT',
920
918
  'SNAPSHOT',
921
919
  'SOME',
922
- 'SORT',
923
920
  'SPATIAL',
924
921
  'SPECIFIC',
925
922
  'SPECIFICATION',
@@ -1197,8 +1194,4 @@ export const ENTITY_PROPERTY_KEYWORDS = [
1197
1194
  'PUBLIC',
1198
1195
  'STATIC',
1199
1196
  'YIELD',
1200
- 'SIZE',
1201
- 'SORT',
1202
- 'CODE',
1203
- 'PAGE',
1204
1197
  ];
@@ -1,4 +1,4 @@
1
- import { App, Module, View, BaseNode, Entity, Structure, Enum, uiStructures, collectionStructures, Logic, Interface, Process } from '../concepts';
1
+ import { App, Module, View, BaseNode, Entity, Structure, Enum, uiStructures, collectionStructures, processStructures, Logic, Interface, Process } from '../concepts';
2
2
  import * as utils from '../utils';
3
3
  import { genHash, RawOptions } from '.';
4
4
  import { compileComponent } from './compileComponent';
@@ -20,8 +20,8 @@ export interface PageOptions {
20
20
  hasUserCenter: boolean;
21
21
  hasAuth: boolean;
22
22
  domainName: string;
23
- nuimsDomain: string;
24
23
  auth: boolean;
24
+ subPage: object;
25
25
  documentTitle?: string;
26
26
  router: {
27
27
  notFound: string;
@@ -44,8 +44,12 @@ export async function genBundleFiles(app: App,
44
44
  USER_STATIC_URL: string;
45
45
  extendedConfig: string;
46
46
  lowcodeDomain: string;
47
+ envLcpDomain: any,
48
+ envNuimsDomain: any,
47
49
  appid: string;
48
50
  }) {
51
+ const fnNuimsDomain = config?.envNuimsDomain?.[config?.env] || config?.nuimsDomain;
52
+ const fnLowcodeDomain = config?.envLcpDomain?.[config?.env]?.lcpDomain || config?.lowcodeDomain;
49
53
  const modules: Module[] = [];
50
54
  const views: View[] = [];
51
55
  const entities: Entity[] = [];
@@ -56,7 +60,13 @@ export async function genBundleFiles(app: App,
56
60
  const processes: Process[] = [];
57
61
 
58
62
  app.views && views.push(...app.views);
59
- app.entities && entities.push(...app.entities);
63
+ if (Array.isArray(app.dataSources)) {
64
+ app.dataSources.forEach((dataSource) => {
65
+ if (Array.isArray(dataSource.entities)) {
66
+ entities.push(...dataSource.entities);
67
+ }
68
+ });
69
+ }
60
70
  app.structures && structures.push(...app.structures);
61
71
  app.enums && enums.push(...app.enums);
62
72
  app.logics && logics.push(...app.logics);
@@ -67,7 +77,6 @@ export async function genBundleFiles(app: App,
67
77
 
68
78
  modules.forEach((module: Module) => {
69
79
  module.views && views.push(...module.views);
70
- module.entities && entities.push(...module.entities);
71
80
  module.structures && structures.push(...module.structures);
72
81
  module.enums && enums.push(...module.enums);
73
82
  module.logics && logics.push(...module.logics);
@@ -130,8 +139,8 @@ export async function genBundleFiles(app: App,
130
139
  hasUserCenter: app.hasUserCenter,
131
140
  hasAuth: app.hasAuth,
132
141
  domainName: app.name,
133
- nuimsDomain: config.nuimsDomain,
134
142
  auth: view.auth,
143
+ subPage: view.children,
135
144
  documentTitle: app.documentTitle,
136
145
  router: {
137
146
  notFound: '/',
@@ -212,6 +221,14 @@ export async function genBundleFiles(app: App,
212
221
  });
213
222
  }
214
223
 
224
+ if (Array.isArray(processStructures)) {
225
+ const namespace = 'nasl.process';
226
+ processStructures.forEach((node) => {
227
+ const id = `${namespace}.${node.name}`;
228
+ dataTypesMap[id] = node;
229
+ });
230
+ }
231
+
215
232
  if (Array.isArray(logics)) {
216
233
  allLogics.push(...logics);
217
234
  }
@@ -247,9 +264,11 @@ export async function genBundleFiles(app: App,
247
264
  },
248
265
  },
249
266
  extendedConfig: config.extendedConfig,
250
- lowcodeDomain: config.lowcodeDomain,
267
+ lowcodeDomain: fnLowcodeDomain,
251
268
  tenant: config.tenant,
252
269
  env: config.env,
270
+ nuimsDomain: fnNuimsDomain,
271
+ envNuimsDomain: config.envNuimsDomain,
253
272
  indexName,
254
273
  }, null, 4);
255
274
 
@@ -336,6 +355,8 @@ export async function genBundleFiles(app: App,
336
355
  tenant: data.tenant,
337
356
  env: data.env,
338
357
  extendedConfig: data.extendedConfig,
358
+ nuimsDomain: data.nuimsDomain,
359
+ envNuimsDomain: data.envNuimsDomain,
339
360
  envConfig: {
340
361
  lowcodeDomain: data.lowcodeDomain,
341
362
  },
@@ -345,7 +366,7 @@ export async function genBundleFiles(app: App,
345
366
 
346
367
  if (config.env === 'dev') {
347
368
  // 加载资源js
348
- const domain = config.lowcodeDomain.slice(5);
369
+ const domain = fnLowcodeDomain.slice(fnLowcodeDomain.indexOf('.') + 1);
349
370
  const targetUrl = `${location.origin}/empty?url=${domain}&appid=${config.appid}`;
350
371
  const str = `
351
372
  if(!document.querySelector("iframe[name='iframeEmpty']")){
@@ -1,10 +1,11 @@
1
- import { App, View, BaseNode, Module, Interface, Entity, Structure, Enum, uiStructures, collectionStructures, Logic, Process } from '../concepts';
1
+ import { App, View, BaseNode, Module, Interface, Entity, Structure, Enum, uiStructures, collectionStructures, processStructures, Logic, Process, DataSource } from '../concepts';
2
2
 
3
3
  export function genMetaData(app: App,
4
4
  config: {
5
5
  tenant: string;
6
6
  env: string;
7
7
  nuimsDomain: string;
8
+ envNuimsDomain: Object;
8
9
  STATIC_URL: string;
9
10
  USER_STATIC_URL: string;
10
11
  extendedConfig: string;
@@ -12,7 +13,7 @@ export function genMetaData(app: App,
12
13
  }) {
13
14
  const modules: Module[] = [];
14
15
  const views: View[] = [];
15
- const entities: Entity[] = [];
16
+ const dataSources: DataSource[] = [];
16
17
  const structures: Structure[] = [];
17
18
  const enums: Enum[] = [];
18
19
  const logics: Logic[] = [];
@@ -20,7 +21,7 @@ export function genMetaData(app: App,
20
21
  const processes: Process[] = [];
21
22
 
22
23
  const {
23
- entities: appEntities = [],
24
+ dataSources: appDataSources = [],
24
25
  structures: appStructures = [],
25
26
  enums: appEnums = [],
26
27
  logics: appLogics = [],
@@ -28,7 +29,7 @@ export function genMetaData(app: App,
28
29
  dependencies: appDependencies = [],
29
30
  processes: appProcesses = [],
30
31
  } = app || {};
31
- entities.push(...appEntities);
32
+ dataSources.push(...appDataSources);
32
33
  structures.push(...appStructures);
33
34
  enums.push(...appEnums);
34
35
  logics.push(...appLogics);
@@ -42,14 +43,12 @@ export function genMetaData(app: App,
42
43
  modules.forEach((module: Module) => {
43
44
  const {
44
45
  views: moduleViews = [],
45
- entities: moduleEntities = [],
46
46
  structures: moduleStructures = [],
47
47
  enums: moduleEnums = [],
48
48
  logics: moduleLogics = [],
49
49
  interfaces: moduleInterfaces = [],
50
50
  } = module;
51
51
  views.push(...moduleViews);
52
- entities.push(...moduleEntities);
53
52
  structures.push(...moduleStructures);
54
53
  enums.push(...moduleEnums);
55
54
  logics.push(...moduleLogics);
@@ -93,13 +92,15 @@ export function genMetaData(app: App,
93
92
  enumsMap[name] = enumObj;
94
93
  });
95
94
  }
96
- if (Array.isArray(entities)) {
97
- dataTypes.push(...entities);
98
- entities.forEach((entity) => {
99
- const ns = entity.ns;
100
- if (Array.isArray(ns?.logics)) {
101
- allLogics.push(...ns.logics);
102
- }
95
+ if (Array.isArray(dataSources)) {
96
+ dataSources.forEach((dataSource)=> {
97
+ dataSource.entities.forEach((entity) => {
98
+ dataTypes.push(entity);
99
+ const ns = entity.ns;
100
+ if (Array.isArray(ns?.logics)) {
101
+ allLogics.push(...ns.logics);
102
+ }
103
+ });
103
104
  });
104
105
  }
105
106
  if (Array.isArray(structures)) {
@@ -127,6 +128,14 @@ export function genMetaData(app: App,
127
128
  });
128
129
  }
129
130
 
131
+ if (Array.isArray(processStructures)) {
132
+ const namespace = 'nasl.process';
133
+ processStructures.forEach((node) => {
134
+ const id = `${namespace}.${node.name}`;
135
+ dataTypesMap[id] = node;
136
+ });
137
+ }
138
+
130
139
  if (Array.isArray(logics)) {
131
140
  allLogics.push(...logics);
132
141
  }
package/src/index.ts CHANGED
@@ -8,5 +8,5 @@ export * as genBlock from './templator';
8
8
  export * as utils from './utils';
9
9
  export * from './config';
10
10
  export * from './eventBus';
11
- export { loadApp, loadAppSync } from './service/storage/init';
11
+ export { loadApp, loadAppSync, handleApp } from './service/storage/init';
12
12
  import './automate/engine';
@@ -10,7 +10,7 @@ import * as tsProtocol from 'typescript/lib/protocol';
10
10
  export interface Diagnostic {
11
11
  id?: string;
12
12
  severity: string;
13
- originalDiagnostic: tsProtocol.DiagnosticWithFileName;
13
+ originalDiagnostic?: tsProtocol.DiagnosticWithFileName;
14
14
  message?: string;
15
15
  code?: number;
16
16
  node?: BaseNode;
@@ -12,6 +12,7 @@ const naslStdlibMap: any = {
12
12
  'nasl.langUtil.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.langUtil.ts').default,
13
13
  'nasl.annotation.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.annotation.ts').default,
14
14
  'nasl.validation.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.validation.ts').default,
15
+ 'nasl.process.ts': require('!!raw-loader!../../../file-storage/data/stdlib/nasl.process.ts').default,
15
16
  };
16
17
 
17
18
  export default function formatUiTs(allComponent: any) {