@lcap/nasl 3.7.3-beta.1 → 3.8.0-beta.2
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/.mocharc.js +0 -1
- package/out/automate/engine/utils.js +6 -1
- package/out/automate/engine/utils.js.map +1 -1
- package/out/bak/translator.js +37 -0
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/shared/utils.d.ts +1 -0
- package/out/breakpoint/shared/utils.js +1 -1
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +11 -0
- package/out/common/BaseNode.js +101 -5
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/Annotatable__.d.ts +109 -0
- package/out/concepts/Annotatable__.js +161 -0
- package/out/concepts/Annotatable__.js.map +1 -0
- package/out/concepts/AnnotationProperty__.d.ts +48 -0
- package/out/concepts/AnnotationProperty__.js +74 -0
- package/out/concepts/AnnotationProperty__.js.map +1 -0
- package/out/concepts/Annotation__.d.ts +128 -0
- package/out/concepts/Annotation__.js +248 -0
- package/out/concepts/Annotation__.js.map +1 -0
- package/out/concepts/App__.d.ts +14 -26
- package/out/concepts/App__.js +50 -20
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/ApplyAnnotation__.d.ts +87 -0
- package/out/concepts/ApplyAnnotation__.js +140 -0
- package/out/concepts/ApplyAnnotation__.js.map +1 -0
- package/out/concepts/Argument__.d.ts +19 -0
- package/out/concepts/Argument__.js +126 -0
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/AssigneeV2__.d.ts +169 -0
- package/out/concepts/AssigneeV2__.js +176 -1
- package/out/concepts/AssigneeV2__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.js +1 -1
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +1 -0
- package/out/concepts/BooleanLiteral__.js +9 -0
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/BusinessLogic__.js +1 -1
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallFunction__.js +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +15 -0
- package/out/concepts/CallLogic__.js +149 -17
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/ConnectorLogic__.js +1 -1
- package/out/concepts/ConnectorLogic__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.d.ts +0 -2
- package/out/concepts/DatabaseTypeAnnotation__.js +0 -20
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/DepartmentManagerV2__.d.ts +29 -0
- package/out/concepts/DepartmentManagerV2__.js +56 -0
- package/out/concepts/DepartmentManagerV2__.js.map +1 -0
- package/out/concepts/DepartmentV2__.d.ts +33 -0
- package/out/concepts/DepartmentV2__.js +63 -0
- package/out/concepts/DepartmentV2__.js.map +1 -0
- package/out/concepts/DirectManagerV2__.d.ts +25 -0
- package/out/concepts/DirectManagerV2__.js +53 -0
- package/out/concepts/DirectManagerV2__.js.map +1 -0
- package/out/concepts/End__.js +9 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +0 -2
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +2 -2
- package/out/concepts/Entity__.js +4 -7
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +1 -12
- package/out/concepts/EnumItem__.js +17 -49
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/EnumSelectSetter__.d.ts +4 -0
- package/out/concepts/EnumSelectSetter__.js +7 -0
- package/out/concepts/EnumSelectSetter__.js.map +1 -1
- package/out/concepts/Enum__.js +1 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +52 -48
- package/out/concepts/FrontendLibrary__.js +45 -36
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/FrontendType__.d.ts +4 -0
- package/out/concepts/FrontendType__.js +7 -0
- package/out/concepts/FrontendType__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +2 -0
- package/out/concepts/Frontend__.js +21 -2
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/HistoryProcessV2__.js +4 -1
- package/out/concepts/HistoryProcessV2__.js.map +1 -1
- package/out/concepts/I18nInfo__.d.ts +0 -1
- package/out/concepts/I18nInfo__.js +0 -7
- package/out/concepts/I18nInfo__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -0
- package/out/concepts/Identifier__.js +31 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Interface__.js +1 -4
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +16 -1
- package/out/concepts/Logic__.js +133 -15
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/ManagerV2__.d.ts +34 -0
- package/out/concepts/ManagerV2__.js +61 -0
- package/out/concepts/ManagerV2__.js.map +1 -0
- package/out/concepts/MatchCase__.d.ts +2 -2
- package/out/concepts/MatchCase__.js +7 -7
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -0
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +88 -0
- package/out/concepts/Module__.js +85 -0
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/OperatePermissionV2__.d.ts +1 -1
- package/out/concepts/OperatePermissionV2__.js.map +1 -1
- package/out/concepts/Param__.d.ts +4 -0
- package/out/concepts/Param__.js +13 -21
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElementV2__.d.ts +6 -1
- package/out/concepts/ProcessElementV2__.js +20 -0
- package/out/concepts/ProcessElementV2__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +7 -0
- package/out/concepts/ProcessElement__.js +47 -0
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessV2__.d.ts +1 -34
- package/out/concepts/ProcessV2__.js +3 -70
- package/out/concepts/ProcessV2__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +2 -2
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +2 -2
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/StaticString__.d.ts +0 -4
- package/out/concepts/StaticString__.js +0 -11
- package/out/concepts/StaticString__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +1 -0
- package/out/concepts/StructureProperty__.js +14 -5
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +4 -0
- package/out/concepts/Structure__.js +6 -9
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SubLogic__.d.ts +418 -0
- package/out/concepts/SubLogic__.js +992 -0
- package/out/concepts/SubLogic__.js.map +1 -0
- package/out/concepts/Theme__.d.ts +9 -0
- package/out/concepts/Theme__.js +10 -0
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +0 -1
- package/out/concepts/Transactional__.js +0 -7
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +18 -0
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +1 -0
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +6 -1
- package/out/concepts/ValidationRule__.js +6 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +8 -2
- package/out/concepts/ViewElement__.js +213 -32
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +10 -2
- package/out/concepts/View__.js +129 -17
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.processV2.d.ts +2 -0
- package/out/concepts/basics/stdlib/nasl.processV2.js +50 -4
- package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +1 -1
- package/out/concepts/basics/types/index.js +2 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/concepts/index__.d.ts +9 -0
- package/out/concepts/index__.js +9 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/utils/asserts.d.ts +409 -0
- package/out/concepts/utils/asserts.js +564 -14
- package/out/concepts/utils/asserts.js.map +1 -1
- package/out/concepts/utils/types.d.ts +33 -2
- package/out/generator/genBundleFiles.d.ts +13 -9
- package/out/generator/genBundleFiles.js +383 -63
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.js +2 -0
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/release-body/body.js +1 -0
- package/out/generator/release-body/body.js.map +1 -1
- package/out/generator/release-body/utils.d.ts +15 -7
- package/out/generator/release-body/utils.js +50 -7
- package/out/generator/release-body/utils.js.map +1 -1
- package/out/natural/genNaturalTS.js +2 -4
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/getContext/index.js +0 -2
- package/out/natural/getContext/index.js.map +1 -1
- package/out/natural/transformTS2UI.js.map +1 -1
- package/out/natural/transformTSCode.d.ts +1 -1
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/extendBaseNode.js +9 -0
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/getLogics.js +10 -6
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +6 -0
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcessesV2.d.ts +3 -2
- package/out/server/getProcessesV2.js +15 -6
- package/out/server/getProcessesV2.js.map +1 -1
- package/out/server/naslServer.d.ts +5 -1
- package/out/server/naslServer.js +120 -30
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +4 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +2 -1
- package/out/service/storage/init.js +28 -71
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.d.ts +6 -2
- package/out/templator/genCreateBlock.js +25 -8
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.d.ts +22 -0
- package/out/templator/genCurdEditMultipleKeyBlock.js +60 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.d.ts +13 -3
- package/out/templator/genCurdMultipleKeyBlock.js +29 -23
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.d.ts +1 -1
- package/out/templator/genGetBlock.js +3 -2
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genListViewBlock.d.ts +1 -1
- package/out/templator/genListViewBlock.js +3 -2
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.d.ts +1 -1
- package/out/templator/genSelectBlock.js +3 -2
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +9 -4
- package/out/templator/genTableBlock.js +31 -17
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.d.ts +2 -2
- package/out/templator/genUpdateBlock.js +11 -11
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/translator/types.d.ts +0 -4
- package/out/translator/utils.d.ts +0 -1
- package/out/translator/utils.js +1 -6
- package/out/translator/utils.js.map +1 -1
- package/out/utils/delay/index.d.ts +0 -0
- package/out/utils/delay/index.js +1 -0
- package/out/utils/delay/index.js.map +1 -0
- package/out/utils/env.d.ts +0 -4
- package/out/utils/env.js +3 -6
- package/out/utils/env.js.map +1 -1
- package/out/utils/index.d.ts +3 -2
- package/out/utils/index.js +18 -14
- package/out/utils/index.js.map +1 -1
- package/out/utils/time-slicing/controller.js.map +1 -1
- package/out/utils/types.d.ts +0 -17
- package/package.json +27 -20
- package/sandbox/stdlib/extension.component.ts +29 -0
- package/sandbox/stdlib/nasl.process.ts +17 -0
- package/sandbox/stdlib/nasl.processV2.ts +10 -5
- package/sandbox/stdlib/nasl.util.ts +3 -1
- package/src/automate/engine/utils.js +7 -2
- package/src/bak/translator.js +42 -1
- package/src/breakpoint/shared/utils.ts +2 -1
- package/src/common/BaseNode.ts +117 -5
- package/src/concepts/Annotatable__.ts +263 -0
- package/src/concepts/AnnotationProperty__.ts +102 -0
- package/src/concepts/Annotation__.ts +344 -0
- package/src/concepts/App__.ts +917 -26
- package/src/concepts/ApplyAnnotation__.ts +198 -0
- package/src/concepts/Argument__.ts +145 -1
- package/src/concepts/AssigneeV2__.ts +387 -1
- package/src/concepts/AuthLogicForCallInterface__.ts +1 -1
- package/src/concepts/AuthLogic__.ts +1 -1
- package/src/concepts/BooleanLiteral__.ts +9 -1
- package/src/concepts/BusinessLogic__.ts +1 -1
- package/src/concepts/CallFunction__.ts +1 -1
- package/src/concepts/CallLogic__.ts +153 -16
- package/src/concepts/ConnectorLogic__.ts +1 -1
- package/src/concepts/DatabaseTypeAnnotation__.ts +0 -11
- package/src/concepts/DepartmentManagerV2__.ts +70 -0
- package/src/concepts/DepartmentV2__.ts +75 -0
- package/src/concepts/DirectManagerV2__.ts +65 -0
- package/src/concepts/End__.ts +10 -1
- package/src/concepts/EntityProperty__.ts +0 -5
- package/src/concepts/Entity__.ts +5 -9
- package/src/concepts/EnumItem__.ts +16 -65
- package/src/concepts/EnumSelectSetter__.ts +6 -0
- package/src/concepts/Enum__.ts +1 -6
- package/src/concepts/ForEachStatement__.ts +1 -1
- package/src/concepts/FrontendLibrary__.ts +88 -80
- package/src/concepts/FrontendType__.ts +6 -0
- package/src/concepts/Frontend__.ts +26 -3
- package/src/concepts/HistoryProcessV2__.ts +5 -0
- package/src/concepts/I18nInfo__.ts +0 -5
- package/src/concepts/Identifier__.ts +32 -0
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/Interface__.ts +1 -6
- package/src/concepts/LogicItem__.ts +1 -0
- package/src/concepts/Logic__.ts +140 -17
- package/src/concepts/ManagerV2__.ts +78 -0
- package/src/concepts/MatchCase__.ts +9 -8
- package/src/concepts/MemberExpression__.ts +1 -0
- package/src/concepts/Module__.ts +194 -0
- package/src/concepts/OperatePermissionV2__.ts +1 -1
- package/src/concepts/Param__.ts +17 -20
- package/src/concepts/ProcessElementV2__.ts +23 -0
- package/src/concepts/ProcessElement__.ts +18 -0
- package/src/concepts/ProcessV2__.ts +4 -70
- package/src/concepts/QueryFromExpression__.ts +2 -2
- package/src/concepts/QueryJoinExpression__.ts +2 -2
- package/src/concepts/StaticString__.ts +0 -13
- package/src/concepts/StructureProperty__.ts +16 -7
- package/src/concepts/Structure__.ts +10 -11
- package/src/concepts/SubLogic__.ts +1516 -0
- package/src/concepts/Theme__.ts +9 -0
- package/src/concepts/Transactional__.ts +0 -5
- package/src/concepts/TriggerLauncher__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +17 -0
- package/src/concepts/TypeParam__.ts +3 -0
- package/src/concepts/ValidationRule__.ts +6 -1
- package/src/concepts/ViewElement__.ts +224 -34
- package/src/concepts/View__.ts +135 -22
- package/src/concepts/basics/stdlib/nasl.processV2.ts +56 -3
- package/src/concepts/basics/types/index.ts +1 -1
- package/src/concepts/index__.ts +9 -0
- package/src/concepts/utils/asserts.ts +595 -0
- package/src/concepts/utils/types.ts +53 -0
- package/src/generator/genBundleFiles.ts +408 -68
- package/src/generator/genMetaData.ts +3 -0
- package/src/generator/release-body/body.ts +1 -0
- package/src/generator/release-body/utils.ts +159 -55
- package/src/natural/genNaturalTS.ts +3 -5
- package/src/natural/getContext/index.ts +0 -2
- package/src/natural/transformTS2UI.ts +5 -2
- package/src/natural/transformTSCode.ts +2 -2
- package/src/server/extendBaseNode.ts +11 -2
- package/src/server/getLogics.ts +9 -7
- package/src/server/getMemberIdentifier.ts +7 -0
- package/src/server/getProcessesV2.ts +16 -6
- package/src/server/naslServer.ts +133 -30
- package/src/server/translator.ts +4 -0
- package/src/service/storage/init.ts +52 -97
- package/src/templator/genCreateBlock.ts +35 -14
- package/src/templator/genCurdEditMultipleKeyBlock.ts +65 -1
- package/src/templator/genCurdMultipleKeyBlock.ts +42 -23
- package/src/templator/genGetBlock.ts +4 -3
- package/src/templator/genListViewBlock.ts +3 -3
- package/src/templator/genSelectBlock.ts +4 -2
- package/src/templator/genTableBlock.ts +32 -17
- package/src/templator/genUpdateBlock.ts +21 -18
- package/src/translator/types.ts +0 -4
- package/src/translator/utils.ts +0 -6
- package/src/utils/delay/index.ts +0 -0
- package/src/utils/env.ts +4 -5
- package/src/utils/index.ts +16 -4
- package/src/utils/time-slicing/controller.ts +1 -0
- package/src/utils/types.ts +0 -20
- package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +2 -1
- package/ts-worker/bundle.js +1 -1
- package/ts-worker/src/index.js +1 -0
- package/out/utils/language-cache/constant.d.ts +0 -18
- package/out/utils/language-cache/constant.js +0 -35
- package/out/utils/language-cache/constant.js.map +0 -1
- package/out/utils/language-cache/index.d.ts +0 -2
- package/out/utils/language-cache/index.js +0 -19
- package/out/utils/language-cache/index.js.map +0 -1
- package/out/utils/language-cache/nasl.d.ts +0 -10
- package/out/utils/language-cache/nasl.js +0 -98
- package/out/utils/language-cache/nasl.js.map +0 -1
- package/out/utils/language-cache/types.d.ts +0 -44
- package/out/utils/language-cache/types.js +0 -4
- package/out/utils/language-cache/types.js.map +0 -1
- package/src/utils/language-cache/constant.ts +0 -37
- package/src/utils/language-cache/index.ts +0 -2
- package/src/utils/language-cache/nasl.ts +0 -83
- package/src/utils/language-cache/types.ts +0 -48
|
@@ -25,6 +25,8 @@ import * as asserts from './utils/asserts';
|
|
|
25
25
|
import BaseNode from '../common/BaseNode';
|
|
26
26
|
import MemberExpression from './MemberExpression__';
|
|
27
27
|
import Logic from './Logic__';
|
|
28
|
+
import DepartmentV2 from './DepartmentV2__';
|
|
29
|
+
import ManagerV2 from './ManagerV2__';
|
|
28
30
|
|
|
29
31
|
/**
|
|
30
32
|
* 经办人
|
|
@@ -85,6 +87,26 @@ export class AssigneeV2 extends BaseNode {
|
|
|
85
87
|
})
|
|
86
88
|
fromLogics: Array<Logic> = [];
|
|
87
89
|
|
|
90
|
+
/**
|
|
91
|
+
* 部门用户
|
|
92
|
+
*/
|
|
93
|
+
@property({
|
|
94
|
+
objectRef: 'DepartmentV2',
|
|
95
|
+
isArray: true,
|
|
96
|
+
defaultValue: [],
|
|
97
|
+
})
|
|
98
|
+
fromDepartments: Array<DepartmentV2> = [];
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* 主管用户
|
|
102
|
+
*/
|
|
103
|
+
@property({
|
|
104
|
+
objectRef: 'ManagerV2',
|
|
105
|
+
isArray: true,
|
|
106
|
+
defaultValue: [],
|
|
107
|
+
})
|
|
108
|
+
fromManagers: Array<ManagerV2> = [];
|
|
109
|
+
|
|
88
110
|
/**
|
|
89
111
|
* @param source 需要合并的部分参数
|
|
90
112
|
*/
|
|
@@ -408,6 +430,316 @@ export class AssigneeV2 extends BaseNode {
|
|
|
408
430
|
return node;
|
|
409
431
|
}
|
|
410
432
|
|
|
433
|
+
getDepartmentV2ExistingNames(excludedList: Array<DepartmentV2> = []) {
|
|
434
|
+
const excludedSet = new Set(excludedList);
|
|
435
|
+
return ((this.fromDepartments as DepartmentV2[]) || [])
|
|
436
|
+
.filter((item) => !excludedSet.has(item))
|
|
437
|
+
.map((item) => item.name);
|
|
438
|
+
}
|
|
439
|
+
getDepartmentV2UniqueName(name = 'departmentV21') {
|
|
440
|
+
return utils.unique(name, this.getDepartmentV2ExistingNames(), undefined, false);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* 插入部门用户
|
|
445
|
+
* @internal
|
|
446
|
+
* @param name 部门用户名称,如果不填会自动生成一个唯一名称
|
|
447
|
+
*/
|
|
448
|
+
_insertDepartmentV2At(name: string, index: number): DepartmentV2;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* 插入部门用户
|
|
452
|
+
* @internal
|
|
453
|
+
* @param departmentV2Options 部门用户参数
|
|
454
|
+
*/
|
|
455
|
+
_insertDepartmentV2At(departmentV2Options: Partial<DepartmentV2>, index: number): DepartmentV2;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* 插入部门用户
|
|
459
|
+
* @internal
|
|
460
|
+
* @param departmentV2 已有的部门用户实例
|
|
461
|
+
*/
|
|
462
|
+
_insertDepartmentV2At(departmentV2: DepartmentV2, index: number): DepartmentV2;
|
|
463
|
+
|
|
464
|
+
_insertDepartmentV2At(options: string | Partial<DepartmentV2> | DepartmentV2, index: number) {
|
|
465
|
+
const departmentV2Options: any = {};
|
|
466
|
+
const relationOptions = { parentNode: this, parentKey: 'fromDepartments' };
|
|
467
|
+
const DepartmentV2 = getConceptConstructor('DepartmentV2');
|
|
468
|
+
let departmentV2: DepartmentV2;
|
|
469
|
+
if (!options) {
|
|
470
|
+
departmentV2 = DepartmentV2.from(
|
|
471
|
+
{
|
|
472
|
+
...departmentV2Options,
|
|
473
|
+
name: this.getDepartmentV2UniqueName(),
|
|
474
|
+
},
|
|
475
|
+
this,
|
|
476
|
+
'fromDepartments',
|
|
477
|
+
);
|
|
478
|
+
} else if (typeof options === 'string') {
|
|
479
|
+
departmentV2 = DepartmentV2.from(
|
|
480
|
+
{
|
|
481
|
+
...departmentV2Options,
|
|
482
|
+
name: options,
|
|
483
|
+
},
|
|
484
|
+
this,
|
|
485
|
+
'fromDepartments',
|
|
486
|
+
);
|
|
487
|
+
} else if (asserts.isDepartmentV2(options)) {
|
|
488
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
489
|
+
departmentV2 = options;
|
|
490
|
+
Object.assign(departmentV2, relationOptions);
|
|
491
|
+
} else {
|
|
492
|
+
departmentV2 = DepartmentV2.from(
|
|
493
|
+
{
|
|
494
|
+
...departmentV2Options,
|
|
495
|
+
...options,
|
|
496
|
+
},
|
|
497
|
+
this,
|
|
498
|
+
'fromDepartments',
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
this.fromDepartments.splice(index, 0, departmentV2);
|
|
502
|
+
return departmentV2;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* 插入部门用户
|
|
507
|
+
* @param name 部门用户名称,如果不填会自动生成一个唯一名称
|
|
508
|
+
*/
|
|
509
|
+
insertDepartmentV2At(name: string, index: number): DepartmentV2;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* 插入部门用户
|
|
513
|
+
* @param departmentV2Options 部门用户参数
|
|
514
|
+
*/
|
|
515
|
+
insertDepartmentV2At(departmentV2Options: Partial<DepartmentV2>, index: number): DepartmentV2;
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* 插入部门用户
|
|
519
|
+
* @param departmentV2 已有的部门用户实例
|
|
520
|
+
*/
|
|
521
|
+
insertDepartmentV2At(departmentV2: DepartmentV2, index: number): DepartmentV2;
|
|
522
|
+
|
|
523
|
+
insertDepartmentV2At(options: string | Partial<DepartmentV2> | DepartmentV2, index: number) {
|
|
524
|
+
const node = this._insertDepartmentV2At(options as any, index);
|
|
525
|
+
node.create({
|
|
526
|
+
index,
|
|
527
|
+
parentNode: this,
|
|
528
|
+
parentKey: 'fromDepartments',
|
|
529
|
+
});
|
|
530
|
+
return node;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* 添加部门用户
|
|
535
|
+
* @internal
|
|
536
|
+
* @param name 部门用户名称,如果不填会自动生成一个唯一名称
|
|
537
|
+
*/
|
|
538
|
+
_addDepartmentV2(name?: string): DepartmentV2;
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* 添加部门用户
|
|
542
|
+
* @internal
|
|
543
|
+
* @param departmentV2Options 部门用户参数
|
|
544
|
+
*/
|
|
545
|
+
_addDepartmentV2(departmentV2Options: Partial<DepartmentV2>): DepartmentV2;
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* 添加部门用户
|
|
549
|
+
* @internal
|
|
550
|
+
* @param departmentV2 已有的部门用户实例
|
|
551
|
+
*/
|
|
552
|
+
_addDepartmentV2(departmentV2: DepartmentV2): DepartmentV2;
|
|
553
|
+
|
|
554
|
+
_addDepartmentV2(options?: string | Partial<DepartmentV2> | DepartmentV2) {
|
|
555
|
+
const index = this.fromDepartments.length;
|
|
556
|
+
return this._insertDepartmentV2At(options as any, index);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* 添加部门用户
|
|
561
|
+
* @internal
|
|
562
|
+
* @param name 部门用户名称,如果不填会自动生成一个唯一名称
|
|
563
|
+
*/
|
|
564
|
+
addDepartmentV2(name?: string): DepartmentV2;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* 添加部门用户
|
|
568
|
+
* @param departmentV2Options 部门用户参数
|
|
569
|
+
*/
|
|
570
|
+
addDepartmentV2(departmentV2Options: Partial<DepartmentV2>): DepartmentV2;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* 添加部门用户
|
|
574
|
+
* @param departmentV2 已有的部门用户实例
|
|
575
|
+
*/
|
|
576
|
+
addDepartmentV2(departmentV2: DepartmentV2): DepartmentV2;
|
|
577
|
+
|
|
578
|
+
addDepartmentV2(options?: string | Partial<DepartmentV2> | DepartmentV2) {
|
|
579
|
+
const node = this._addDepartmentV2(options as any);
|
|
580
|
+
const index = this.fromDepartments.indexOf(node);
|
|
581
|
+
node.create({
|
|
582
|
+
index,
|
|
583
|
+
parentNode: this,
|
|
584
|
+
parentKey: 'fromDepartments',
|
|
585
|
+
});
|
|
586
|
+
return node;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
getManagerV2ExistingNames(excludedList: Array<ManagerV2> = []) {
|
|
590
|
+
const excludedSet = new Set(excludedList);
|
|
591
|
+
return ((this.fromManagers as ManagerV2[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
592
|
+
}
|
|
593
|
+
getManagerV2UniqueName(name = 'managerV21') {
|
|
594
|
+
return utils.unique(name, this.getManagerV2ExistingNames(), undefined, false);
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* 插入主管
|
|
599
|
+
* @internal
|
|
600
|
+
* @param name 主管名称,如果不填会自动生成一个唯一名称
|
|
601
|
+
*/
|
|
602
|
+
_insertManagerV2At(name: string, index: number): ManagerV2;
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* 插入主管
|
|
606
|
+
* @internal
|
|
607
|
+
* @param managerV2Options 主管参数
|
|
608
|
+
*/
|
|
609
|
+
_insertManagerV2At(managerV2Options: Partial<ManagerV2>, index: number): ManagerV2;
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* 插入主管
|
|
613
|
+
* @internal
|
|
614
|
+
* @param managerV2 已有的主管实例
|
|
615
|
+
*/
|
|
616
|
+
_insertManagerV2At(managerV2: ManagerV2, index: number): ManagerV2;
|
|
617
|
+
|
|
618
|
+
_insertManagerV2At(options: string | Partial<ManagerV2> | ManagerV2, index: number) {
|
|
619
|
+
const managerV2Options: any = {};
|
|
620
|
+
const relationOptions = { parentNode: this, parentKey: 'fromManagers' };
|
|
621
|
+
const ManagerV2 = getConceptConstructor('ManagerV2');
|
|
622
|
+
let managerV2: ManagerV2;
|
|
623
|
+
if (!options) {
|
|
624
|
+
managerV2 = ManagerV2.from(
|
|
625
|
+
{
|
|
626
|
+
...managerV2Options,
|
|
627
|
+
name: this.getManagerV2UniqueName(),
|
|
628
|
+
},
|
|
629
|
+
this,
|
|
630
|
+
'fromManagers',
|
|
631
|
+
);
|
|
632
|
+
} else if (typeof options === 'string') {
|
|
633
|
+
managerV2 = ManagerV2.from(
|
|
634
|
+
{
|
|
635
|
+
...managerV2Options,
|
|
636
|
+
name: options,
|
|
637
|
+
},
|
|
638
|
+
this,
|
|
639
|
+
'fromManagers',
|
|
640
|
+
);
|
|
641
|
+
} else if (asserts.isManagerV2(options)) {
|
|
642
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
643
|
+
managerV2 = options;
|
|
644
|
+
Object.assign(managerV2, relationOptions);
|
|
645
|
+
} else {
|
|
646
|
+
managerV2 = ManagerV2.from(
|
|
647
|
+
{
|
|
648
|
+
...managerV2Options,
|
|
649
|
+
...options,
|
|
650
|
+
},
|
|
651
|
+
this,
|
|
652
|
+
'fromManagers',
|
|
653
|
+
);
|
|
654
|
+
}
|
|
655
|
+
this.fromManagers.splice(index, 0, managerV2);
|
|
656
|
+
return managerV2;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* 插入主管
|
|
661
|
+
* @param name 主管名称,如果不填会自动生成一个唯一名称
|
|
662
|
+
*/
|
|
663
|
+
insertManagerV2At(name: string, index: number): ManagerV2;
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* 插入主管
|
|
667
|
+
* @param managerV2Options 主管参数
|
|
668
|
+
*/
|
|
669
|
+
insertManagerV2At(managerV2Options: Partial<ManagerV2>, index: number): ManagerV2;
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* 插入主管
|
|
673
|
+
* @param managerV2 已有的主管实例
|
|
674
|
+
*/
|
|
675
|
+
insertManagerV2At(managerV2: ManagerV2, index: number): ManagerV2;
|
|
676
|
+
|
|
677
|
+
insertManagerV2At(options: string | Partial<ManagerV2> | ManagerV2, index: number) {
|
|
678
|
+
const node = this._insertManagerV2At(options as any, index);
|
|
679
|
+
node.create({
|
|
680
|
+
index,
|
|
681
|
+
parentNode: this,
|
|
682
|
+
parentKey: 'fromManagers',
|
|
683
|
+
});
|
|
684
|
+
return node;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* 添加主管
|
|
689
|
+
* @internal
|
|
690
|
+
* @param name 主管名称,如果不填会自动生成一个唯一名称
|
|
691
|
+
*/
|
|
692
|
+
_addManagerV2(name?: string): ManagerV2;
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* 添加主管
|
|
696
|
+
* @internal
|
|
697
|
+
* @param managerV2Options 主管参数
|
|
698
|
+
*/
|
|
699
|
+
_addManagerV2(managerV2Options: Partial<ManagerV2>): ManagerV2;
|
|
700
|
+
|
|
701
|
+
/**
|
|
702
|
+
* 添加主管
|
|
703
|
+
* @internal
|
|
704
|
+
* @param managerV2 已有的主管实例
|
|
705
|
+
*/
|
|
706
|
+
_addManagerV2(managerV2: ManagerV2): ManagerV2;
|
|
707
|
+
|
|
708
|
+
_addManagerV2(options?: string | Partial<ManagerV2> | ManagerV2) {
|
|
709
|
+
const index = this.fromManagers.length;
|
|
710
|
+
return this._insertManagerV2At(options as any, index);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* 添加主管
|
|
715
|
+
* @internal
|
|
716
|
+
* @param name 主管名称,如果不填会自动生成一个唯一名称
|
|
717
|
+
*/
|
|
718
|
+
addManagerV2(name?: string): ManagerV2;
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* 添加主管
|
|
722
|
+
* @param managerV2Options 主管参数
|
|
723
|
+
*/
|
|
724
|
+
addManagerV2(managerV2Options: Partial<ManagerV2>): ManagerV2;
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* 添加主管
|
|
728
|
+
* @param managerV2 已有的主管实例
|
|
729
|
+
*/
|
|
730
|
+
addManagerV2(managerV2: ManagerV2): ManagerV2;
|
|
731
|
+
|
|
732
|
+
addManagerV2(options?: string | Partial<ManagerV2> | ManagerV2) {
|
|
733
|
+
const node = this._addManagerV2(options as any);
|
|
734
|
+
const index = this.fromManagers.indexOf(node);
|
|
735
|
+
node.create({
|
|
736
|
+
index,
|
|
737
|
+
parentNode: this,
|
|
738
|
+
parentKey: 'fromManagers',
|
|
739
|
+
});
|
|
740
|
+
return node;
|
|
741
|
+
}
|
|
742
|
+
|
|
411
743
|
/**
|
|
412
744
|
* 删除成员表达式
|
|
413
745
|
* @param name 成员表达式名称
|
|
@@ -458,6 +790,56 @@ export class AssigneeV2 extends BaseNode {
|
|
|
458
790
|
return logic.delete();
|
|
459
791
|
}
|
|
460
792
|
|
|
793
|
+
/**
|
|
794
|
+
* 删除部门用户
|
|
795
|
+
* @param name 部门用户名称
|
|
796
|
+
*/
|
|
797
|
+
removeDepartmentV2(name: string): void;
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* 删除部门用户
|
|
801
|
+
* @param departmentV2 已有的部门用户实例
|
|
802
|
+
*/
|
|
803
|
+
removeDepartmentV2(departmentV2: DepartmentV2): void;
|
|
804
|
+
|
|
805
|
+
removeDepartmentV2(options: string | DepartmentV2) {
|
|
806
|
+
let departmentV2: DepartmentV2;
|
|
807
|
+
if (typeof options === 'string') {
|
|
808
|
+
departmentV2 = (this.fromDepartments as DepartmentV2[]).find((item) => item.name === options);
|
|
809
|
+
if (!departmentV2) {
|
|
810
|
+
throw new Error('找不到部门用户 ' + options);
|
|
811
|
+
}
|
|
812
|
+
} else {
|
|
813
|
+
departmentV2 = options;
|
|
814
|
+
}
|
|
815
|
+
return departmentV2.delete();
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* 删除主管
|
|
820
|
+
* @param name 主管名称
|
|
821
|
+
*/
|
|
822
|
+
removeManagerV2(name: string): void;
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* 删除主管
|
|
826
|
+
* @param managerV2 已有的主管实例
|
|
827
|
+
*/
|
|
828
|
+
removeManagerV2(managerV2: ManagerV2): void;
|
|
829
|
+
|
|
830
|
+
removeManagerV2(options: string | ManagerV2) {
|
|
831
|
+
let managerV2: ManagerV2;
|
|
832
|
+
if (typeof options === 'string') {
|
|
833
|
+
managerV2 = (this.fromManagers as ManagerV2[]).find((item) => item.name === options);
|
|
834
|
+
if (!managerV2) {
|
|
835
|
+
throw new Error('找不到主管 ' + options);
|
|
836
|
+
}
|
|
837
|
+
} else {
|
|
838
|
+
managerV2 = options;
|
|
839
|
+
}
|
|
840
|
+
return managerV2.delete();
|
|
841
|
+
}
|
|
842
|
+
|
|
461
843
|
//================================================================================
|
|
462
844
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
463
845
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
@@ -471,6 +853,10 @@ export class AssigneeV2 extends BaseNode {
|
|
|
471
853
|
return this.getAncestor('ProcessV2') as ProcessV2;
|
|
472
854
|
}
|
|
473
855
|
|
|
856
|
+
get isFormProcess() {
|
|
857
|
+
return this.processV2?.isFormProcess;
|
|
858
|
+
}
|
|
859
|
+
|
|
474
860
|
getNamespace(ns: string) {
|
|
475
861
|
if (this.parentNode && (this.parentNode as Namespace).getNamespace) {
|
|
476
862
|
const parentNamespace = (this.parentNode as Namespace).getNamespace();
|
|
@@ -498,7 +884,7 @@ export class AssigneeV2 extends BaseNode {
|
|
|
498
884
|
const tab = indent(state?.tabSize || 0);
|
|
499
885
|
let code = prevCode;
|
|
500
886
|
if (
|
|
501
|
-
![...(self.users || []), ...(self.fromVariables || []), ...(self.fromLogics || []), ...(self.roles || [])].length
|
|
887
|
+
![...(self.users || []), ...(self.fromDepartments || []), ...(self.fromManagers || []), ...(self.fromVariables || []), ...(self.fromLogics || []), ...(self.roles || [])].length
|
|
502
888
|
) {
|
|
503
889
|
// 任务完成人为空会有一个提示信息
|
|
504
890
|
code += `${tab}__UsersEmpty__;\n`;
|
|
@@ -56,7 +56,7 @@ export class AuthLogicForCallInterface extends AuthLogic {
|
|
|
56
56
|
*/
|
|
57
57
|
static isAbstract: boolean = false;
|
|
58
58
|
/** 继承链 */
|
|
59
|
-
static readonly inheritanceChain: string[] = ['AuthLogic', 'Logic', 'BaseNode'];
|
|
59
|
+
static readonly inheritanceChain: string[] = ['AuthLogic', 'Logic', 'Annotatable', 'BaseNode'];
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* 产品概念
|
|
@@ -30,7 +30,7 @@ export class AuthLogic extends Logic {
|
|
|
30
30
|
*/
|
|
31
31
|
static isAbstract: boolean = false;
|
|
32
32
|
/** 继承链 */
|
|
33
|
-
static readonly inheritanceChain: string[] = ['Logic', 'BaseNode'];
|
|
33
|
+
static readonly inheritanceChain: string[] = ['Logic', 'Annotatable', 'BaseNode'];
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* 产品概念
|
|
@@ -82,7 +82,15 @@ export class BooleanLiteral extends LogicItem {
|
|
|
82
82
|
toBrief(): string {
|
|
83
83
|
return this.value;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
toBoolean(): any {
|
|
86
|
+
if (this.value === 'true') {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
if (this.value === 'false') {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
return this.value;
|
|
93
|
+
}
|
|
86
94
|
@withSourceMapGenerator
|
|
87
95
|
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
88
96
|
return `new nasl.core.Boolean(${this.value})`;
|
|
@@ -39,7 +39,7 @@ export class BusinessLogic extends Logic {
|
|
|
39
39
|
*/
|
|
40
40
|
static isAbstract: boolean = false;
|
|
41
41
|
/** 继承链 */
|
|
42
|
-
static readonly inheritanceChain: string[] = ['Logic', 'BaseNode'];
|
|
42
|
+
static readonly inheritanceChain: string[] = ['Logic', 'Annotatable', 'BaseNode'];
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* 产品概念
|
|
@@ -690,7 +690,7 @@ export class CallFunction extends LogicItem {
|
|
|
690
690
|
if (!arg) {
|
|
691
691
|
code += '__IDENTIFIER__';
|
|
692
692
|
} else {
|
|
693
|
-
code +=
|
|
693
|
+
code += arg.toNaturalTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
694
694
|
}
|
|
695
695
|
if (index !== this.arguments.length - 1) {
|
|
696
696
|
code += ',\n';
|