@lcap/nasl 3.1.0-beta.4 → 3.1.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/out/automate/engine/utils.js +4 -0
  2. package/out/automate/engine/utils.js.map +1 -1
  3. package/out/automate/upgrader/2.12.js +1 -5
  4. package/out/automate/upgrader/2.12.js.map +1 -1
  5. package/out/automate/upgrader/2.14.js +1 -5
  6. package/out/automate/upgrader/2.14.js.map +1 -1
  7. package/out/automate/upgrader/2.16.js +1 -5
  8. package/out/automate/upgrader/2.16.js.map +1 -1
  9. package/out/automate/upgrader/2.17.js +1 -5
  10. package/out/automate/upgrader/2.17.js.map +1 -1
  11. package/out/automate/upgrader/2.18.js +1 -5
  12. package/out/automate/upgrader/2.18.js.map +1 -1
  13. package/out/automate/upgrader/2.20.js +1 -5
  14. package/out/automate/upgrader/2.20.js.map +1 -1
  15. package/out/breakpoint/generator/BreakpointNode.js +14 -4
  16. package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
  17. package/out/breakpoint/index.js +1 -5
  18. package/out/breakpoint/index.js.map +1 -1
  19. package/out/breakpoint/shared/index.js +1 -5
  20. package/out/breakpoint/shared/index.js.map +1 -1
  21. package/out/breakpoint/shared/utils.js +1 -1
  22. package/out/breakpoint/shared/utils.js.map +1 -1
  23. package/out/breakpoint/store/core.js +1 -5
  24. package/out/breakpoint/store/core.js.map +1 -1
  25. package/out/breakpoint/store/dock.js +1 -5
  26. package/out/breakpoint/store/dock.js.map +1 -1
  27. package/out/breakpoint/store/index.js +1 -5
  28. package/out/breakpoint/store/index.js.map +1 -1
  29. package/out/common/BaseNode.d.ts +1 -1
  30. package/out/common/BaseNode.js +17 -11
  31. package/out/common/BaseNode.js.map +1 -1
  32. package/out/common/index.js +1 -5
  33. package/out/common/index.js.map +1 -1
  34. package/out/concepts/Anchor__.js +1 -5
  35. package/out/concepts/Anchor__.js.map +1 -1
  36. package/out/concepts/AnonymousFunction__.d.ts +9 -8
  37. package/out/concepts/AnonymousFunction__.js +14 -18
  38. package/out/concepts/AnonymousFunction__.js.map +1 -1
  39. package/out/concepts/App__.js +1 -5
  40. package/out/concepts/App__.js.map +1 -1
  41. package/out/concepts/Argument__.js +2 -11
  42. package/out/concepts/Argument__.js.map +1 -1
  43. package/out/concepts/Assignee__.js +1 -5
  44. package/out/concepts/Assignee__.js.map +1 -1
  45. package/out/concepts/Assignment__.js +1 -1
  46. package/out/concepts/Assignment__.js.map +1 -1
  47. package/out/concepts/AuthLogicForCallInterface__.js +1 -5
  48. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  49. package/out/concepts/Backend__.js +1 -5
  50. package/out/concepts/Backend__.js.map +1 -1
  51. package/out/concepts/BatchAssignment__.js +3 -8
  52. package/out/concepts/BatchAssignment__.js.map +1 -1
  53. package/out/concepts/BindAttribute__.js +2 -15
  54. package/out/concepts/BindAttribute__.js.map +1 -1
  55. package/out/concepts/BindDirective__.js +1 -5
  56. package/out/concepts/BindDirective__.js.map +1 -1
  57. package/out/concepts/BindEvent__.js +1 -5
  58. package/out/concepts/BindEvent__.js.map +1 -1
  59. package/out/concepts/BindStyle__.js +1 -5
  60. package/out/concepts/BindStyle__.js.map +1 -1
  61. package/out/concepts/CallAuthInterface__.js +1 -5
  62. package/out/concepts/CallAuthInterface__.js.map +1 -1
  63. package/out/concepts/CallFunction__.js +2 -2
  64. package/out/concepts/CallFunction__.js.map +1 -1
  65. package/out/concepts/CallInterface__.js +50 -62
  66. package/out/concepts/CallInterface__.js.map +1 -1
  67. package/out/concepts/CallLogic__.d.ts +4 -1
  68. package/out/concepts/CallLogic__.js +86 -123
  69. package/out/concepts/CallLogic__.js.map +1 -1
  70. package/out/concepts/CallQueryComponent__.d.ts +1 -1
  71. package/out/concepts/CallQueryComponent__.js +1 -5
  72. package/out/concepts/CallQueryComponent__.js.map +1 -1
  73. package/out/concepts/CompletionProperty__.js +8 -1
  74. package/out/concepts/CompletionProperty__.js.map +1 -1
  75. package/out/concepts/ConfigGroup__.js +1 -5
  76. package/out/concepts/ConfigGroup__.js.map +1 -1
  77. package/out/concepts/ConfigProperty__.js +1 -5
  78. package/out/concepts/ConfigProperty__.js.map +1 -1
  79. package/out/concepts/Configuration__.js +1 -5
  80. package/out/concepts/Configuration__.js.map +1 -1
  81. package/out/concepts/Connector__.js +1 -5
  82. package/out/concepts/Connector__.js.map +1 -1
  83. package/out/concepts/DataSource__.js +1 -5
  84. package/out/concepts/DataSource__.js.map +1 -1
  85. package/out/concepts/Destination__.js +1 -5
  86. package/out/concepts/Destination__.js.map +1 -1
  87. package/out/concepts/EntityProperty__.js +1 -5
  88. package/out/concepts/EntityProperty__.js.map +1 -1
  89. package/out/concepts/Entity__.js +1 -5
  90. package/out/concepts/Entity__.js.map +1 -1
  91. package/out/concepts/Enum__.js +1 -5
  92. package/out/concepts/Enum__.js.map +1 -1
  93. package/out/concepts/Event__.js +1 -5
  94. package/out/concepts/Event__.js.map +1 -1
  95. package/out/concepts/ForEachStatement__.js +1 -5
  96. package/out/concepts/ForEachStatement__.js.map +1 -1
  97. package/out/concepts/FrontendLibrary__.d.ts +29 -29
  98. package/out/concepts/FrontendLibrary__.js +3 -7
  99. package/out/concepts/FrontendLibrary__.js.map +1 -1
  100. package/out/concepts/Frontend__.js +1 -5
  101. package/out/concepts/Frontend__.js.map +1 -1
  102. package/out/concepts/Function__.js +2 -6
  103. package/out/concepts/Function__.js.map +1 -1
  104. package/out/concepts/Interface__.js +1 -5
  105. package/out/concepts/Interface__.js.map +1 -1
  106. package/out/concepts/LogicItem__.d.ts +6 -6
  107. package/out/concepts/LogicItem__.js +6 -6
  108. package/out/concepts/LogicItem__.js.map +1 -1
  109. package/out/concepts/Logic__.js +5 -24
  110. package/out/concepts/Logic__.js.map +1 -1
  111. package/out/concepts/MatchCase__.js +1 -5
  112. package/out/concepts/MatchCase__.js.map +1 -1
  113. package/out/concepts/Module__.js +1 -5
  114. package/out/concepts/Module__.js.map +1 -1
  115. package/out/concepts/MsgTriggerEvent__.js +1 -5
  116. package/out/concepts/MsgTriggerEvent__.js.map +1 -1
  117. package/out/concepts/MsgTriggerLauncher__.js +1 -5
  118. package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
  119. package/out/concepts/Namespace__.d.ts +29 -29
  120. package/out/concepts/Namespace__.js +3 -7
  121. package/out/concepts/Namespace__.js.map +1 -1
  122. package/out/concepts/NewComposite__.d.ts +0 -1
  123. package/out/concepts/NewComposite__.js +4 -72
  124. package/out/concepts/NewComposite__.js.map +1 -1
  125. package/out/concepts/NewList__.d.ts +0 -1
  126. package/out/concepts/NewList__.js +2 -22
  127. package/out/concepts/NewList__.js.map +1 -1
  128. package/out/concepts/NewMap__.js +1 -5
  129. package/out/concepts/NewMap__.js.map +1 -1
  130. package/out/concepts/OverriddenLogic__.js +1 -5
  131. package/out/concepts/OverriddenLogic__.js.map +1 -1
  132. package/out/concepts/ProcessComponent__.js +1 -5
  133. package/out/concepts/ProcessComponent__.js.map +1 -1
  134. package/out/concepts/ProcessElement__.js +1 -5
  135. package/out/concepts/ProcessElement__.js.map +1 -1
  136. package/out/concepts/Process__.js +1 -5
  137. package/out/concepts/Process__.js.map +1 -1
  138. package/out/concepts/QueryJoinExpression__.js +1 -5
  139. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  140. package/out/concepts/QuerySelectExpression__.js +1 -5
  141. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  142. package/out/concepts/SelectMembers__.js +1 -5
  143. package/out/concepts/SelectMembers__.js.map +1 -1
  144. package/out/concepts/StringInterpolation__.js +1 -5
  145. package/out/concepts/StringInterpolation__.js.map +1 -1
  146. package/out/concepts/Structure__.js +1 -5
  147. package/out/concepts/Structure__.js.map +1 -1
  148. package/out/concepts/TriggerEvent__.js +1 -5
  149. package/out/concepts/TriggerEvent__.js.map +1 -1
  150. package/out/concepts/TypeAnnotation__.js +5 -5
  151. package/out/concepts/TypeAnnotation__.js.map +1 -1
  152. package/out/concepts/ValidationRule__.js +10 -4
  153. package/out/concepts/ValidationRule__.js.map +1 -1
  154. package/out/concepts/ViewComponent__.d.ts +33 -33
  155. package/out/concepts/ViewComponent__.js +8 -12
  156. package/out/concepts/ViewComponent__.js.map +1 -1
  157. package/out/concepts/ViewElement__.js +53 -74
  158. package/out/concepts/ViewElement__.js.map +1 -1
  159. package/out/concepts/View__.js +5 -9
  160. package/out/concepts/View__.js.map +1 -1
  161. package/out/concepts/basics/stdlib/nasl.http.js +2 -2
  162. package/out/concepts/basics/stdlib/nasl.util.js +9 -17
  163. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  164. package/out/concepts/basics/types/index.js +1 -1
  165. package/out/concepts/basics/types/index.js.map +1 -1
  166. package/out/concepts/index.js +1 -5
  167. package/out/concepts/index.js.map +1 -1
  168. package/out/concepts/index__.js +1 -5
  169. package/out/concepts/index__.js.map +1 -1
  170. package/out/generator/genBundleFiles.js +1 -5
  171. package/out/generator/genBundleFiles.js.map +1 -1
  172. package/out/generator/genHash.js +1 -5
  173. package/out/generator/genHash.js.map +1 -1
  174. package/out/generator/genMetaData.js +1 -13
  175. package/out/generator/genMetaData.js.map +1 -1
  176. package/out/generator/index.js +1 -5
  177. package/out/generator/index.js.map +1 -1
  178. package/out/generator/permission.js +48 -24
  179. package/out/generator/permission.js.map +1 -1
  180. package/out/generator/styleReplacer.js +1 -5
  181. package/out/generator/styleReplacer.js.map +1 -1
  182. package/out/index.js +1 -5
  183. package/out/index.js.map +1 -1
  184. package/out/sentry/index.js +1 -8
  185. package/out/sentry/index.js.map +1 -1
  186. package/out/server/formatTsUtils.js +28 -29
  187. package/out/server/formatTsUtils.js.map +1 -1
  188. package/out/server/getMemberIdentifier.js +1 -1
  189. package/out/server/getMemberIdentifier.js.map +1 -1
  190. package/out/server/naslServer.js +17 -20
  191. package/out/server/naslServer.js.map +1 -1
  192. package/out/service/creator/errHandles.d.ts +1 -1
  193. package/out/service/storage/init.js +5 -8
  194. package/out/service/storage/init.js.map +1 -1
  195. package/out/templator/genCreateBlock.js +1 -5
  196. package/out/templator/genCreateBlock.js.map +1 -1
  197. package/out/templator/genCurdEditMultipleKeyBlock.js +2 -6
  198. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  199. package/out/templator/genCurdMultipleKeyBlock.js +3 -7
  200. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  201. package/out/templator/genEditTableBlock.d.ts +1 -1
  202. package/out/templator/genEditTableBlock.js +3 -11
  203. package/out/templator/genEditTableBlock.js.map +1 -1
  204. package/out/templator/genGetBlock.js +1 -5
  205. package/out/templator/genGetBlock.js.map +1 -1
  206. package/out/templator/genGridViewBlock.d.ts +2 -2
  207. package/out/templator/genGridViewBlock.js +9 -19
  208. package/out/templator/genGridViewBlock.js.map +1 -1
  209. package/out/templator/genListViewBlock.d.ts +2 -2
  210. package/out/templator/genListViewBlock.js +6 -14
  211. package/out/templator/genListViewBlock.js.map +1 -1
  212. package/out/templator/genQueryComponent.js +1 -5
  213. package/out/templator/genQueryComponent.js.map +1 -1
  214. package/out/templator/genSelectBlock.d.ts +2 -2
  215. package/out/templator/genSelectBlock.js +10 -20
  216. package/out/templator/genSelectBlock.js.map +1 -1
  217. package/out/templator/genTableBlock.d.ts +1 -1
  218. package/out/templator/genTableBlock.js +4 -12
  219. package/out/templator/genTableBlock.js.map +1 -1
  220. package/out/templator/genUpdateBlock.js +1 -5
  221. package/out/templator/genUpdateBlock.js.map +1 -1
  222. package/out/templator/index.js +1 -5
  223. package/out/templator/index.js.map +1 -1
  224. package/out/utils/index.js +1 -5
  225. package/out/utils/index.js.map +1 -1
  226. package/package.json +2 -2
  227. package/src/breakpoint/generator/BreakpointNode.ts +19 -4
  228. package/src/breakpoint/shared/utils.ts +1 -1
  229. package/src/common/BaseNode.ts +15 -3
  230. package/src/concepts/CallLogic__.ts +45 -15
  231. package/src/concepts/ValidationRule__.ts +15 -5
  232. package/src/concepts/ViewElement__.ts +9 -6
  233. package/src/generator/permission.ts +28 -8
  234. package/src/server/formatTsUtils.ts +26 -28
  235. package/src/server/getMemberIdentifier.ts +1 -1
  236. package/src/server/naslServer.ts +0 -1
  237. package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +106 -0
  238. package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +45 -0
  239. package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +102 -0
  240. package/test/concepts/call-logic/fixtures/nested-call-logic.json +934 -0
  241. package/test/concepts/call-logic/getQuickInfoOffset.spec.ts +23 -0
  242. package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +6 -0
  243. package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +5 -0
  244. package/test/concepts/validation-rule/fixtures/argument-without-keyout.json +34 -0
  245. package/test/concepts/validation-rule/validation-rule.spec.ts +15 -0
