@lcap/nasl 2.12.0-beta → 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.
- package/out/automate/engine/index.d.ts +1 -0
- package/out/automate/engine/index.js +23 -12
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/operators.d.ts +10 -2
- package/out/automate/engine/operators.js +105 -7
- package/out/automate/engine/operators.js.map +1 -1
- package/out/automate/engine/uniqueName.d.ts +8 -2
- package/out/automate/engine/uniqueName.js +72 -4
- package/out/automate/engine/uniqueName.js.map +1 -1
- package/out/automate/engine/utils.js +4 -1
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/process.d.ts +9 -0
- package/out/automate/template/process.js +10976 -0
- package/out/automate/template/process.js.map +1 -0
- package/out/bak/translator.js +1 -0
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +5 -0
- package/out/common/BaseNode.js +24 -3
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.js +3 -2
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/Assignment__.js +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +9 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +6 -2
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +4 -0
- package/out/concepts/BooleanLiteral__.js +12 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js +2 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +1 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +27 -11
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +1 -1
- package/out/concepts/CallQueryComponent__.js +3 -3
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +1 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.js +2 -0
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/End__.js +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.js +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +1 -1
- 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 +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +1 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +2 -2
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +3 -2
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +1 -1
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +1 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +2 -2
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +2 -4
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.js +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +7 -6
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +118 -112
- package/out/concepts/Module__.js +25 -7
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +2 -2
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.js +2 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +7 -2
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.d.ts +1 -1
- package/out/concepts/Process__.js +2 -2
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js +2 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +4 -0
- package/out/concepts/SqlQueryComponent__.js +16 -0
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -2
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +5 -4
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +1 -1
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +1 -1
- package/out/concepts/SwitchCase__.js +19 -21
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +2 -7
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +2 -2
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +2 -2
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +1 -1
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +9 -4
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +0 -2
- package/out/concepts/View__.js +4 -11
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +20 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.d.ts +4 -0
- package/out/concepts/basics/stdlib/nasl.process.js +410 -0
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +1 -11
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +25 -25
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +1 -0
- package/out/concepts/basics/types/index.js +4 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +3 -1
- package/out/generator/genBundleFiles.js +16 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +1 -0
- package/out/generator/genMetaData.js +7 -0
- package/out/generator/genMetaData.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.js +2 -1
- package/out/index.js.map +1 -1
- package/out/server/getLogics.js +18 -0
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +5 -0
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +1 -0
- package/out/server/getProcesses.js +9 -1
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.d.ts +1 -0
- package/out/server/naslServer.js +98 -23
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +21 -3
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -0
- package/out/service/storage/init.js +94 -83
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +20 -14
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +13 -6
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +20 -8
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -1
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +1 -1
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +8 -4
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +1 -2
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +20 -21
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genTableBlock.js +14 -6
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +20 -14
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/utils/index.d.ts +1 -0
- package/out/utils/index.js +19 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/automate/engine/index.js +21 -7
- package/src/automate/engine/operators.js +114 -17
- package/src/automate/engine/uniqueName.js +77 -9
- package/src/automate/engine/utils.js +4 -2
- package/src/automate/template/process.js +10999 -0
- package/src/bak/translator.js +1 -0
- package/src/common/BaseNode.ts +21 -4
- package/src/concepts/App__.ts +4 -40
- package/src/concepts/Argument__.ts +1 -1
- package/src/concepts/Assignee__.ts +1 -1
- package/src/concepts/Assignment__.ts +1 -1
- package/src/concepts/Attribute__.ts +1 -1
- package/src/concepts/BinaryExpression__.ts +1 -1
- package/src/concepts/BindAttribute__.ts +1 -1
- package/src/concepts/BindDirective__.ts +8 -6
- package/src/concepts/BindEvent__.ts +6 -2
- package/src/concepts/BooleanLiteral__.ts +13 -1
- package/src/concepts/CallFunction__.ts +15 -14
- package/src/concepts/CallInterface__.ts +1 -1
- package/src/concepts/CallLogic__.ts +26 -11
- package/src/concepts/CallQueryComponent__.ts +32 -4
- package/src/concepts/Comment__.ts +1 -1
- package/src/concepts/CompletionProperty__.ts +1 -1
- package/src/concepts/ConfigGroup__.ts +1 -1
- package/src/concepts/ConfigPropertyValue__.ts +1 -1
- package/src/concepts/ConfigProperty__.ts +1 -1
- package/src/concepts/Configuration__.ts +1 -1
- package/src/concepts/Constant__.ts +1 -1
- package/src/concepts/DataElement__.ts +1 -1
- package/src/concepts/DataSource__.ts +2 -0
- package/src/concepts/End__.ts +1 -1
- package/src/concepts/EntityIndex__.ts +1 -1
- package/src/concepts/EntityProperty__.ts +1 -1
- package/src/concepts/Entity__.ts +1 -1
- package/src/concepts/EnumItem__.ts +1 -1
- package/src/concepts/Enum__.ts +1 -1
- package/src/concepts/Event__.ts +1 -1
- package/src/concepts/ForEachStatement__.ts +1 -1
- package/src/concepts/Function__.ts +5 -5
- package/src/concepts/Identifier__.ts +3 -2
- package/src/concepts/IfStatement__.ts +1 -1
- package/src/concepts/InterfaceParam__.ts +1 -1
- package/src/concepts/Interface__.ts +2 -2
- package/src/concepts/JSBlock__.ts +2 -11
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +8 -44
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/Module__.ts +141 -147
- package/src/concepts/Namespace__.ts +2 -2
- package/src/concepts/NullLiteral__.ts +1 -1
- package/src/concepts/NumericLiteral__.ts +1 -1
- package/src/concepts/Param__.ts +2 -2
- package/src/concepts/Point__.ts +1 -1
- package/src/concepts/ProcessComponent__.ts +1 -1
- package/src/concepts/ProcessElement__.ts +8 -3
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/Process__.ts +3 -3
- package/src/concepts/QueryAggregateExpression__.ts +1 -1
- package/src/concepts/QueryFieldExpression__.ts +1 -1
- package/src/concepts/QueryFromExpression__.ts +1 -1
- package/src/concepts/QueryGroupByExpression__.ts +1 -1
- package/src/concepts/QueryJoinExpression__.ts +1 -1
- package/src/concepts/QueryLimitExpression__.ts +1 -1
- package/src/concepts/QueryOrderByExpression__.ts +1 -1
- package/src/concepts/QuerySelectExpression__.ts +1 -1
- package/src/concepts/Rect__.ts +1 -1
- package/src/concepts/Return__.ts +2 -2
- package/src/concepts/Role__.ts +1 -1
- package/src/concepts/Slot__.ts +1 -1
- package/src/concepts/SqlQueryComponent__.ts +17 -0
- package/src/concepts/Start__.ts +1 -1
- package/src/concepts/StringLiteral__.ts +2 -2
- package/src/concepts/StructureProperty__.ts +5 -8
- package/src/concepts/Structure__.ts +1 -1
- package/src/concepts/SwitchCase__.ts +19 -23
- package/src/concepts/SwitchStatement__.ts +2 -6
- package/src/concepts/Theme__.ts +1 -1
- package/src/concepts/Transactional__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +21 -2
- package/src/concepts/TypeParam__.ts +1 -1
- package/src/concepts/UnaryExpression__.ts +1 -1
- package/src/concepts/Unparsed__.ts +1 -1
- package/src/concepts/UseComponent__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +1 -1
- package/src/concepts/Variable__.ts +2 -2
- package/src/concepts/ViewComponent__.ts +1 -1
- package/src/concepts/ViewElement__.ts +10 -23
- package/src/concepts/View__.ts +6 -13
- package/src/concepts/WhileStatement__.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.auth.ts +20 -0
- package/src/concepts/basics/stdlib/nasl.process.ts +406 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +1 -11
- package/src/concepts/basics/stdlib/nasl.util.ts +25 -25
- package/src/concepts/basics/types/index.ts +1 -0
- package/src/generator/genBundleFiles.ts +21 -5
- package/src/generator/genMetaData.ts +10 -1
- package/src/index.ts +1 -1
- package/src/server/getLogics.ts +18 -1
- package/src/server/getMemberIdentifier.ts +4 -0
- package/src/server/getProcesses.ts +8 -1
- package/src/server/naslServer.ts +107 -28
- package/src/server/translator.ts +20 -3
- package/src/service/creator/errHandles.js +6 -0
- package/src/service/storage/init.ts +96 -85
- package/src/templator/genCreateBlock.ts +20 -14
- package/src/templator/genCurdEditMultipleKeyBlock.ts +13 -8
- package/src/templator/genCurdMultipleKeyBlock.ts +20 -9
- package/src/templator/genEditTableBlock.ts +3 -1
- package/src/templator/genEnumSelectBlock.ts +1 -1
- package/src/templator/genGridViewBlock.ts +8 -4
- package/src/templator/genListViewBlock.ts +1 -2
- package/src/templator/genQueryComponent.ts +22 -21
- package/src/templator/genTableBlock.ts +14 -7
- package/src/templator/genUpdateBlock.ts +20 -14
- package/src/utils/index.ts +19 -0
package/src/concepts/Module__.ts
CHANGED
|
@@ -70,7 +70,7 @@ export class Module extends BaseNode {
|
|
|
70
70
|
* 外部语言依赖
|
|
71
71
|
*/
|
|
72
72
|
@property()
|
|
73
|
-
externalDependencyMap: { maven?: Array<{ groupId: string
|
|
73
|
+
externalDependencyMap: { maven?: Array<{ groupId: string; artifactId: string; version: string }> } = undefined;
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* 数据结构列表
|
|
@@ -145,9 +145,8 @@ export class Module extends BaseNode {
|
|
|
145
145
|
}
|
|
146
146
|
return params;
|
|
147
147
|
}
|
|
148
|
-
|
|
149
148
|
|
|
150
|
-
|
|
149
|
+
getStructureExistingNames(excludedList: Array<Structure> = []) {
|
|
151
150
|
const excludedSet = new Set(excludedList);
|
|
152
151
|
return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
153
152
|
}
|
|
@@ -156,24 +155,24 @@ export class Module extends BaseNode {
|
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
/**
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
158
|
+
* 插入数据结构
|
|
159
|
+
* @internal
|
|
160
|
+
* @param name 数据结构名称,如果不填会自动生成一个唯一名称
|
|
161
|
+
*/
|
|
163
162
|
_insertStructureAt(name: string, index: number): Structure;
|
|
164
163
|
|
|
165
164
|
/**
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
* 插入数据结构
|
|
166
|
+
* @internal
|
|
167
|
+
* @param structureOptions 数据结构参数
|
|
168
|
+
*/
|
|
170
169
|
_insertStructureAt(structureOptions: Partial<Structure>, index: number): Structure;
|
|
171
170
|
|
|
172
171
|
/**
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
172
|
+
* 插入数据结构
|
|
173
|
+
* @internal
|
|
174
|
+
* @param structure 已有的数据结构实例
|
|
175
|
+
*/
|
|
177
176
|
_insertStructureAt(structure: Structure, index: number): Structure;
|
|
178
177
|
|
|
179
178
|
_insertStructureAt(options: string | Partial<Structure> | Structure, index: number) {
|
|
@@ -288,7 +287,6 @@ export class Module extends BaseNode {
|
|
|
288
287
|
return node;
|
|
289
288
|
}
|
|
290
289
|
|
|
291
|
-
|
|
292
290
|
getEnumExistingNames(excludedList: Array<Enum> = []) {
|
|
293
291
|
const excludedSet = new Set(excludedList);
|
|
294
292
|
return (this.enums || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -298,24 +296,24 @@ export class Module extends BaseNode {
|
|
|
298
296
|
}
|
|
299
297
|
|
|
300
298
|
/**
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
* 插入枚举
|
|
300
|
+
* @internal
|
|
301
|
+
* @param name 枚举名称,如果不填会自动生成一个唯一名称
|
|
302
|
+
*/
|
|
305
303
|
_insertEnumAt(name: string, index: number): Enum;
|
|
306
304
|
|
|
307
305
|
/**
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
306
|
+
* 插入枚举
|
|
307
|
+
* @internal
|
|
308
|
+
* @param enumerationOptions 枚举参数
|
|
309
|
+
*/
|
|
312
310
|
_insertEnumAt(enumerationOptions: Partial<Enum>, index: number): Enum;
|
|
313
311
|
|
|
314
312
|
/**
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
313
|
+
* 插入枚举
|
|
314
|
+
* @internal
|
|
315
|
+
* @param enumeration 已有的枚举实例
|
|
316
|
+
*/
|
|
319
317
|
_insertEnumAt(enumeration: Enum, index: number): Enum;
|
|
320
318
|
|
|
321
319
|
_insertEnumAt(options: string | Partial<Enum> | Enum, index: number) {
|
|
@@ -430,7 +428,6 @@ export class Module extends BaseNode {
|
|
|
430
428
|
return node;
|
|
431
429
|
}
|
|
432
430
|
|
|
433
|
-
|
|
434
431
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
435
432
|
const excludedSet = new Set(excludedList);
|
|
436
433
|
return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -440,24 +437,24 @@ export class Module extends BaseNode {
|
|
|
440
437
|
}
|
|
441
438
|
|
|
442
439
|
/**
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
440
|
+
* 插入逻辑
|
|
441
|
+
* @internal
|
|
442
|
+
* @param name 逻辑名称,如果不填会自动生成一个唯一名称
|
|
443
|
+
*/
|
|
447
444
|
_insertLogicAt(name: string, index: number): Logic;
|
|
448
445
|
|
|
449
446
|
/**
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
447
|
+
* 插入逻辑
|
|
448
|
+
* @internal
|
|
449
|
+
* @param logicOptions 逻辑参数
|
|
450
|
+
*/
|
|
454
451
|
_insertLogicAt(logicOptions: Partial<Logic>, index: number): Logic;
|
|
455
452
|
|
|
456
453
|
/**
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
454
|
+
* 插入逻辑
|
|
455
|
+
* @internal
|
|
456
|
+
* @param logic 已有的逻辑实例
|
|
457
|
+
*/
|
|
461
458
|
_insertLogicAt(logic: Logic, index: number): Logic;
|
|
462
459
|
|
|
463
460
|
_insertLogicAt(options: string | Partial<Logic> | Logic, index: number) {
|
|
@@ -572,7 +569,6 @@ export class Module extends BaseNode {
|
|
|
572
569
|
return node;
|
|
573
570
|
}
|
|
574
571
|
|
|
575
|
-
|
|
576
572
|
getInterfaceExistingNames(excludedList: Array<Interface> = []) {
|
|
577
573
|
const excludedSet = new Set(excludedList);
|
|
578
574
|
return (this.interfaces || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -582,24 +578,24 @@ export class Module extends BaseNode {
|
|
|
582
578
|
}
|
|
583
579
|
|
|
584
580
|
/**
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
581
|
+
* 插入接口
|
|
582
|
+
* @internal
|
|
583
|
+
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
584
|
+
*/
|
|
589
585
|
_insertInterfaceAt(name: string, index: number): Interface;
|
|
590
586
|
|
|
591
587
|
/**
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
588
|
+
* 插入接口
|
|
589
|
+
* @internal
|
|
590
|
+
* @param itfaceOptions 接口参数
|
|
591
|
+
*/
|
|
596
592
|
_insertInterfaceAt(itfaceOptions: Partial<Interface>, index: number): Interface;
|
|
597
593
|
|
|
598
594
|
/**
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
595
|
+
* 插入接口
|
|
596
|
+
* @internal
|
|
597
|
+
* @param itface 已有的接口实例
|
|
598
|
+
*/
|
|
603
599
|
_insertInterfaceAt(itface: Interface, index: number): Interface;
|
|
604
600
|
|
|
605
601
|
_insertInterfaceAt(options: string | Partial<Interface> | Interface, index: number) {
|
|
@@ -714,7 +710,6 @@ export class Module extends BaseNode {
|
|
|
714
710
|
return node;
|
|
715
711
|
}
|
|
716
712
|
|
|
717
|
-
|
|
718
713
|
getViewExistingNames(excludedList: Array<View> = []) {
|
|
719
714
|
const excludedSet = new Set(excludedList);
|
|
720
715
|
return (this.views || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -724,24 +719,24 @@ export class Module extends BaseNode {
|
|
|
724
719
|
}
|
|
725
720
|
|
|
726
721
|
/**
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
722
|
+
* 插入页面
|
|
723
|
+
* @internal
|
|
724
|
+
* @param name 页面名称,如果不填会自动生成一个唯一名称
|
|
725
|
+
*/
|
|
731
726
|
_insertViewAt(name: string, index: number): View;
|
|
732
727
|
|
|
733
728
|
/**
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
729
|
+
* 插入页面
|
|
730
|
+
* @internal
|
|
731
|
+
* @param viewOptions 页面参数
|
|
732
|
+
*/
|
|
738
733
|
_insertViewAt(viewOptions: Partial<View>, index: number): View;
|
|
739
734
|
|
|
740
735
|
/**
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
736
|
+
* 插入页面
|
|
737
|
+
* @internal
|
|
738
|
+
* @param view 已有的页面实例
|
|
739
|
+
*/
|
|
745
740
|
_insertViewAt(view: View, index: number): View;
|
|
746
741
|
|
|
747
742
|
_insertViewAt(options: string | Partial<View> | View, index: number) {
|
|
@@ -856,7 +851,6 @@ export class Module extends BaseNode {
|
|
|
856
851
|
return node;
|
|
857
852
|
}
|
|
858
853
|
|
|
859
|
-
|
|
860
854
|
getProcessExistingNames(excludedList: Array<Process> = []) {
|
|
861
855
|
const excludedSet = new Set(excludedList);
|
|
862
856
|
return (this.processes || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -866,24 +860,24 @@ export class Module extends BaseNode {
|
|
|
866
860
|
}
|
|
867
861
|
|
|
868
862
|
/**
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
863
|
+
* 插入流程
|
|
864
|
+
* @internal
|
|
865
|
+
* @param name 流程名称,如果不填会自动生成一个唯一名称
|
|
866
|
+
*/
|
|
873
867
|
_insertProcessAt(name: string, index: number): Process;
|
|
874
868
|
|
|
875
869
|
/**
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
870
|
+
* 插入流程
|
|
871
|
+
* @internal
|
|
872
|
+
* @param processOptions 流程参数
|
|
873
|
+
*/
|
|
880
874
|
_insertProcessAt(processOptions: Partial<Process>, index: number): Process;
|
|
881
875
|
|
|
882
876
|
/**
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
877
|
+
* 插入流程
|
|
878
|
+
* @internal
|
|
879
|
+
* @param process 已有的流程实例
|
|
880
|
+
*/
|
|
887
881
|
_insertProcessAt(process: Process, index: number): Process;
|
|
888
882
|
|
|
889
883
|
_insertProcessAt(options: string | Partial<Process> | Process, index: number) {
|
|
@@ -998,7 +992,6 @@ export class Module extends BaseNode {
|
|
|
998
992
|
return node;
|
|
999
993
|
}
|
|
1000
994
|
|
|
1001
|
-
|
|
1002
995
|
getViewComponentExistingNames(excludedList: Array<ViewComponent> = []) {
|
|
1003
996
|
const excludedSet = new Set(excludedList);
|
|
1004
997
|
return (this.viewComponents || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1008,24 +1001,24 @@ export class Module extends BaseNode {
|
|
|
1008
1001
|
}
|
|
1009
1002
|
|
|
1010
1003
|
/**
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1004
|
+
* 插入页面组件
|
|
1005
|
+
* @internal
|
|
1006
|
+
* @param name 页面组件名称,如果不填会自动生成一个唯一名称
|
|
1007
|
+
*/
|
|
1015
1008
|
_insertViewComponentAt(name: string, index: number): ViewComponent;
|
|
1016
1009
|
|
|
1017
1010
|
/**
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1011
|
+
* 插入页面组件
|
|
1012
|
+
* @internal
|
|
1013
|
+
* @param viewComponentOptions 页面组件参数
|
|
1014
|
+
*/
|
|
1022
1015
|
_insertViewComponentAt(viewComponentOptions: Partial<ViewComponent>, index: number): ViewComponent;
|
|
1023
1016
|
|
|
1024
1017
|
/**
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1018
|
+
* 插入页面组件
|
|
1019
|
+
* @internal
|
|
1020
|
+
* @param viewComponent 已有的页面组件实例
|
|
1021
|
+
*/
|
|
1029
1022
|
_insertViewComponentAt(viewComponent: ViewComponent, index: number): ViewComponent;
|
|
1030
1023
|
|
|
1031
1024
|
_insertViewComponentAt(options: string | Partial<ViewComponent> | ViewComponent, index: number) {
|
|
@@ -1140,13 +1133,10 @@ export class Module extends BaseNode {
|
|
|
1140
1133
|
return node;
|
|
1141
1134
|
}
|
|
1142
1135
|
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
1136
|
/**
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1137
|
+
* 删除数据结构
|
|
1138
|
+
* @param name 数据结构名称
|
|
1139
|
+
*/
|
|
1150
1140
|
removeStructure(name: string): void;
|
|
1151
1141
|
|
|
1152
1142
|
/**
|
|
@@ -1191,12 +1181,10 @@ export class Module extends BaseNode {
|
|
|
1191
1181
|
return params;
|
|
1192
1182
|
}
|
|
1193
1183
|
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
1184
|
/**
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1185
|
+
* 删除枚举
|
|
1186
|
+
* @param name 枚举名称
|
|
1187
|
+
*/
|
|
1200
1188
|
removeEnum(name: string): void;
|
|
1201
1189
|
|
|
1202
1190
|
/**
|
|
@@ -1241,12 +1229,10 @@ export class Module extends BaseNode {
|
|
|
1241
1229
|
return params;
|
|
1242
1230
|
}
|
|
1243
1231
|
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
1232
|
/**
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1233
|
+
* 删除逻辑
|
|
1234
|
+
* @param name 逻辑名称
|
|
1235
|
+
*/
|
|
1250
1236
|
removeLogic(name: string): void;
|
|
1251
1237
|
|
|
1252
1238
|
/**
|
|
@@ -1291,12 +1277,10 @@ export class Module extends BaseNode {
|
|
|
1291
1277
|
return params;
|
|
1292
1278
|
}
|
|
1293
1279
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
1280
|
/**
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1281
|
+
* 删除接口
|
|
1282
|
+
* @param name 接口名称
|
|
1283
|
+
*/
|
|
1300
1284
|
removeInterface(name: string): void;
|
|
1301
1285
|
|
|
1302
1286
|
/**
|
|
@@ -1341,12 +1325,10 @@ export class Module extends BaseNode {
|
|
|
1341
1325
|
return params;
|
|
1342
1326
|
}
|
|
1343
1327
|
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
1328
|
/**
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1329
|
+
* 删除页面
|
|
1330
|
+
* @param name 页面名称
|
|
1331
|
+
*/
|
|
1350
1332
|
removeView(name: string): void;
|
|
1351
1333
|
|
|
1352
1334
|
/**
|
|
@@ -1391,12 +1373,10 @@ export class Module extends BaseNode {
|
|
|
1391
1373
|
return params;
|
|
1392
1374
|
}
|
|
1393
1375
|
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
1376
|
/**
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1377
|
+
* 删除流程
|
|
1378
|
+
* @param name 流程名称
|
|
1379
|
+
*/
|
|
1400
1380
|
removeProcess(name: string): void;
|
|
1401
1381
|
|
|
1402
1382
|
/**
|
|
@@ -1441,12 +1421,10 @@ export class Module extends BaseNode {
|
|
|
1441
1421
|
return params;
|
|
1442
1422
|
}
|
|
1443
1423
|
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
1424
|
/**
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1425
|
+
* 删除页面组件
|
|
1426
|
+
* @param name 页面组件名称
|
|
1427
|
+
*/
|
|
1450
1428
|
removeViewComponent(name: string): void;
|
|
1451
1429
|
|
|
1452
1430
|
/**
|
|
@@ -1495,37 +1473,53 @@ export class Module extends BaseNode {
|
|
|
1495
1473
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1496
1474
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
1497
1475
|
//================================================================================
|
|
1498
|
-
|
|
1499
1476
|
/**
|
|
1477
|
+
* 用于区分存量应用新导入模块,存量应用替换数据结构使用
|
|
1478
|
+
*/
|
|
1479
|
+
@property()
|
|
1480
|
+
isAdd: boolean;
|
|
1481
|
+
|
|
1482
|
+
setIsAdd(isAdd: boolean) {
|
|
1483
|
+
const object = {
|
|
1484
|
+
isAdd,
|
|
1485
|
+
};
|
|
1486
|
+
this.update({
|
|
1487
|
+
...object,
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1500
1491
|
* 生成宿主语言的文件路径
|
|
1501
1492
|
* @param name 一般不用传,用于 rename
|
|
1502
1493
|
*/
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1494
|
+
getEmbeddedFilePath(name = this.name) {
|
|
1495
|
+
return `/embedded/${this.app.name}/${this.parentKey}/${this.name}`;
|
|
1496
|
+
}
|
|
1497
|
+
/**
|
|
1507
1498
|
* 获取命名空间和
|
|
1508
1499
|
* 暂时不考虑 Module 嵌套的情况
|
|
1509
1500
|
*/
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1501
|
+
getNamespace() {
|
|
1502
|
+
return `${moduleNameSpace[this.parentKey as ModuleKeyType]}`;
|
|
1503
|
+
}
|
|
1513
1504
|
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1505
|
+
getTsNamespace() {
|
|
1506
|
+
return `${moduleNameSpace[this.parentKey as ModuleKeyType]}`;
|
|
1507
|
+
}
|
|
1508
|
+
getTsNamespaceAndName() {
|
|
1509
|
+
return `${moduleNameSpace[this.parentKey as ModuleKeyType]}.${this.name}`;
|
|
1510
|
+
}
|
|
1517
1511
|
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1512
|
+
findEnumByName(name: string) {
|
|
1513
|
+
return this.enums.find((enumItem) => enumItem.name === name);
|
|
1514
|
+
}
|
|
1521
1515
|
|
|
1522
|
-
|
|
1516
|
+
/**
|
|
1523
1517
|
* 获取属性节点是否存在
|
|
1524
1518
|
*/
|
|
1525
1519
|
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1520
|
+
findProperty(name: string, propertyType: PropertyType): any {
|
|
1521
|
+
return ((this as any)[propertyType] as Array<any>).find((item) => item.name === name);
|
|
1522
|
+
}
|
|
1529
1523
|
|
|
1530
1524
|
//================================================================================
|
|
1531
1525
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -2288,7 +2288,7 @@ export class Namespace extends BaseNode {
|
|
|
2288
2288
|
if (this.path)
|
|
2289
2289
|
return this.path;
|
|
2290
2290
|
else if (this.parentNode && (this.parentNode as Namespace).getNamespace)
|
|
2291
|
-
return `${(this.parentNode as Namespace).getNamespace()}
|
|
2291
|
+
return `${(this.parentNode as Namespace).getNamespace()}`;
|
|
2292
2292
|
else
|
|
2293
2293
|
throw new Error('无法获取命名空间,请设置 parentNode 或临时的 path!');
|
|
2294
2294
|
}
|
|
@@ -2319,7 +2319,7 @@ export class Namespace extends BaseNode {
|
|
|
2319
2319
|
//================================================================================
|
|
2320
2320
|
}
|
|
2321
2321
|
|
|
2322
|
-
classMap
|
|
2322
|
+
classMap['Namespace'] = Namespace;
|
|
2323
2323
|
export default Namespace;
|
|
2324
2324
|
//================================================================================
|
|
2325
2325
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -76,7 +76,7 @@ export class NullLiteral extends LogicItem {
|
|
|
76
76
|
//================================================================================
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
classMap
|
|
79
|
+
classMap['NullLiteral'] = NullLiteral;
|
|
80
80
|
export default NullLiteral;
|
|
81
81
|
//================================================================================
|
|
82
82
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -187,7 +187,7 @@ export class NumericLiteral extends LogicItem {
|
|
|
187
187
|
//================================================================================
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
classMap
|
|
190
|
+
classMap['NumericLiteral'] = NumericLiteral;
|
|
191
191
|
export default NumericLiteral;
|
|
192
192
|
//================================================================================
|
|
193
193
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -356,7 +356,7 @@ export class Param extends BaseNode {
|
|
|
356
356
|
const { typeName, typeKind, typeNamespace } = newTypeAnnotation || this.typeAnnotation;
|
|
357
357
|
let completionChildren;
|
|
358
358
|
if (typeKind === 'reference') {
|
|
359
|
-
if (typeNamespace === 'nasl.ui') {
|
|
359
|
+
if (typeNamespace === 'nasl.ui' || typeNamespace === 'nasl.process') {
|
|
360
360
|
const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
|
|
361
361
|
const properties = node.properties || [];
|
|
362
362
|
completionChildren = properties;
|
|
@@ -394,7 +394,7 @@ export class Param extends BaseNode {
|
|
|
394
394
|
//================================================================================
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
classMap
|
|
397
|
+
classMap['Param'] = Param;
|
|
398
398
|
export default Param;
|
|
399
399
|
//================================================================================
|
|
400
400
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
package/src/concepts/Point__.ts
CHANGED
|
@@ -77,7 +77,7 @@ export class Point extends BaseNode {
|
|
|
77
77
|
//================================================================================
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
classMap
|
|
80
|
+
classMap['Point'] = Point;
|
|
81
81
|
export default Point;
|
|
82
82
|
//================================================================================
|
|
83
83
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -495,7 +495,7 @@ export class ProcessComponent extends BaseNode {
|
|
|
495
495
|
//================================================================================
|
|
496
496
|
}
|
|
497
497
|
|
|
498
|
-
classMap
|
|
498
|
+
classMap['ProcessComponent'] = ProcessComponent;
|
|
499
499
|
export default ProcessComponent;
|
|
500
500
|
//================================================================================
|
|
501
501
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, embeddedTSEmitter } from '../translator';
|
|
2
|
-
import { constantToParam, genUserTaskLogic, returnToParam, getPreviousTask, syncMemberExpression, getFlowAfterElements, isFromStartNode } from '../server/getProcesses';
|
|
2
|
+
import { constantToParam, genUserTaskLogic, returnToParam, getPreviousTask, syncMemberExpression, getFlowAfterElements, isFromStartNode, getFlowBeforeElements } from '../server/getProcesses';
|
|
3
3
|
//================================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -1347,6 +1347,7 @@ export class ProcessElement extends BaseNode {
|
|
|
1347
1347
|
code += `${property.toEmbeddedTSInProcess(shiftState(state, code, { inline: true }))},\n`;
|
|
1348
1348
|
});
|
|
1349
1349
|
const afterLinks = getFlowAfterElements(this);
|
|
1350
|
+
const beforeLinks = getFlowBeforeElements(this);
|
|
1350
1351
|
if (this.type === 'UserTask'
|
|
1351
1352
|
|| this.type === 'ExclusiveGateway'
|
|
1352
1353
|
|| this.type === 'AutoTask') {
|
|
@@ -1404,7 +1405,11 @@ export class ProcessElement extends BaseNode {
|
|
|
1404
1405
|
}
|
|
1405
1406
|
if(this.type === 'ExclusiveGateway' || this.type === 'ParallelGateway') {
|
|
1406
1407
|
code += '_constraints: function() {\n'
|
|
1407
|
-
code += `${tab1}nasl.process.
|
|
1408
|
+
code += `${tab1}nasl.process.atLeastOneOutcomeFlow(${afterLinks.map(l => `'${l.name}'`).join(',')})\n`
|
|
1409
|
+
code += `${tab1}nasl.process.atLeastOneOutcomeFlow(${beforeLinks.map(l => `'${l.name}'`).join(',')})\n`
|
|
1410
|
+
if(afterLinks.length > 0 && beforeLinks.length > 0) {
|
|
1411
|
+
code += `${tab1}nasl.process.atLeastThreeOutcomeFlow(${beforeLinks.concat(afterLinks).map(l => `'${l.name}'`).join(',')})\n`
|
|
1412
|
+
}
|
|
1408
1413
|
code += '},\n'
|
|
1409
1414
|
}
|
|
1410
1415
|
|
|
@@ -1470,7 +1475,7 @@ export class ProcessElement extends BaseNode {
|
|
|
1470
1475
|
//================================================================================
|
|
1471
1476
|
}
|
|
1472
1477
|
|
|
1473
|
-
classMap
|
|
1478
|
+
classMap['ProcessElement'] = ProcessElement;
|
|
1474
1479
|
export default ProcessElement;
|
|
1475
1480
|
//================================================================================
|
|
1476
1481
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -84,7 +84,7 @@ export class ProcessOutcome extends LogicItem {
|
|
|
84
84
|
//================================================================================
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
classMap
|
|
87
|
+
classMap['ProcessOutcome'] = ProcessOutcome;
|
|
88
88
|
export default ProcessOutcome;
|
|
89
89
|
//================================================================================
|
|
90
90
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -949,9 +949,9 @@ export class Process extends BaseNode {
|
|
|
949
949
|
return params;
|
|
950
950
|
}
|
|
951
951
|
|
|
952
|
-
getVarExistingNames(excludedList: Array<Param | Return | Constant> = []) {
|
|
952
|
+
getVarExistingNames(excludedList: Array<Param | Return | Constant | ProcessElement> = []) {
|
|
953
953
|
const excludedSet = new Set(excludedList);
|
|
954
|
-
return [...this.params, ...this.returns, ...this.constants].filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
954
|
+
return [...this.params, ...this.returns, ...this.constants, ...this.elements].filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
955
955
|
}
|
|
956
956
|
|
|
957
957
|
getNamespace(ns: string) {
|
|
@@ -1120,7 +1120,7 @@ export class Process extends BaseNode {
|
|
|
1120
1120
|
//================================================================================
|
|
1121
1121
|
}
|
|
1122
1122
|
|
|
1123
|
-
classMap
|
|
1123
|
+
classMap['Process'] = Process;
|
|
1124
1124
|
export default Process;
|
|
1125
1125
|
//================================================================================
|
|
1126
1126
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -156,7 +156,7 @@ export class QueryAggregateExpression extends LogicItem {
|
|
|
156
156
|
//================================================================================
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
classMap
|
|
159
|
+
classMap['QueryAggregateExpression'] = QueryAggregateExpression;
|
|
160
160
|
export default QueryAggregateExpression;
|
|
161
161
|
//================================================================================
|
|
162
162
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -132,7 +132,7 @@ export class QueryFieldExpression extends LogicItem {
|
|
|
132
132
|
//================================================================================
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
classMap
|
|
135
|
+
classMap['QueryFieldExpression'] = QueryFieldExpression;
|
|
136
136
|
export default QueryFieldExpression;
|
|
137
137
|
//================================================================================
|
|
138
138
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|