@lcap/nasl 3.8.0-beta.8 → 3.8.2-alpha.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 (113) hide show
  1. package/.nyc_output/fe4ca6db-1eb6-4898-8aa5-ba8f8d4128f2.json +1 -0
  2. package/.nyc_output/processinfo/fe4ca6db-1eb6-4898-8aa5-ba8f8d4128f2.json +1 -0
  3. package/.nyc_output/processinfo/index.json +1 -1
  4. package/coverage/cobertura-coverage.xml +9325 -77393
  5. package/out/concepts/AuthLogicForCallInterface__.js +13 -2
  6. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  7. package/out/concepts/BackendVariable__.js +11 -1
  8. package/out/concepts/BackendVariable__.js.map +1 -1
  9. package/out/concepts/BindDirective__.js +1 -1
  10. package/out/concepts/BindDirective__.js.map +1 -1
  11. package/out/concepts/BindStyle__.js +1 -1
  12. package/out/concepts/BindStyle__.js.map +1 -1
  13. package/out/concepts/BusinessComponent__.js +14 -3
  14. package/out/concepts/BusinessComponent__.js.map +1 -1
  15. package/out/concepts/BusinessLogic__.js +13 -2
  16. package/out/concepts/BusinessLogic__.js.map +1 -1
  17. package/out/concepts/CallConnector__.js +2 -1
  18. package/out/concepts/CallConnector__.js.map +1 -1
  19. package/out/concepts/CallInterface__.js +12 -3
  20. package/out/concepts/CallInterface__.js.map +1 -1
  21. package/out/concepts/CallLogic__.js +24 -1
  22. package/out/concepts/CallLogic__.js.map +1 -1
  23. package/out/concepts/EntityProperty__.js +3 -2
  24. package/out/concepts/EntityProperty__.js.map +1 -1
  25. package/out/concepts/Entity__.js +1 -1
  26. package/out/concepts/Entity__.js.map +1 -1
  27. package/out/concepts/EnumItem__.js +2 -2
  28. package/out/concepts/EnumItem__.js.map +1 -1
  29. package/out/concepts/Interface__.js +1 -1
  30. package/out/concepts/Interface__.js.map +1 -1
  31. package/out/concepts/Logic__.js +13 -2
  32. package/out/concepts/Logic__.js.map +1 -1
  33. package/out/concepts/NewComposite__.d.ts +1 -0
  34. package/out/concepts/NewComposite__.js +23 -0
  35. package/out/concepts/NewComposite__.js.map +1 -1
  36. package/out/concepts/OverriddenLogic__.js +13 -2
  37. package/out/concepts/OverriddenLogic__.js.map +1 -1
  38. package/out/concepts/Param__.js +1 -1
  39. package/out/concepts/Param__.js.map +1 -1
  40. package/out/concepts/Structure__.js +1 -3
  41. package/out/concepts/Structure__.js.map +1 -1
  42. package/out/concepts/SubLogic__.js +13 -2
  43. package/out/concepts/SubLogic__.js.map +1 -1
  44. package/out/concepts/TypeAnnotation__.js +6 -3
  45. package/out/concepts/TypeAnnotation__.js.map +1 -1
  46. package/out/concepts/ViewComponentDeclaration__.js +3 -3
  47. package/out/concepts/ViewComponentDeclaration__.js.map +1 -1
  48. package/out/concepts/ViewElement__.d.ts +2 -0
  49. package/out/concepts/ViewElement__.js +60 -19
  50. package/out/concepts/ViewElement__.js.map +1 -1
  51. package/out/concepts/View__.js +24 -2
  52. package/out/concepts/View__.js.map +1 -1
  53. package/out/generator/genBundleFiles.js +1 -1
  54. package/out/generator/genBundleFiles.js.map +1 -1
  55. package/out/natural/genNaturalTS.d.ts +69 -16
  56. package/out/natural/genNaturalTS.js +198 -117
  57. package/out/natural/genNaturalTS.js.map +1 -1
  58. package/out/natural/getContext/index.d.ts +38 -26
  59. package/out/natural/getContext/index.js +318 -160
  60. package/out/natural/getContext/index.js.map +1 -1
  61. package/out/natural/index.d.ts +1 -0
  62. package/out/natural/index.js +1 -0
  63. package/out/natural/index.js.map +1 -1
  64. package/out/natural/tools.d.ts +11 -0
  65. package/out/natural/tools.js +162 -0
  66. package/out/natural/tools.js.map +1 -0
  67. package/out/natural/transformTS2UI.js +63 -26
  68. package/out/natural/transformTS2UI.js.map +1 -1
  69. package/out/natural/transformTSCode.js +26 -15
  70. package/out/natural/transformTSCode.js.map +1 -1
  71. package/out/server/naslServer.js +1 -0
  72. package/out/server/naslServer.js.map +1 -1
  73. package/out/translator/utils.js +1 -1
  74. package/out/translator/utils.js.map +1 -1
  75. package/package.json +1 -1
  76. package/sandbox/stdlib/nasl.util.ts +2 -2
  77. package/sandbox-natural/stdlib/nasl.core.ts +11 -0
  78. package/sandbox-natural/stdlib/nasl.ui.pre.d.ts +37 -37
  79. package/sandbox-natural/stdlib/nasl.util.ts +6 -6
  80. package/src/concepts/AuthLogicForCallInterface__.ts +13 -1
  81. package/src/concepts/BackendVariable__.ts +11 -1
  82. package/src/concepts/BindDirective__.ts +1 -1
  83. package/src/concepts/BindStyle__.ts +1 -1
  84. package/src/concepts/BusinessComponent__.ts +14 -2
  85. package/src/concepts/BusinessLogic__.ts +13 -1
  86. package/src/concepts/CallConnector__.ts +2 -1
  87. package/src/concepts/CallInterface__.ts +10 -3
  88. package/src/concepts/CallLogic__.ts +34 -14
  89. package/src/concepts/EntityProperty__.ts +5 -5
  90. package/src/concepts/Entity__.ts +1 -1
  91. package/src/concepts/EnumItem__.ts +2 -2
  92. package/src/concepts/Interface__.ts +1 -1
  93. package/src/concepts/Logic__.ts +13 -1
  94. package/src/concepts/NewComposite__.ts +24 -0
  95. package/src/concepts/OverriddenLogic__.ts +13 -1
  96. package/src/concepts/Param__.ts +1 -1
  97. package/src/concepts/Structure__.ts +1 -3
  98. package/src/concepts/SubLogic__.ts +13 -1
  99. package/src/concepts/TypeAnnotation__.ts +5 -3
  100. package/src/concepts/ViewComponentDeclaration__.ts +3 -3
  101. package/src/concepts/ViewElement__.ts +78 -19
  102. package/src/concepts/View__.ts +48 -24
  103. package/src/generator/genBundleFiles.ts +1 -1
  104. package/src/natural/genNaturalTS.ts +363 -147
  105. package/src/natural/getContext/index.ts +363 -175
  106. package/src/natural/index.ts +1 -0
  107. package/src/natural/tools.ts +138 -0
  108. package/src/natural/transformTS2UI.ts +60 -25
  109. package/src/natural/transformTSCode.ts +26 -16
  110. package/src/server/naslServer.ts +1 -0
  111. package/src/translator/utils.ts +1 -1
  112. package/.nyc_output/047fb941-6e69-4829-8b3c-14d37e06c63b.json +0 -1
  113. package/.nyc_output/processinfo/047fb941-6e69-4829-8b3c-14d37e06c63b.json +0 -1