@@ -0,0 +1,23 @@
1
+ import { expect } from 'chai';
2
+ import type { CallLogic } from '../../../out';
3
+ import { readFixture, getNodeByData } from '../utils';
4
+ import { ConceptName, cases } from './constant';
5
+
6
+ describe(`${ConceptName}:getQuickInfoOffset`, () => {
7
+ const fakeInputOffset = {
8
+ line: 1,
9
+ offset: 1,
10
+ };
11
+
12
+ cases.forEach((name) => {
13
+ it(name, () => {
14
+ const data = readFixture(ConceptName, name);
15
+ const node = getNodeByData<CallLogic>(data);
16
+ const tsCode = node.toEmbeddedTS();
17
+ expect({
18
+ code: tsCode,
19
+ ...node.getQuickInfoOffset(fakeInputOffset, tsCode),
20
+ }).toMatchSnapshot();
21
+ });
22
+ });
23
+ });
@@ -1,5 +1,11 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`validation-rule:toEmbeddedTS argument-without-keyout 1`] = `
4
+ "__IDENTIFIER__;
5
+ nasl.validation.max(new nasl.core.Long(10));
6
+ "
7
+ `;
8
+
3
9
  exports[`validation-rule:toEmbeddedTS with-param-with-target 1`] = `
4
10
  "filter.id;
5
11
  nasl.validation.max(new nasl.core.Long(10));
@@ -1,5 +1,10 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`validation-rule:toJS argument-without-keyout 1`] = `
4
+ "({ validate: \\"max\\", args: [10], trigger: \\"input+blur\\", message: undefined });
5
+ "
6
+ `;
7
+
3
8
  exports[`validation-rule:toJS with-param-with-target 1`] = `
