@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
|
@@ -55,10 +55,10 @@ declare namespace nasl.processV2 {
|
|
|
55
55
|
export function getProcInstInfo(taskId: nasl.core.String): ProcInstInfo;
|
|
56
56
|
|
|
57
57
|
//同意
|
|
58
|
-
export function approveTask(data: void, procDefKey: nasl.core.String, taskId: nasl.core.String,
|
|
58
|
+
export function approveTask(data: void, procDefKey: nasl.core.String, taskId: nasl.core.String, comment: nasl.core.String): void;
|
|
59
59
|
|
|
60
60
|
//拒绝
|
|
61
|
-
export function rejectTask(data: void, procDefKey: nasl.core.String, taskId: nasl.core.String,
|
|
61
|
+
export function rejectTask(data: void, procDefKey: nasl.core.String, taskId: nasl.core.String, comment: nasl.core.String): void;
|
|
62
62
|
|
|
63
63
|
//提交
|
|
64
64
|
export function submitTask(data: void, procDefKey: nasl.core.String, taskId: nasl.core.String): void;
|
|
@@ -87,6 +87,9 @@ declare namespace nasl.processV2 {
|
|
|
87
87
|
//撤回
|
|
88
88
|
export function withdrawTask(taskId: nasl.core.String): void;
|
|
89
89
|
|
|
90
|
+
// 加签
|
|
91
|
+
export function addSignTask(taskId: nasl.core.String, userForAddSign: nasl.core.String): void;
|
|
92
|
+
|
|
90
93
|
//终止
|
|
91
94
|
export function terminateProcess(procInstId: nasl.core.String): void;
|
|
92
95
|
|
|
@@ -262,8 +265,10 @@ declare namespace nasl.processV2 {
|
|
|
262
265
|
}
|
|
263
266
|
}
|
|
264
267
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
+
namespace enums {
|
|
269
|
+
export enum ProcInstStatusEnum {
|
|
270
|
+
'Approved' = '审批结束',
|
|
271
|
+
'Approving' = '审批中',
|
|
272
|
+
}
|
|
268
273
|
}
|
|
269
274
|
}
|
|
@@ -139,7 +139,9 @@ declare namespace nasl.util {
|
|
|
139
139
|
export function MapTransformAsync<K0, V0, K extends nasl.core.Boolean | nasl.core.Long | nasl.core.Decimal | nasl.core.String, V>(map: nasl.collection.Map<K0, V0>, byKey: (key: K0, value: V0) => K, byVal: (key: K0, value: V0) => V): nasl.collection.Map<K, V>;
|
|
140
140
|
export function ListToMapAsync<T, K extends nasl.core.Boolean | nasl.core.Long | nasl.core.Decimal | nasl.core.String, V>(map: nasl.collection.List<T>, byKey: (elem: T) => K, byVal: (elem: T) => V): nasl.collection.Map<K, V>;
|
|
141
141
|
|
|
142
|
-
// 处理携带了
|
|
142
|
+
// 处理携带了error的类型,去除掉error然后返回
|
|
143
|
+
export function autoTypeHandleError<T>(value: T): Exclude<T, nasl.ui.Error>;
|
|
144
|
+
// 处理函数 携带了 Error 的类型,传入函数, 去除掉 返回值 Error 然后返回
|
|
143
145
|
export function autoHandleError<T extends (...args: any[]) => any>(func: T): (...args: Parameters<T>) => Exclude<ReturnType<T>, nasl.ui.Error>;
|
|
144
146
|
// 逻辑调用和验证器函数的包装器
|
|
145
147
|
export function callLogicWithChecker<T extends (...args: any[]) => any>(func: T, checker: (...args: Parameters<T>) => any): T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseNode, uiStructures, collectionStructures, configurationEnums, interfaceStructures, processStructures, getStdlibNamespace, processV2Structures, coreStructures, authStructures, httpStructures } from '../../concepts';
|
|
1
|
+
import { BaseNode, uiStructures, collectionStructures, configurationEnums, processV2Enums, interfaceStructures, processStructures, getStdlibNamespace, processV2Structures, coreStructures, authStructures, httpStructures } from '../../concepts';
|
|
2
2
|
import { getConceptMeta } from '../../decorators/index';
|
|
3
3
|
/*
|
|
4
4
|
根据 namespace 字符串来获取 node
|
|
@@ -83,7 +83,12 @@ export function getNaslNodeByNodeCallee(namespace, typeName) {
|
|
|
83
83
|
} else if (namespace === 'nasl.process') {
|
|
84
84
|
return processStructures.find((item) => item.name === typeName);
|
|
85
85
|
} else if (namespace === 'nasl.processV2') {
|
|
86
|
-
|
|
86
|
+
console.log(123)
|
|
87
|
+
const findStructure = processV2Structures.find((item) => item.name === typeName);
|
|
88
|
+
if(findStructure) {
|
|
89
|
+
return findStructure;
|
|
90
|
+
}
|
|
91
|
+
return processV2Enums.find((item) => item.name === typeName);
|
|
87
92
|
} else if (namespace === 'nasl.util') {
|
|
88
93
|
const utilLogic = getStdlibNamespace().findChild('util').logics;
|
|
89
94
|
return utilLogic.find((item) => item.name === typeName);
|
package/src/bak/translator.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PAGE_COMPONENT_INCLUDE_TAG_MAP, ComponentCompletionPropertyMap } from '..';
|
|
2
|
-
import { attrConvertCamelCase } from '../utils/index'
|
|
2
|
+
import { attrConvertCamelCase, getControlNode, isSelectClassComponent } from '../utils/index';
|
|
3
3
|
function safeCodeAsKey(name) {
|
|
4
4
|
return `['${name}']`;
|
|
5
5
|
}
|
|
@@ -117,6 +117,47 @@ export default function (definition, view) {
|
|
|
117
117
|
*/
|
|
118
118
|
const viewComputedData = []
|
|
119
119
|
const viewMethodData = []
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* 流程表单设计器中,审批页是一个特殊的页面,需要特殊处理
|
|
123
|
+
*/
|
|
124
|
+
if (view?.composedBy) {
|
|
125
|
+
const form = view.app
|
|
126
|
+
.getComposeNodes(view.composedBy)
|
|
127
|
+
.find((it) => it.name === view.composedBy[0]);
|
|
128
|
+
form.children[0].children[0].children.forEach((it) => {
|
|
129
|
+
const element = getControlNode(it.children[0]);
|
|
130
|
+
const isNeedCollect = isSelectClassComponent(element);
|
|
131
|
+
if (isNeedCollect) {
|
|
132
|
+
const attrs = element.bindAttrs;
|
|
133
|
+
attrs.forEach((attr) => {
|
|
134
|
+
let variable = '';
|
|
135
|
+
if (attr.expression) {
|
|
136
|
+
variable += `${attr.expression?.toJS()}`
|
|
137
|
+
} else if (attr.type === 'static') {
|
|
138
|
+
variable = `${attr.value}`
|
|
139
|
+
}
|
|
140
|
+
if (attr.expression?.concept === 'CallLogic' && attr.name === 'dataSource') {
|
|
141
|
+
console.log('attr', attr);
|
|
142
|
+
const currentParamsNum = element.currentIndex + 1;
|
|
143
|
+
let currentParamList = [];
|
|
144
|
+
for (let i = 0; i < currentParamsNum; i++) {
|
|
145
|
+
currentParamList.push(`,current${i === 0 ? '' : i}`);
|
|
146
|
+
}
|
|
147
|
+
const codeLoad = `async '__${
|
|
148
|
+
element.name
|
|
149
|
+
}_handleDataSourceLoad'(params${currentParamList.join('')}) {
|
|
150
|
+
this['__${element.name}_params'] = {...params};
|
|
151
|
+
return ${variable}
|
|
152
|
+
}`;
|
|
153
|
+
viewMethodData.push(codeLoad);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
|
|
120
161
|
// 组件数据源属性的制品翻译
|
|
121
162
|
definition.elementsAll.forEach(element => {
|
|
122
163
|
element.bindAttrs.forEach(attr => {
|
|
@@ -27,6 +27,7 @@ type HistoryInApp = {
|
|
|
27
27
|
oldObject?: null | Record<string, any>,
|
|
28
28
|
}>,
|
|
29
29
|
}>,
|
|
30
|
+
_historyName?: string;
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
const neatKeys = [
|
|
@@ -45,7 +46,7 @@ export const isAppDirty = (app: HistoryInApp = {}) => {
|
|
|
45
46
|
_historyList = [],
|
|
46
47
|
} = app;
|
|
47
48
|
|
|
48
|
-
const historyList = _historyList.slice(0, _historyIndex);
|
|
49
|
+
const historyList = Array.isArray(_historyList) ? _historyList.slice(0, _historyIndex) : [];
|
|
49
50
|
|
|
50
51
|
return historyList.some((item = {}) => {
|
|
51
52
|
const { list = [] } = item;
|
package/src/common/BaseNode.ts
CHANGED
|
@@ -30,6 +30,7 @@ const patchCompose = (node: BaseNode, type = 'add') => {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
|
|
33
34
|
type NodePathOption = {
|
|
34
35
|
useName?: boolean,
|
|
35
36
|
}
|
|
@@ -321,6 +322,25 @@ export class BaseNode extends EventEmitter {
|
|
|
321
322
|
const app = (this as any)?.app;
|
|
322
323
|
app && app?._action !== 'undo' && app.addComposeNodes(this.composedBy, this); // undo 操作是临时判断,无法准确判断到触发点
|
|
323
324
|
}
|
|
325
|
+
if(['Entity','Logic',"ViewElement"].includes(source.concept)){
|
|
326
|
+
const app = (this as any)?.app;
|
|
327
|
+
if(app){
|
|
328
|
+
(app?.getDefaultOnAnno()?.[source.concept] as any)?.map((anno:any)=>{
|
|
329
|
+
if((this as any)?.applyAnnotations?.length>0){
|
|
330
|
+
// (this as any)?._addApplyAnnotation(anno?.transToApplyAnno())
|
|
331
|
+
(this as any)?.applyAnnotations.push(anno?.transToApplyAnno())
|
|
332
|
+
}else{
|
|
333
|
+
(this as any).applyAnnotations = [anno?.transToApplyAnno()]
|
|
334
|
+
// this.update({
|
|
335
|
+
// applyAnnotations:[anno?.transToApplyAnno()]
|
|
336
|
+
// })
|
|
337
|
+
}
|
|
338
|
+
})
|
|
339
|
+
// this.applyAnnotations
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
}
|
|
343
|
+
|
|
324
344
|
}
|
|
325
345
|
|
|
326
346
|
fixInstantiate() {
|
|
@@ -789,9 +809,7 @@ export class BaseNode extends EventEmitter {
|
|
|
789
809
|
// 有一些继承的情况
|
|
790
810
|
const Ctor = classMap.get(source?.concept) || this;
|
|
791
811
|
if (Ctor && source instanceof Ctor) {
|
|
792
|
-
|
|
793
|
-
console.warn('传入的对象已经是一个实例,请确认逻辑是否存在问题!');
|
|
794
|
-
}
|
|
812
|
+
console.warn('传入的对象已经是一个实例,请确认逻辑是否存在问题!')
|
|
795
813
|
if (parentNode) {
|
|
796
814
|
source.parentNode = parentNode;
|
|
797
815
|
}
|
|
@@ -1395,7 +1413,7 @@ export class BaseNode extends EventEmitter {
|
|
|
1395
1413
|
for (const property of propertyMap.keys()) {
|
|
1396
1414
|
const child = node[property as keyof BaseNode];
|
|
1397
1415
|
if (!child) continue;
|
|
1398
|
-
else if (Array.isArray(child)) child
|
|
1416
|
+
else if (Array.isArray(child)) child?.forEach?.((node: types.SyntaxNode) => traverse(node));
|
|
1399
1417
|
else traverse(child);
|
|
1400
1418
|
}
|
|
1401
1419
|
}
|
|
@@ -1648,6 +1666,86 @@ export class BaseNode extends EventEmitter {
|
|
|
1648
1666
|
return traverse(this as unknown as types.SyntaxNode);
|
|
1649
1667
|
}
|
|
1650
1668
|
|
|
1669
|
+
/**
|
|
1670
|
+
* 广度遍历子节点,如果当前节点满足pre 函数,将不会再向下遍历
|
|
1671
|
+
* @param input 搜索条件
|
|
1672
|
+
* @param containsSelf: 是否包含自身
|
|
1673
|
+
* @returns 搜索到的节点
|
|
1674
|
+
*/
|
|
1675
|
+
findNaslNodeByBFS(input?: types.SyntaxNodeConcept | ((node: types.SyntaxNode) => boolean), containsSelf = false) {
|
|
1676
|
+
const pre =
|
|
1677
|
+
typeof input === 'undefined'
|
|
1678
|
+
? (node: types.SyntaxNode) => asserts.isBaseNode(node)
|
|
1679
|
+
: typeof input === 'string'
|
|
1680
|
+
? (node: types.SyntaxNode) => asserts[`isStrict${input}`]?.(node) ?? false
|
|
1681
|
+
: input;
|
|
1682
|
+
|
|
1683
|
+
const queue: types.SyntaxNode[] = []; // 创建一个队列存储待遍历的节点
|
|
1684
|
+
const results: types.SyntaxNode[] = []; // 创建一个数组存储匹配的结果
|
|
1685
|
+
|
|
1686
|
+
queue.push(this as unknown as types.SyntaxNode); // 将初始节点加入队列
|
|
1687
|
+
|
|
1688
|
+
while (queue.length > 0) {
|
|
1689
|
+
const node = queue.shift(); // 从队列中取出一个节点
|
|
1690
|
+
|
|
1691
|
+
if (node) {
|
|
1692
|
+
let result = false;
|
|
1693
|
+
if (!containsSelf) {
|
|
1694
|
+
result = node !== this && Boolean(node) && pre(node);
|
|
1695
|
+
} else {
|
|
1696
|
+
result = Boolean(node) && pre(node);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
if (result) {
|
|
1700
|
+
results.push(node); // 如果pre函数返回true,则将节点添加到结果数组
|
|
1701
|
+
continue; // 继续下一次循环,继续遍历同层级的其他节点
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
const propertyMap = getConceptPropertyMap(node?.concept);
|
|
1705
|
+
|
|
1706
|
+
if (!propertyMap) {
|
|
1707
|
+
continue; // 如果没有属性映射,则继续下一次循环
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
for (const property of propertyMap.keys()) {
|
|
1711
|
+
const child = node[property as keyof BaseNode];
|
|
1712
|
+
|
|
1713
|
+
// 如果子节点不存在,则继续下一次循环
|
|
1714
|
+
if (!child) {
|
|
1715
|
+
continue; // 如果子节点不存在,则继续下一次循环
|
|
1716
|
+
}
|
|
1717
|
+
else if (Array.isArray(child)) {
|
|
1718
|
+
for (const item of child) {
|
|
1719
|
+
const itemResult = Boolean(item) && pre(item);
|
|
1720
|
+
|
|
1721
|
+
if (itemResult) {
|
|
1722
|
+
results.push(item); // 如果pre函数返回true,则将节点添加到结果数组
|
|
1723
|
+
continue; // 继续下一次循环,继续遍历同层级的其他节点;
|
|
1724
|
+
}
|
|
1725
|
+
// 只有节点是一个 NaslNode 才会继续遍历
|
|
1726
|
+
if (asserts.isBaseNode(item)) {
|
|
1727
|
+
queue.push(item as types.SyntaxNode); // 将子节点加入队列
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
else {
|
|
1732
|
+
const childResult = Boolean(child) && pre(child);
|
|
1733
|
+
|
|
1734
|
+
if (childResult) {
|
|
1735
|
+
results.push(child); // 如果pre函数返回true,则将节点添加到结果数组
|
|
1736
|
+
continue;
|
|
1737
|
+
}
|
|
1738
|
+
if (asserts.isBaseNode(child)) {
|
|
1739
|
+
queue.push(child as types.SyntaxNode); // 将子节点加入队列
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
return results; // 返回匹配的结果数组
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1651
1749
|
*toEmbeddedTS(): Generator<any, string, any> {
|
|
1652
1750
|
return '';
|
|
1653
1751
|
}
|
|
@@ -1667,9 +1765,23 @@ export class BaseNode extends EventEmitter {
|
|
|
1667
1765
|
*/
|
|
1668
1766
|
toDebugTs() {
|
|
1669
1767
|
utils.runGeneratorAsync(this.toEmbeddedTS()).then((data) => {
|
|
1670
|
-
console.
|
|
1768
|
+
console.dir(data);
|
|
1671
1769
|
});
|
|
1672
1770
|
}
|
|
1771
|
+
|
|
1772
|
+
/**
|
|
1773
|
+
* 判断目标节点是否为当前节点的祖先节点
|
|
1774
|
+
*/
|
|
1775
|
+
isAncestor(node: BaseNode) {
|
|
1776
|
+
let { parentNode } = this;
|
|
1777
|
+
while (parentNode) {
|
|
1778
|
+
if (parentNode === node) {
|
|
1779
|
+
return true;
|
|
1780
|
+
}
|
|
1781
|
+
parentNode = parentNode.parentNode;
|
|
1782
|
+
}
|
|
1783
|
+
return false;
|
|
1784
|
+
}
|
|
1673
1785
|
}
|
|
1674
1786
|
|
|
1675
1787
|
export default BaseNode;
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
//================================================================================
|
|
2
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
4
|
+
//================================================================================
|
|
5
|
+
import { EventPayload, Params } from '../common/EventEmitter';
|
|
6
|
+
import { concept, excludedInJSON, property, getConceptConstructor } from '../decorators';
|
|
7
|
+
|
|
8
|
+
import * as utils from '../utils';
|
|
9
|
+
import { createUUID } from '../utils/create';
|
|
10
|
+
import * as types from './utils/types';
|
|
11
|
+
import * as asserts from './utils/asserts';
|
|
12
|
+
import BaseNode from '../common/BaseNode';
|
|
13
|
+
import ApplyAnnotation from './ApplyAnnotation__';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 可使用注解
|
|
17
|
+
*/
|
|
18
|
+
@concept('可使用注解')
|
|
19
|
+
export abstract class Annotatable extends BaseNode {
|
|
20
|
+
/** 类名 */
|
|
21
|
+
static readonly ConceptName: string = 'Annotatable';
|
|
22
|
+
/**
|
|
23
|
+
* 是否为抽象类
|
|
24
|
+
* 抽象类不能产生 concept: string
|
|
25
|
+
*/
|
|
26
|
+
static isAbstract: boolean = true;
|
|
27
|
+
/** 继承链 */
|
|
28
|
+
static readonly inheritanceChain: string[] = ['BaseNode'];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 产品概念
|
|
32
|
+
*/
|
|
33
|
+
@property('concept')
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
readonly concept!:
|
|
36
|
+
| 'Entity'
|
|
37
|
+
| 'View'
|
|
38
|
+
| 'ViewElement'
|
|
39
|
+
| 'Logic'
|
|
40
|
+
| 'AuthLogic'
|
|
41
|
+
| 'AuthLogicForCallInterface'
|
|
42
|
+
| 'BusinessLogic'
|
|
43
|
+
| 'ConnectorLogic';
|
|
44
|
+
/**
|
|
45
|
+
* 注解列表
|
|
46
|
+
*/
|
|
47
|
+
@property({
|
|
48
|
+
objectRef: 'ApplyAnnotation',
|
|
49
|
+
isArray: true,
|
|
50
|
+
defaultValue: null,
|
|
51
|
+
})
|
|
52
|
+
applyAnnotations?: Array<ApplyAnnotation>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @param source 需要合并的部分参数
|
|
56
|
+
*/
|
|
57
|
+
constructor(source?: Partial<Annotatable>) {
|
|
58
|
+
source = Object.assign({}, Annotatable.getDefaultOptions(), source);
|
|
59
|
+
super(source);
|
|
60
|
+
super.subConstructor(source);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static from(source: any, parentNode?: any, parentKey?: string): Annotatable {
|
|
64
|
+
return super.from(source, parentNode, parentKey) as Annotatable;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
getApplyAnnotationExistingNames(excludedList: Array<ApplyAnnotation> = []) {
|
|
68
|
+
const excludedSet = new Set(excludedList);
|
|
69
|
+
return ((this.applyAnnotations as ApplyAnnotation[]) || [])
|
|
70
|
+
.filter((item) => !excludedSet.has(item))
|
|
71
|
+
.map((item) => item.name);
|
|
72
|
+
}
|
|
73
|
+
getApplyAnnotationUniqueName(name = 'applyAnnotation1') {
|
|
74
|
+
return utils.unique(name, this.getApplyAnnotationExistingNames(), undefined, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 插入使用注解
|
|
79
|
+
* @internal
|
|
80
|
+
* @param name 使用注解名称,如果不填会自动生成一个唯一名称
|
|
81
|
+
*/
|
|
82
|
+
_insertApplyAnnotationAt(name: string, index: number): ApplyAnnotation;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 插入使用注解
|
|
86
|
+
* @internal
|
|
87
|
+
* @param applyAnnotationOptions 使用注解参数
|
|
88
|
+
*/
|
|
89
|
+
_insertApplyAnnotationAt(applyAnnotationOptions: Partial<ApplyAnnotation>, index: number): ApplyAnnotation;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* 插入使用注解
|
|
93
|
+
* @internal
|
|
94
|
+
* @param applyAnnotation 已有的使用注解实例
|
|
95
|
+
*/
|
|
96
|
+
_insertApplyAnnotationAt(applyAnnotation: ApplyAnnotation, index: number): ApplyAnnotation;
|
|
97
|
+
|
|
98
|
+
_insertApplyAnnotationAt(options: string | Partial<ApplyAnnotation> | ApplyAnnotation, index: number) {
|
|
99
|
+
const applyAnnotationOptions: any = {};
|
|
100
|
+
const relationOptions = { parentNode: this, parentKey: 'applyAnnotations' };
|
|
101
|
+
const ApplyAnnotation = getConceptConstructor('ApplyAnnotation');
|
|
102
|
+
let applyAnnotation: ApplyAnnotation;
|
|
103
|
+
if (!options) {
|
|
104
|
+
applyAnnotation = ApplyAnnotation.from(
|
|
105
|
+
{
|
|
106
|
+
...applyAnnotationOptions,
|
|
107
|
+
name: this.getApplyAnnotationUniqueName(),
|
|
108
|
+
},
|
|
109
|
+
this,
|
|
110
|
+
'applyAnnotations',
|
|
111
|
+
);
|
|
112
|
+
} else if (typeof options === 'string') {
|
|
113
|
+
applyAnnotation = ApplyAnnotation.from(
|
|
114
|
+
{
|
|
115
|
+
...applyAnnotationOptions,
|
|
116
|
+
name: options,
|
|
117
|
+
},
|
|
118
|
+
this,
|
|
119
|
+
'applyAnnotations',
|
|
120
|
+
);
|
|
121
|
+
} else if (asserts.isApplyAnnotation(options)) {
|
|
122
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
123
|
+
applyAnnotation = options;
|
|
124
|
+
Object.assign(applyAnnotation, relationOptions);
|
|
125
|
+
} else {
|
|
126
|
+
applyAnnotation = ApplyAnnotation.from(
|
|
127
|
+
{
|
|
128
|
+
...applyAnnotationOptions,
|
|
129
|
+
...options,
|
|
130
|
+
},
|
|
131
|
+
this,
|
|
132
|
+
'applyAnnotations',
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
this.applyAnnotations.splice(index, 0, applyAnnotation);
|
|
136
|
+
return applyAnnotation;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 插入使用注解
|
|
141
|
+
* @param name 使用注解名称,如果不填会自动生成一个唯一名称
|
|
142
|
+
*/
|
|
143
|
+
insertApplyAnnotationAt(name: string, index: number): ApplyAnnotation;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 插入使用注解
|
|
147
|
+
* @param applyAnnotationOptions 使用注解参数
|
|
148
|
+
*/
|
|
149
|
+
insertApplyAnnotationAt(applyAnnotationOptions: Partial<ApplyAnnotation>, index: number): ApplyAnnotation;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 插入使用注解
|
|
153
|
+
* @param applyAnnotation 已有的使用注解实例
|
|
154
|
+
*/
|
|
155
|
+
insertApplyAnnotationAt(applyAnnotation: ApplyAnnotation, index: number): ApplyAnnotation;
|
|
156
|
+
|
|
157
|
+
insertApplyAnnotationAt(options: string | Partial<ApplyAnnotation> | ApplyAnnotation, index: number) {
|
|
158
|
+
const node = this._insertApplyAnnotationAt(options as any, index);
|
|
159
|
+
node.create({
|
|
160
|
+
index,
|
|
161
|
+
parentNode: this,
|
|
162
|
+
parentKey: 'applyAnnotations',
|
|
163
|
+
});
|
|
164
|
+
return node;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* 添加使用注解
|
|
169
|
+
* @internal
|
|
170
|
+
* @param name 使用注解名称,如果不填会自动生成一个唯一名称
|
|
171
|
+
*/
|
|
172
|
+
_addApplyAnnotation(name?: string): ApplyAnnotation;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* 添加使用注解
|
|
176
|
+
* @internal
|
|
177
|
+
* @param applyAnnotationOptions 使用注解参数
|
|
178
|
+
*/
|
|
179
|
+
_addApplyAnnotation(applyAnnotationOptions: Partial<ApplyAnnotation>): ApplyAnnotation;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* 添加使用注解
|
|
183
|
+
* @internal
|
|
184
|
+
* @param applyAnnotation 已有的使用注解实例
|
|
185
|
+
*/
|
|
186
|
+
_addApplyAnnotation(applyAnnotation: ApplyAnnotation): ApplyAnnotation;
|
|
187
|
+
|
|
188
|
+
_addApplyAnnotation(options?: string | Partial<ApplyAnnotation> | ApplyAnnotation) {
|
|
189
|
+
const index = this.applyAnnotations.length;
|
|
190
|
+
return this._insertApplyAnnotationAt(options as any, index);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* 添加使用注解
|
|
195
|
+
* @internal
|
|
196
|
+
* @param name 使用注解名称,如果不填会自动生成一个唯一名称
|
|
197
|
+
*/
|
|
198
|
+
addApplyAnnotation(name?: string): ApplyAnnotation;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 添加使用注解
|
|
202
|
+
* @param applyAnnotationOptions 使用注解参数
|
|
203
|
+
*/
|
|
204
|
+
addApplyAnnotation(applyAnnotationOptions: Partial<ApplyAnnotation>): ApplyAnnotation;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* 添加使用注解
|
|
208
|
+
* @param applyAnnotation 已有的使用注解实例
|
|
209
|
+
*/
|
|
210
|
+
addApplyAnnotation(applyAnnotation: ApplyAnnotation): ApplyAnnotation;
|
|
211
|
+
|
|
212
|
+
addApplyAnnotation(options?: string | Partial<ApplyAnnotation> | ApplyAnnotation) {
|
|
213
|
+
const node = this._addApplyAnnotation(options as any);
|
|
214
|
+
const index = this.applyAnnotations.indexOf(node);
|
|
215
|
+
node.create({
|
|
216
|
+
index,
|
|
217
|
+
parentNode: this,
|
|
218
|
+
parentKey: 'applyAnnotations',
|
|
219
|
+
});
|
|
220
|
+
return node;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* 删除使用注解
|
|
225
|
+
* @param name 使用注解名称
|
|
226
|
+
*/
|
|
227
|
+
removeApplyAnnotation(name: string): void;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* 删除使用注解
|
|
231
|
+
* @param applyAnnotation 已有的使用注解实例
|
|
232
|
+
*/
|
|
233
|
+
removeApplyAnnotation(applyAnnotation: ApplyAnnotation): void;
|
|
234
|
+
|
|
235
|
+
removeApplyAnnotation(options: string | ApplyAnnotation) {
|
|
236
|
+
let applyAnnotation: ApplyAnnotation;
|
|
237
|
+
if (typeof options === 'string') {
|
|
238
|
+
applyAnnotation = (this.applyAnnotations as ApplyAnnotation[]).find((item) => item.name === options);
|
|
239
|
+
if (!applyAnnotation) {
|
|
240
|
+
throw new Error('找不到使用注解 ' + options);
|
|
241
|
+
}
|
|
242
|
+
} else {
|
|
243
|
+
applyAnnotation = options;
|
|
244
|
+
}
|
|
245
|
+
return applyAnnotation.delete();
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
//================================================================================
|
|
249
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
250
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
251
|
+
//================================================================================
|
|
252
|
+
|
|
253
|
+
//================================================================================
|
|
254
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
255
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
256
|
+
//================================================================================
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export default Annotatable;
|
|
260
|
+
//================================================================================
|
|
261
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
262
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
263
|
+
//================================================================================
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
//================================================================================
|
|
2
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
4
|
+
//================================================================================
|
|
5
|
+
import { EventPayload, Params } from '../common/EventEmitter';
|
|
6
|
+
import { concept, excludedInJSON, property, getConceptConstructor } from '../decorators';
|
|
7
|
+
|
|
8
|
+
import * as utils from '../utils';
|
|
9
|
+
import { createUUID } from '../utils/create';
|
|
10
|
+
import * as types from './utils/types';
|
|
11
|
+
import * as asserts from './utils/asserts';
|
|
12
|
+
import BaseNode from '../common/BaseNode';
|
|
13
|
+
import TypeAnnotation from './TypeAnnotation__';
|
|
14
|
+
import BaseSetter from './BaseSetter__';
|
|
15
|
+
import DefaultValue from './DefaultValue__';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 注解属性
|
|
19
|
+
*/
|
|
20
|
+
@concept('注解属性')
|
|
21
|
+
export class AnnotationProperty extends BaseNode {
|
|
22
|
+
/** 类名 */
|
|
23
|
+
static readonly ConceptName: string = 'AnnotationProperty';
|
|
24
|
+
/**
|
|
25
|
+
* 是否为抽象类
|
|
26
|
+
* 抽象类不能产生 concept: string
|
|
27
|
+
*/
|
|
28
|
+
static isAbstract: boolean = false;
|
|
29
|
+
/** 继承链 */
|
|
30
|
+
static readonly inheritanceChain: string[] = ['BaseNode'];
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 产品概念
|
|
34
|
+
*/
|
|
35
|
+
@property('concept')
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
readonly concept!: 'AnnotationProperty';
|
|
38
|
+
/**
|
|
39
|
+
* 注解属性名称
|
|
40
|
+
*/
|
|
41
|
+
@property()
|
|
42
|
+
name: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 注解属性标题
|
|
46
|
+
*/
|
|
47
|
+
@property()
|
|
48
|
+
title: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 注解属性类型
|
|
52
|
+
*/
|
|
53
|
+
@property({
|
|
54
|
+
objectRef: 'TypeAnnotation',
|
|
55
|
+
})
|
|
56
|
+
typeAnnotation: TypeAnnotation;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 设置器
|
|
60
|
+
*/
|
|
61
|
+
@property({
|
|
62
|
+
objectRef: 'BaseSetter',
|
|
63
|
+
})
|
|
64
|
+
setter: BaseSetter;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* 注解属性默认值
|
|
68
|
+
*/
|
|
69
|
+
@property({
|
|
70
|
+
objectRef: 'DefaultValue',
|
|
71
|
+
})
|
|
72
|
+
defaultValue?: DefaultValue;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @param source 需要合并的部分参数
|
|
76
|
+
*/
|
|
77
|
+
constructor(source?: Partial<AnnotationProperty>) {
|
|
78
|
+
source = Object.assign({}, AnnotationProperty.getDefaultOptions(), source);
|
|
79
|
+
super(source);
|
|
80
|
+
super.subConstructor(source);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static from(source: any, parentNode?: any, parentKey?: string): AnnotationProperty {
|
|
84
|
+
return super.from(source, parentNode, parentKey) as AnnotationProperty;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//================================================================================
|
|
88
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
89
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
90
|
+
//================================================================================
|
|
91
|
+
|
|
92
|
+
//================================================================================
|
|
93
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
94
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
95
|
+
//================================================================================
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export default AnnotationProperty;
|
|
99
|
+
//================================================================================
|
|
100
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
101
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
102
|
+
//================================================================================
|