@@ -1,15 +1,21 @@
1
- import { App, View, Logic, BaseNode, Frontend } from '../../concepts';
1
+ import { App, View, Logic, BaseNode, Frontend, Module, Structure, Connection, Connector } from '../../concepts';
2
2
  import { TranslatorState } from '../../translator';
3
3
  export interface Snippet {
4
4
  description: string;
5
5
  code: string;
6
+ codeWithDetail?: string;
7
+ namespace?: string;
6
8
  }
7
9
  export interface SnippetBlock {
8
10
  namespace: string;
9
11
  data: Snippet[];
10
12
  }
11
13
  export declare const wrapTSBlock: (code: string) => string;
12
- export declare function getLogicStructures(logic: Logic, type: string, desc: {
14
+ export declare function getReferenceStructures(referenceStructures: {
15
+ typeNamespace: string;
16
+ typeName: string;
17
+ }[], structures: Structure[]): any;
18
+ export declare function getLogicWithStructuresCode(logic: Logic, type: string, desc: {
13
19
  description: string;
14
20
  codeStr: string;
15
21
  }, namespace: string): string;
@@ -22,7 +28,7 @@ export declare function getNaslUtil(): {
22
28
  naslUtil: string;
23
29
  };
24
30
  export declare const getNaslUI: (app: App, frontendType: 'pc' | 'h5', material: {
25
- basicMaterials: {
31
+ basicMaterials: 'pc' | 'h5' | {
26
32
  json: any;
27
33
  tsDeclaration: string;
28
34
  };
@@ -32,15 +38,10 @@ export declare const getNaslUI: (app: App, frontendType: 'pc' | 'h5', material:
32
38
  description: string;
33
39
  tsDescription: string;
34
40
  }[];
35
- } | string, requiredIndexes?: string[]) => {
36
- code: string;
37
- naslUI: {
38
- name: string;
39
- title: string;
40
- description: string;
41
- tsDeclaration: string;
42
- }[];
41
+ }) => {
42
+ naslUI: any;
43
43
  };
44
+ export declare const getNaslUICode: (naslUI: any, codeType: 'detail' | 'short', requiredIndexes?: string[]) => string;
44
45
  export declare const getNaslUIOld: () => {
45
46
  code: string;
46
47
  naslUI: string;
@@ -49,61 +50,71 @@ export declare function getNaslOQL(): {
49
50
  code: string;
50
51
  naslOql: string;
51
52
  };
52
- export declare function getEnums(app: App, state: TranslatorState, requiredIndexes?: string[]): {
53
- code: string;
53
+ export declare function getEnums(app: App, state: TranslatorState): {
54
54
  namespace: string;
55
55
  enums: {
56
56
  namespace: string;
57
57
  data: Snippet[];
58
58
  };
59
59
  };
60
- export declare function getEntities(app: App, state: TranslatorState, requiredIndexes?: string[]): {
61
- code: string;
60
+ export declare const getEnumsCode: (enums: any) => string;
61
+ export declare function getEntities(app: App, state: TranslatorState): {
62
62
  entities: SnippetBlock[];
63
63
  };
64
- export declare function getStructures(app: App, state: TranslatorState, requiredIndexes?: string[]): {
65
- code: string;
64
+ export declare const getEntitiesCode: (entities: any) => string;
65
+ export declare function getStructures(app: App, state: TranslatorState): {
66
66
  structures: {
67
67
  namespace: string;
68
68
  data: Snippet[];
69
69
  };
70
70
  };
71
- export declare function getLogics(app: App, currentNode: BaseNode, requiredIndexes?: string[]): {
72
- code: string;
71
+ export declare const getStructuresCode: (structures: any) => string;
72
+ export declare function getLogics(app: App, currentNode: BaseNode, state: TranslatorState): {
73
73
  appLogics: {
74
74
  namespace: string;
75
75
  data: Snippet[];
76
76
  };
77
77
  };
78
- export declare function getModuleInterfaces(app: App, state: TranslatorState, requiredIndexes?: string[]): {
79
- code: string;
78
+ export declare const getLogicsCode: (appLogics: any, codeType: 'detail' | 'short', requiredIndexes?: string[]) => string;
79
+ export declare function getModuleInterfaces(modules: Module[], state: TranslatorState): {
80
80
  interfaceDependencies: {
81
81
  name: string;
82
82
  structures: SnippetBlock;
83
83
  logics: SnippetBlock;
84
84
  }[];
85
85
  };
86
- export declare function getConnectors(app: App, state: TranslatorState, requiredIndexes?: string[]): {
87
- code: string;
86
+ export declare const getModuleInterfacesCode: (interfaceDependencies: any, codeType: 'detail' | 'short', requiredIndexes?: string[]) => string;
87
+ export declare function getConnections(modules: Connection[], state: TranslatorState): {
88
88
  connections: {
89
89
  name: string;
90
90
  structures: SnippetBlock;
91
91
  logics: SnippetBlock;
92
92
  }[];
93
93
  };
94
- export declare function getDependencies(app: App, state: TranslatorState, requiredIndexes?: string[]): {
95
- code: string;
94
+ export declare function getConnectors(modules: Connector[], state: TranslatorState): {
95
+ connectors: {
96
+ name: string;
97
+ structures: SnippetBlock;
98
+ logics: SnippetBlock;
99
+ }[];
100
+ };
101
+ export declare const getConnectorsCode: (connections: any, codeType: 'detail' | 'short', requiredIndexes?: string[]) => string;
102
+ export declare function getDependencies(modules: Module[], state: TranslatorState, logicType: any, frontendType: 'pc' | 'h5'): {
96
103
  dependencies: {
97
104
  name: string;
98
105
  structures: SnippetBlock;
99
106
  logics: SnippetBlock;
100
107
  }[];
101
108
  };
109
+ export declare const getDependenciesCode: (dependencies: any, codeType: 'detail' | 'short', requiredIndexes?: string[]) => string;
102
110
  export declare function getFrontendVariables(frontend: Frontend, state: TranslatorState): {
103
111
  code: string;
104
- frontendVar: string;
105
112
  frontendVariables: string;
106
113
  };
114
+ export declare function getServerVariables(app: App, state: TranslatorState): {
115
+ code: string;
116
+ backendVariables: string;
117
+ };
107
118
  export declare function getChildrenViews(view: View, currentNode: BaseNode, convertChildren: boolean, prefix: string): Snippet[];
108
119
  export declare function getFrontendViews(frontend: Frontend, state: TranslatorState, currentNode: BaseNode, convertChildren: boolean): {
109
120
  code: string;
@@ -112,6 +123,7 @@ export declare function getFrontendViews(frontend: Frontend, state: TranslatorSt
112
123
  data: Snippet[];
113
124
  };
114
125
  };
126
+ export declare const getFrontendViewsCode: (views: any) => string;
115
127
  export declare function getCurrentNodeContext(currentNode: BaseNode, focusedNodePath?: string, experimental?: boolean): {
116
128
  code: string;
117
129
  currentLogic: string;