4
9
  "({ validate: \\"max\\", args: [10], trigger: \\"input+blur\\", message: undefined });
5
10
  "
@@ -0,0 +1,34 @@
1
+ {
2
+ "concept": "ValidationRule",
3
+ "changedTime": 1691065082931,
4
+ "name": "",
5
+ "label": "验证规则",
6
+ "folded": false,
7
+ "calleeNamespace": "nasl.validation",
8
+ "calleeName": "max",
9
+ "arguments": [
10
+ {
11
+ "concept": "Argument",
12
+ "name": "",
13
+ "folded": false,
14
+ "keyword": "",
15
+ "expression": {
16
+ "concept": "NumericLiteral",
17
+ "name": "",
18
+ "folded": false,
19
+ "value": "10",
20
+ "typeAnnotation": {
21
+ "concept": "TypeAnnotation",
22
+ "name": "",
23
+ "typeKind": "primitive",
24
+ "typeNamespace": "nasl.core",
25
+ "typeName": "Long",
26
+ "typeArguments": null,
27
+ "returnType": null,
28
+ "properties": null
29
+ }
30
+ }
31
+ }
32
+ ],
33
+ "enableServerValidation": true
34
+ }
@@ -0,0 +1,15 @@
1
+ import { expect } from 'chai';
2
+ import type { ValidationRule } from '../../../out';
3
+ import { readFixture, getNodeByData } from '../utils';
4
+ import { ConceptName } from './constant';
5
+
6
+ describe(ConceptName, () => {
7
+ it('The missing "keyword" props in the validation function argument should be filled after generating the ts file.', () => {
8
+ const data = readFixture(ConceptName, 'argument-without-keyout');
9
+ const node = getNodeByData<ValidationRule>(data);
10
+ expect(node.arguments.length).to.eq(1);
11
+ expect(Boolean(node.arguments[0].keyword)).to.false;
12
+ node.toEmbeddedTS();
13
+ expect(node.arguments[0].keyword).to.eq('max');
14
+ });
15
+ });