@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.
- package/.nyc_output/fe4ca6db-1eb6-4898-8aa5-ba8f8d4128f2.json +1 -0
- package/.nyc_output/processinfo/fe4ca6db-1eb6-4898-8aa5-ba8f8d4128f2.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/cobertura-coverage.xml +9325 -77393
- package/out/concepts/AuthLogicForCallInterface__.js +13 -2
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +11 -1
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BindDirective__.js +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindStyle__.js +1 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BusinessComponent__.js +14 -3
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.js +13 -2
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallConnector__.js +2 -1
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallInterface__.js +12 -3
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +24 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +3 -2
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +1 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js +2 -2
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Interface__.js +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/Logic__.js +13 -2
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +1 -0
- package/out/concepts/NewComposite__.js +23 -0
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +13 -2
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +1 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Structure__.js +1 -3
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SubLogic__.js +13 -2
- package/out/concepts/SubLogic__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +6 -3
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/ViewComponentDeclaration__.js +3 -3
- package/out/concepts/ViewComponentDeclaration__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +2 -0
- package/out/concepts/ViewElement__.js +60 -19
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +24 -2
- package/out/concepts/View__.js.map +1 -1
- package/out/generator/genBundleFiles.js +1 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/natural/genNaturalTS.d.ts +69 -16
- package/out/natural/genNaturalTS.js +198 -117
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/getContext/index.d.ts +38 -26
- package/out/natural/getContext/index.js +318 -160
- package/out/natural/getContext/index.js.map +1 -1
- package/out/natural/index.d.ts +1 -0
- package/out/natural/index.js +1 -0
- package/out/natural/index.js.map +1 -1
- package/out/natural/tools.d.ts +11 -0
- package/out/natural/tools.js +162 -0
- package/out/natural/tools.js.map +1 -0
- package/out/natural/transformTS2UI.js +63 -26
- package/out/natural/transformTS2UI.js.map +1 -1
- package/out/natural/transformTSCode.js +26 -15
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/naslServer.js +1 -0
- package/out/server/naslServer.js.map +1 -1
- package/out/translator/utils.js +1 -1
- package/out/translator/utils.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.util.ts +2 -2
- package/sandbox-natural/stdlib/nasl.core.ts +11 -0
- package/sandbox-natural/stdlib/nasl.ui.pre.d.ts +37 -37
- package/sandbox-natural/stdlib/nasl.util.ts +6 -6
- package/src/concepts/AuthLogicForCallInterface__.ts +13 -1
- package/src/concepts/BackendVariable__.ts +11 -1
- package/src/concepts/BindDirective__.ts +1 -1
- package/src/concepts/BindStyle__.ts +1 -1
- package/src/concepts/BusinessComponent__.ts +14 -2
- package/src/concepts/BusinessLogic__.ts +13 -1
- package/src/concepts/CallConnector__.ts +2 -1
- package/src/concepts/CallInterface__.ts +10 -3
- package/src/concepts/CallLogic__.ts +34 -14
- package/src/concepts/EntityProperty__.ts +5 -5
- package/src/concepts/Entity__.ts +1 -1
- package/src/concepts/EnumItem__.ts +2 -2
- package/src/concepts/Interface__.ts +1 -1
- package/src/concepts/Logic__.ts +13 -1
- package/src/concepts/NewComposite__.ts +24 -0
- package/src/concepts/OverriddenLogic__.ts +13 -1
- package/src/concepts/Param__.ts +1 -1
- package/src/concepts/Structure__.ts +1 -3
- package/src/concepts/SubLogic__.ts +13 -1
- package/src/concepts/TypeAnnotation__.ts +5 -3
- package/src/concepts/ViewComponentDeclaration__.ts +3 -3
- package/src/concepts/ViewElement__.ts +78 -19
- package/src/concepts/View__.ts +48 -24
- package/src/generator/genBundleFiles.ts +1 -1
- package/src/natural/genNaturalTS.ts +363 -147
- package/src/natural/getContext/index.ts +363 -175
- package/src/natural/index.ts +1 -0
- package/src/natural/tools.ts +138 -0
- package/src/natural/transformTS2UI.ts +60 -25
- package/src/natural/transformTSCode.ts +26 -16
- package/src/server/naslServer.ts +1 -0
- package/src/translator/utils.ts +1 -1
- package/.nyc_output/047fb941-6e69-4829-8b3c-14d37e06c63b.json +0 -1
- 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
|
|
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
|
-
}
|
|
36
|
-
|
|
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
|
|
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
|
|
61
|
-
|
|
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
|
|
65
|
-
|
|
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
|
|
72
|
-
|
|
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
|
|
79
|
-
|
|
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
|
|
87
|
-
|
|
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
|
|
95
|
-
|
|
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;
|