@lcap/nasl-concepts 3.9.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/README.md +3 -0
- package/out/breakpoint/index.d.ts +2 -0
- package/out/breakpoint/index.d.ts.map +1 -0
- package/out/breakpoint/index.js +18 -0
- package/out/breakpoint/index.js.map +1 -0
- package/out/breakpoint/operation.d.ts +11 -0
- package/out/breakpoint/operation.d.ts.map +1 -0
- package/out/breakpoint/operation.js +24 -0
- package/out/breakpoint/operation.js.map +1 -0
- package/out/common/BaseNode.d.ts +427 -0
- package/out/common/BaseNode.d.ts.map +1 -0
- package/out/common/BaseNode.js +1721 -0
- package/out/common/BaseNode.js.map +1 -0
- package/out/common/EventEmitter.d.ts +30 -0
- package/out/common/EventEmitter.d.ts.map +1 -0
- package/out/common/EventEmitter.js +70 -0
- package/out/common/EventEmitter.js.map +1 -0
- package/out/common/index.d.ts +3 -0
- package/out/common/index.d.ts.map +1 -0
- package/out/common/index.js +19 -0
- package/out/common/index.js.map +1 -0
- package/out/common/types.d.ts +5 -0
- package/out/common/types.d.ts.map +1 -0
- package/out/common/types.js +3 -0
- package/out/common/types.js.map +1 -0
- package/out/concepts/Abort__.d.ts +32 -0
- package/out/concepts/Abort__.d.ts.map +1 -0
- package/out/concepts/Abort__.js +94 -0
- package/out/concepts/Abort__.js.map +1 -0
- package/out/concepts/AbstractInterface__.d.ts +29 -0
- package/out/concepts/AbstractInterface__.d.ts.map +1 -0
- package/out/concepts/AbstractInterface__.js +62 -0
- package/out/concepts/AbstractInterface__.js.map +1 -0
- package/out/concepts/Anchor__.d.ts +44 -0
- package/out/concepts/Anchor__.d.ts.map +1 -0
- package/out/concepts/Anchor__.js +179 -0
- package/out/concepts/Anchor__.js.map +1 -0
- package/out/concepts/Annotatable__.d.ts +111 -0
- package/out/concepts/Annotatable__.d.ts.map +1 -0
- package/out/concepts/Annotatable__.js +163 -0
- package/out/concepts/Annotatable__.js.map +1 -0
- package/out/concepts/AnnotationProperty__.d.ts +49 -0
- package/out/concepts/AnnotationProperty__.d.ts.map +1 -0
- package/out/concepts/AnnotationProperty__.js +76 -0
- package/out/concepts/AnnotationProperty__.js.map +1 -0
- package/out/concepts/Annotation__.d.ts +129 -0
- package/out/concepts/Annotation__.d.ts.map +1 -0
- package/out/concepts/Annotation__.js +249 -0
- package/out/concepts/Annotation__.js.map +1 -0
- package/out/concepts/AnonymousFunction__.d.ts +141 -0
- package/out/concepts/AnonymousFunction__.d.ts.map +1 -0
- package/out/concepts/AnonymousFunction__.js +428 -0
- package/out/concepts/AnonymousFunction__.js.map +1 -0
- package/out/concepts/App__.d.ts +1794 -0
- package/out/concepts/App__.d.ts.map +1 -0
- package/out/concepts/App__.js +3475 -0
- package/out/concepts/App__.js.map +1 -0
- package/out/concepts/ApplyAnnotation__.d.ts +88 -0
- package/out/concepts/ApplyAnnotation__.d.ts.map +1 -0
- package/out/concepts/ApplyAnnotation__.js +142 -0
- package/out/concepts/ApplyAnnotation__.js.map +1 -0
- package/out/concepts/ApprovalPolicyV2__.d.ts +27 -0
- package/out/concepts/ApprovalPolicyV2__.d.ts.map +1 -0
- package/out/concepts/ApprovalPolicyV2__.js +55 -0
- package/out/concepts/ApprovalPolicyV2__.js.map +1 -0
- package/out/concepts/Argument__.d.ts +85 -0
- package/out/concepts/Argument__.d.ts.map +1 -0
- package/out/concepts/Argument__.js +390 -0
- package/out/concepts/Argument__.js.map +1 -0
- package/out/concepts/AssigneeV2__.d.ts +380 -0
- package/out/concepts/AssigneeV2__.d.ts.map +1 -0
- package/out/concepts/AssigneeV2__.js +517 -0
- package/out/concepts/AssigneeV2__.js.map +1 -0
- package/out/concepts/Assignee__.d.ts +296 -0
- package/out/concepts/Assignee__.d.ts.map +1 -0
- package/out/concepts/Assignee__.js +404 -0
- package/out/concepts/Assignee__.js.map +1 -0
- package/out/concepts/AssignmentLine__.d.ts +44 -0
- package/out/concepts/AssignmentLine__.d.ts.map +1 -0
- package/out/concepts/AssignmentLine__.js +110 -0
- package/out/concepts/AssignmentLine__.js.map +1 -0
- package/out/concepts/Assignment__.d.ts +59 -0
- package/out/concepts/Assignment__.d.ts.map +1 -0
- package/out/concepts/Assignment__.js +288 -0
- package/out/concepts/Assignment__.js.map +1 -0
- package/out/concepts/Attribute__.d.ts +77 -0
- package/out/concepts/Attribute__.d.ts.map +1 -0
- package/out/concepts/Attribute__.js +103 -0
- package/out/concepts/Attribute__.js.map +1 -0
- package/out/concepts/AuthInterface__.d.ts +39 -0
- package/out/concepts/AuthInterface__.d.ts.map +1 -0
- package/out/concepts/AuthInterface__.js +79 -0
- package/out/concepts/AuthInterface__.js.map +1 -0
- package/out/concepts/AuthLogicForCallInterface__.d.ts +148 -0
- package/out/concepts/AuthLogicForCallInterface__.d.ts.map +1 -0
- package/out/concepts/AuthLogicForCallInterface__.js +597 -0
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
- package/out/concepts/AuthLogic__.d.ts +70 -0
- package/out/concepts/AuthLogic__.d.ts.map +1 -0
- package/out/concepts/AuthLogic__.js +211 -0
- package/out/concepts/AuthLogic__.js.map +1 -0
- package/out/concepts/BackendVariable__.d.ts +120 -0
- package/out/concepts/BackendVariable__.d.ts.map +1 -0
- package/out/concepts/BackendVariable__.js +432 -0
- package/out/concepts/BackendVariable__.js.map +1 -0
- package/out/concepts/Backend__.d.ts +128 -0
- package/out/concepts/Backend__.d.ts.map +1 -0
- package/out/concepts/Backend__.js +238 -0
- package/out/concepts/Backend__.js.map +1 -0
- package/out/concepts/BaseSetter__.d.ts +27 -0
- package/out/concepts/BaseSetter__.d.ts.map +1 -0
- package/out/concepts/BaseSetter__.js +55 -0
- package/out/concepts/BaseSetter__.js.map +1 -0
- package/out/concepts/BatchAssignment__.d.ts +246 -0
- package/out/concepts/BatchAssignment__.d.ts.map +1 -0
- package/out/concepts/BatchAssignment__.js +831 -0
- package/out/concepts/BatchAssignment__.js.map +1 -0
- package/out/concepts/BinaryExpression__.d.ts +64 -0
- package/out/concepts/BinaryExpression__.d.ts.map +1 -0
- package/out/concepts/BinaryExpression__.js +508 -0
- package/out/concepts/BinaryExpression__.js.map +1 -0
- package/out/concepts/BindAttribute__.d.ts +294 -0
- package/out/concepts/BindAttribute__.d.ts.map +1 -0
- package/out/concepts/BindAttribute__.js +1023 -0
- package/out/concepts/BindAttribute__.js.map +1 -0
- package/out/concepts/BindDirective__.d.ts +157 -0
- package/out/concepts/BindDirective__.d.ts.map +1 -0
- package/out/concepts/BindDirective__.js +492 -0
- package/out/concepts/BindDirective__.js.map +1 -0
- package/out/concepts/BindEvent__.d.ts +247 -0
- package/out/concepts/BindEvent__.d.ts.map +1 -0
- package/out/concepts/BindEvent__.js +833 -0
- package/out/concepts/BindEvent__.js.map +1 -0
- package/out/concepts/BindStyle__.d.ts +128 -0
- package/out/concepts/BindStyle__.d.ts.map +1 -0
- package/out/concepts/BindStyle__.js +412 -0
- package/out/concepts/BindStyle__.js.map +1 -0
- package/out/concepts/Block__.d.ts +90 -0
- package/out/concepts/Block__.d.ts.map +1 -0
- package/out/concepts/Block__.js +204 -0
- package/out/concepts/Block__.js.map +1 -0
- package/out/concepts/BooleanLiteral__.d.ts +46 -0
- package/out/concepts/BooleanLiteral__.d.ts.map +1 -0
- package/out/concepts/BooleanLiteral__.js +119 -0
- package/out/concepts/BooleanLiteral__.js.map +1 -0
- package/out/concepts/BusinessComponent__.d.ts +648 -0
- package/out/concepts/BusinessComponent__.d.ts.map +1 -0
- package/out/concepts/BusinessComponent__.js +1785 -0
- package/out/concepts/BusinessComponent__.js.map +1 -0
- package/out/concepts/BusinessLogic__.d.ts +46 -0
- package/out/concepts/BusinessLogic__.d.ts.map +1 -0
- package/out/concepts/BusinessLogic__.js +485 -0
- package/out/concepts/BusinessLogic__.js.map +1 -0
- package/out/concepts/CallAuthInterface__.d.ts +134 -0
- package/out/concepts/CallAuthInterface__.d.ts.map +1 -0
- package/out/concepts/CallAuthInterface__.js +426 -0
- package/out/concepts/CallAuthInterface__.js.map +1 -0
- package/out/concepts/CallConnector__.d.ts +56 -0
- package/out/concepts/CallConnector__.d.ts.map +1 -0
- package/out/concepts/CallConnector__.js +296 -0
- package/out/concepts/CallConnector__.js.map +1 -0
- package/out/concepts/CallEvent__.d.ts +103 -0
- package/out/concepts/CallEvent__.d.ts.map +1 -0
- package/out/concepts/CallEvent__.js +326 -0
- package/out/concepts/CallEvent__.js.map +1 -0
- package/out/concepts/CallFunction__.d.ts +173 -0
- package/out/concepts/CallFunction__.d.ts.map +1 -0
- package/out/concepts/CallFunction__.js +679 -0
- package/out/concepts/CallFunction__.js.map +1 -0
- package/out/concepts/CallInterface__.d.ts +145 -0
- package/out/concepts/CallInterface__.d.ts.map +1 -0
- package/out/concepts/CallInterface__.js +882 -0
- package/out/concepts/CallInterface__.js.map +1 -0
- package/out/concepts/CallLogic__.d.ts +247 -0
- package/out/concepts/CallLogic__.d.ts.map +1 -0
- package/out/concepts/CallLogic__.js +1583 -0
- package/out/concepts/CallLogic__.js.map +1 -0
- package/out/concepts/CallQueryComponent__.d.ts +380 -0
- package/out/concepts/CallQueryComponent__.d.ts.map +1 -0
- package/out/concepts/CallQueryComponent__.js +1227 -0
- package/out/concepts/CallQueryComponent__.js.map +1 -0
- package/out/concepts/CapsulesSetter__.d.ts +114 -0
- package/out/concepts/CapsulesSetter__.d.ts.map +1 -0
- package/out/concepts/CapsulesSetter__.js +172 -0
- package/out/concepts/CapsulesSetter__.js.map +1 -0
- package/out/concepts/Comment__.d.ts +42 -0
- package/out/concepts/Comment__.d.ts.map +1 -0
- package/out/concepts/Comment__.js +107 -0
- package/out/concepts/Comment__.js.map +1 -0
- package/out/concepts/CompletionProperty__.d.ts +88 -0
- package/out/concepts/CompletionProperty__.d.ts.map +1 -0
- package/out/concepts/CompletionProperty__.js +175 -0
- package/out/concepts/CompletionProperty__.js.map +1 -0
- package/out/concepts/ConfigGroup__.d.ts +122 -0
- package/out/concepts/ConfigGroup__.d.ts.map +1 -0
- package/out/concepts/ConfigGroup__.js +228 -0
- package/out/concepts/ConfigGroup__.js.map +1 -0
- package/out/concepts/ConfigPropertyValue__.d.ts +42 -0
- package/out/concepts/ConfigPropertyValue__.d.ts.map +1 -0
- package/out/concepts/ConfigPropertyValue__.js +83 -0
- package/out/concepts/ConfigPropertyValue__.js.map +1 -0
- package/out/concepts/ConfigProperty__.d.ts +148 -0
- package/out/concepts/ConfigProperty__.d.ts.map +1 -0
- package/out/concepts/ConfigProperty__.js +294 -0
- package/out/concepts/ConfigProperty__.js.map +1 -0
- package/out/concepts/Configuration__.d.ts +121 -0
- package/out/concepts/Configuration__.d.ts.map +1 -0
- package/out/concepts/Configuration__.js +202 -0
- package/out/concepts/Configuration__.js.map +1 -0
- package/out/concepts/Connection__.d.ts +165 -0
- package/out/concepts/Connection__.d.ts.map +1 -0
- package/out/concepts/Connection__.js +330 -0
- package/out/concepts/Connection__.js.map +1 -0
- package/out/concepts/ConnectorLogic__.d.ts +34 -0
- package/out/concepts/ConnectorLogic__.d.ts.map +1 -0
- package/out/concepts/ConnectorLogic__.js +69 -0
- package/out/concepts/ConnectorLogic__.js.map +1 -0
- package/out/concepts/ConnectorTriggerLauncher__.d.ts +45 -0
- package/out/concepts/ConnectorTriggerLauncher__.d.ts.map +1 -0
- package/out/concepts/ConnectorTriggerLauncher__.js +98 -0
- package/out/concepts/ConnectorTriggerLauncher__.js.map +1 -0
- package/out/concepts/ConnectorTrigger__.d.ts +94 -0
- package/out/concepts/ConnectorTrigger__.d.ts.map +1 -0
- package/out/concepts/ConnectorTrigger__.js +339 -0
- package/out/concepts/ConnectorTrigger__.js.map +1 -0
- package/out/concepts/Connector__.d.ts +533 -0
- package/out/concepts/Connector__.d.ts.map +1 -0
- package/out/concepts/Connector__.js +670 -0
- package/out/concepts/Connector__.js.map +1 -0
- package/out/concepts/Constant__.d.ts +95 -0
- package/out/concepts/Constant__.d.ts.map +1 -0
- package/out/concepts/Constant__.js +243 -0
- package/out/concepts/Constant__.js.map +1 -0
- package/out/concepts/CountersignPolicyV2__.d.ts +30 -0
- package/out/concepts/CountersignPolicyV2__.d.ts.map +1 -0
- package/out/concepts/CountersignPolicyV2__.js +58 -0
- package/out/concepts/CountersignPolicyV2__.js.map +1 -0
- package/out/concepts/CountersignPolicy__.d.ts +30 -0
- package/out/concepts/CountersignPolicy__.d.ts.map +1 -0
- package/out/concepts/CountersignPolicy__.js +58 -0
- package/out/concepts/CountersignPolicy__.js.map +1 -0
- package/out/concepts/DataSource__.d.ts +166 -0
- package/out/concepts/DataSource__.d.ts.map +1 -0
- package/out/concepts/DataSource__.js +516 -0
- package/out/concepts/DataSource__.js.map +1 -0
- package/out/concepts/DatabaseTypeAnnotation__.d.ts +36 -0
- package/out/concepts/DatabaseTypeAnnotation__.d.ts.map +1 -0
- package/out/concepts/DatabaseTypeAnnotation__.js +81 -0
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -0
- package/out/concepts/DefaultValue__.d.ts +96 -0
- package/out/concepts/DefaultValue__.d.ts.map +1 -0
- package/out/concepts/DefaultValue__.js +212 -0
- package/out/concepts/DefaultValue__.js.map +1 -0
- package/out/concepts/DepartmentManagerV2__.d.ts +30 -0
- package/out/concepts/DepartmentManagerV2__.d.ts.map +1 -0
- package/out/concepts/DepartmentManagerV2__.js +58 -0
- package/out/concepts/DepartmentManagerV2__.js.map +1 -0
- package/out/concepts/DepartmentV2__.d.ts +34 -0
- package/out/concepts/DepartmentV2__.d.ts.map +1 -0
- package/out/concepts/DepartmentV2__.js +65 -0
- package/out/concepts/DepartmentV2__.js.map +1 -0
- package/out/concepts/Destination__.d.ts +151 -0
- package/out/concepts/Destination__.d.ts.map +1 -0
- package/out/concepts/Destination__.js +771 -0
- package/out/concepts/Destination__.js.map +1 -0
- package/out/concepts/DirectManagerV2__.d.ts +26 -0
- package/out/concepts/DirectManagerV2__.d.ts.map +1 -0
- package/out/concepts/DirectManagerV2__.js +55 -0
- package/out/concepts/DirectManagerV2__.js.map +1 -0
- package/out/concepts/End__.d.ts +31 -0
- package/out/concepts/End__.d.ts.map +1 -0
- package/out/concepts/End__.js +150 -0
- package/out/concepts/End__.js.map +1 -0
- package/out/concepts/EntityIndex__.d.ts +94 -0
- package/out/concepts/EntityIndex__.d.ts.map +1 -0
- package/out/concepts/EntityIndex__.js +201 -0
- package/out/concepts/EntityIndex__.js.map +1 -0
- package/out/concepts/EntityProperty__.d.ts +254 -0
- package/out/concepts/EntityProperty__.d.ts.map +1 -0
- package/out/concepts/EntityProperty__.js +715 -0
- package/out/concepts/EntityProperty__.js.map +1 -0
- package/out/concepts/Entity__.d.ts +341 -0
- package/out/concepts/Entity__.d.ts.map +1 -0
- package/out/concepts/Entity__.js +783 -0
- package/out/concepts/Entity__.js.map +1 -0
- package/out/concepts/EnumItem__.d.ts +93 -0
- package/out/concepts/EnumItem__.d.ts.map +1 -0
- package/out/concepts/EnumItem__.js +235 -0
- package/out/concepts/EnumItem__.js.map +1 -0
- package/out/concepts/EnumSelectSetter__.d.ts +114 -0
- package/out/concepts/EnumSelectSetter__.d.ts.map +1 -0
- package/out/concepts/EnumSelectSetter__.js +172 -0
- package/out/concepts/EnumSelectSetter__.js.map +1 -0
- package/out/concepts/Enum__.d.ts +129 -0
- package/out/concepts/Enum__.d.ts.map +1 -0
- package/out/concepts/Enum__.js +342 -0
- package/out/concepts/Enum__.js.map +1 -0
- package/out/concepts/EventDeclaration__.d.ts +43 -0
- package/out/concepts/EventDeclaration__.d.ts.map +1 -0
- package/out/concepts/EventDeclaration__.js +109 -0
- package/out/concepts/EventDeclaration__.js.map +1 -0
- package/out/concepts/Event__.d.ts +156 -0
- package/out/concepts/Event__.d.ts.map +1 -0
- package/out/concepts/Event__.js +291 -0
- package/out/concepts/Event__.js.map +1 -0
- package/out/concepts/ExternalDestination__.d.ts +65 -0
- package/out/concepts/ExternalDestination__.d.ts.map +1 -0
- package/out/concepts/ExternalDestination__.js +285 -0
- package/out/concepts/ExternalDestination__.js.map +1 -0
- package/out/concepts/FieldPermissionV2__.d.ts +40 -0
- package/out/concepts/FieldPermissionV2__.d.ts.map +1 -0
- package/out/concepts/FieldPermissionV2__.js +85 -0
- package/out/concepts/FieldPermissionV2__.js.map +1 -0
- package/out/concepts/FlowConditionItemV2__.d.ts +45 -0
- package/out/concepts/FlowConditionItemV2__.d.ts.map +1 -0
- package/out/concepts/FlowConditionItemV2__.js +107 -0
- package/out/concepts/FlowConditionItemV2__.js.map +1 -0
- package/out/concepts/FlowConditionV2__.d.ts +116 -0
- package/out/concepts/FlowConditionV2__.d.ts.map +1 -0
- package/out/concepts/FlowConditionV2__.js +181 -0
- package/out/concepts/FlowConditionV2__.js.map +1 -0
- package/out/concepts/ForEachStatement__.d.ts +128 -0
- package/out/concepts/ForEachStatement__.d.ts.map +1 -0
- package/out/concepts/ForEachStatement__.js +398 -0
- package/out/concepts/ForEachStatement__.js.map +1 -0
- package/out/concepts/FrontendLibrary__.d.ts +213 -0
- package/out/concepts/FrontendLibrary__.d.ts.map +1 -0
- package/out/concepts/FrontendLibrary__.js +303 -0
- package/out/concepts/FrontendLibrary__.js.map +1 -0
- package/out/concepts/FrontendType__.d.ts +312 -0
- package/out/concepts/FrontendType__.d.ts.map +1 -0
- package/out/concepts/FrontendType__.js +550 -0
- package/out/concepts/FrontendType__.js.map +1 -0
- package/out/concepts/FrontendVariable__.d.ts +42 -0
- package/out/concepts/FrontendVariable__.d.ts.map +1 -0
- package/out/concepts/FrontendVariable__.js +81 -0
- package/out/concepts/FrontendVariable__.js.map +1 -0
- package/out/concepts/Frontend__.d.ts +395 -0
- package/out/concepts/Frontend__.d.ts.map +1 -0
- package/out/concepts/Frontend__.js +870 -0
- package/out/concepts/Frontend__.js.map +1 -0
- package/out/concepts/Function__.d.ts +400 -0
- package/out/concepts/Function__.d.ts.map +1 -0
- package/out/concepts/Function__.js +631 -0
- package/out/concepts/Function__.js.map +1 -0
- package/out/concepts/HistoryProcessV2__.d.ts +229 -0
- package/out/concepts/HistoryProcessV2__.d.ts.map +1 -0
- package/out/concepts/HistoryProcessV2__.js +345 -0
- package/out/concepts/HistoryProcessV2__.js.map +1 -0
- package/out/concepts/I18nInfo__.d.ts +48 -0
- package/out/concepts/I18nInfo__.d.ts.map +1 -0
- package/out/concepts/I18nInfo__.js +100 -0
- package/out/concepts/I18nInfo__.js.map +1 -0
- package/out/concepts/IconSetter__.d.ts +30 -0
- package/out/concepts/IconSetter__.d.ts.map +1 -0
- package/out/concepts/IconSetter__.js +58 -0
- package/out/concepts/IconSetter__.js.map +1 -0
- package/out/concepts/Identifier__.d.ts +69 -0
- package/out/concepts/Identifier__.d.ts.map +1 -0
- package/out/concepts/Identifier__.js +437 -0
- package/out/concepts/Identifier__.js.map +1 -0
- package/out/concepts/IfStatement__.d.ts +157 -0
- package/out/concepts/IfStatement__.d.ts.map +1 -0
- package/out/concepts/IfStatement__.js +365 -0
- package/out/concepts/IfStatement__.js.map +1 -0
- package/out/concepts/ImageSetter__.d.ts +26 -0
- package/out/concepts/ImageSetter__.d.ts.map +1 -0
- package/out/concepts/ImageSetter__.js +55 -0
- package/out/concepts/ImageSetter__.js.map +1 -0
- package/out/concepts/ImportedInterface__.d.ts +31 -0
- package/out/concepts/ImportedInterface__.d.ts.map +1 -0
- package/out/concepts/ImportedInterface__.js +58 -0
- package/out/concepts/ImportedInterface__.js.map +1 -0
- package/out/concepts/InputSetter__.d.ts +30 -0
- package/out/concepts/InputSetter__.d.ts.map +1 -0
- package/out/concepts/InputSetter__.js +58 -0
- package/out/concepts/InputSetter__.js.map +1 -0
- package/out/concepts/Integration__.d.ts +129 -0
- package/out/concepts/Integration__.d.ts.map +1 -0
- package/out/concepts/Integration__.js +215 -0
- package/out/concepts/Integration__.js.map +1 -0
- package/out/concepts/InterfaceParam__.d.ts +121 -0
- package/out/concepts/InterfaceParam__.d.ts.map +1 -0
- package/out/concepts/InterfaceParam__.js +285 -0
- package/out/concepts/InterfaceParam__.js.map +1 -0
- package/out/concepts/InterfaceTriggerEvent__.d.ts +35 -0
- package/out/concepts/InterfaceTriggerEvent__.d.ts.map +1 -0
- package/out/concepts/InterfaceTriggerEvent__.js +74 -0
- package/out/concepts/InterfaceTriggerEvent__.js.map +1 -0
- package/out/concepts/Interface__.d.ts +406 -0
- package/out/concepts/Interface__.d.ts.map +1 -0
- package/out/concepts/Interface__.js +994 -0
- package/out/concepts/Interface__.js.map +1 -0
- package/out/concepts/JSBlock__.d.ts +40 -0
- package/out/concepts/JSBlock__.d.ts.map +1 -0
- package/out/concepts/JSBlock__.js +110 -0
- package/out/concepts/JSBlock__.js.map +1 -0
- package/out/concepts/JavaLogic__.d.ts +51 -0
- package/out/concepts/JavaLogic__.d.ts.map +1 -0
- package/out/concepts/JavaLogic__.js +116 -0
- package/out/concepts/JavaLogic__.js.map +1 -0
- package/out/concepts/LogicDeclaration__.d.ts +292 -0
- package/out/concepts/LogicDeclaration__.d.ts.map +1 -0
- package/out/concepts/LogicDeclaration__.js +421 -0
- package/out/concepts/LogicDeclaration__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +188 -0
- package/out/concepts/LogicItem__.d.ts.map +1 -0
- package/out/concepts/LogicItem__.js +322 -0
- package/out/concepts/LogicItem__.js.map +1 -0
- package/out/concepts/Logic__.d.ts +657 -0
- package/out/concepts/Logic__.d.ts.map +1 -0
- package/out/concepts/Logic__.js +2280 -0
- package/out/concepts/Logic__.js.map +1 -0
- package/out/concepts/ManagerV2__.d.ts +36 -0
- package/out/concepts/ManagerV2__.d.ts.map +1 -0
- package/out/concepts/ManagerV2__.js +63 -0
- package/out/concepts/ManagerV2__.js.map +1 -0
- package/out/concepts/MatchCase__.d.ts +266 -0
- package/out/concepts/MatchCase__.d.ts.map +1 -0
- package/out/concepts/MatchCase__.js +677 -0
- package/out/concepts/MatchCase__.js.map +1 -0
- package/out/concepts/Match__.d.ts +125 -0
- package/out/concepts/Match__.d.ts.map +1 -0
- package/out/concepts/Match__.js +685 -0
- package/out/concepts/Match__.js.map +1 -0
- package/out/concepts/MemberExpression__.d.ts +66 -0
- package/out/concepts/MemberExpression__.d.ts.map +1 -0
- package/out/concepts/MemberExpression__.js +514 -0
- package/out/concepts/MemberExpression__.js.map +1 -0
- package/out/concepts/MetadataType__.d.ts +222 -0
- package/out/concepts/MetadataType__.d.ts.map +1 -0
- package/out/concepts/MetadataType__.js +422 -0
- package/out/concepts/MetadataType__.js.map +1 -0
- package/out/concepts/MicroApp__.d.ts +54 -0
- package/out/concepts/MicroApp__.d.ts.map +1 -0
- package/out/concepts/MicroApp__.js +80 -0
- package/out/concepts/MicroApp__.js.map +1 -0
- package/out/concepts/Module__.d.ts +1314 -0
- package/out/concepts/Module__.d.ts.map +1 -0
- package/out/concepts/Module__.js +1580 -0
- package/out/concepts/Module__.js.map +1 -0
- package/out/concepts/MsgTriggerEvent__.d.ts +139 -0
- package/out/concepts/MsgTriggerEvent__.d.ts.map +1 -0
- package/out/concepts/MsgTriggerEvent__.js +210 -0
- package/out/concepts/MsgTriggerEvent__.js.map +1 -0
- package/out/concepts/MsgTriggerLauncher__.d.ts +120 -0
- package/out/concepts/MsgTriggerLauncher__.d.ts.map +1 -0
- package/out/concepts/MsgTriggerLauncher__.js +189 -0
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -0
- package/out/concepts/MultiApprovalPolicy__.d.ts +27 -0
- package/out/concepts/MultiApprovalPolicy__.d.ts.map +1 -0
- package/out/concepts/MultiApprovalPolicy__.js +55 -0
- package/out/concepts/MultiApprovalPolicy__.js.map +1 -0
- package/out/concepts/Namespace__.d.ts +1146 -0
- package/out/concepts/Namespace__.d.ts.map +1 -0
- package/out/concepts/Namespace__.js +1256 -0
- package/out/concepts/Namespace__.js.map +1 -0
- package/out/concepts/NewComposite__.d.ts +341 -0
- package/out/concepts/NewComposite__.d.ts.map +1 -0
- package/out/concepts/NewComposite__.js +1225 -0
- package/out/concepts/NewComposite__.js.map +1 -0
- package/out/concepts/NewList__.d.ts +128 -0
- package/out/concepts/NewList__.d.ts.map +1 -0
- package/out/concepts/NewList__.js +408 -0
- package/out/concepts/NewList__.js.map +1 -0
- package/out/concepts/NewMap__.d.ts +219 -0
- package/out/concepts/NewMap__.d.ts.map +1 -0
- package/out/concepts/NewMap__.js +558 -0
- package/out/concepts/NewMap__.js.map +1 -0
- package/out/concepts/New__.d.ts +32 -0
- package/out/concepts/New__.d.ts.map +1 -0
- package/out/concepts/New__.js +80 -0
- package/out/concepts/New__.js.map +1 -0
- package/out/concepts/NullLiteral__.d.ts +37 -0
- package/out/concepts/NullLiteral__.d.ts.map +1 -0
- package/out/concepts/NullLiteral__.js +102 -0
- package/out/concepts/NullLiteral__.js.map +1 -0
- package/out/concepts/NumberInputSetter__.d.ts +46 -0
- package/out/concepts/NumberInputSetter__.d.ts.map +1 -0
- package/out/concepts/NumberInputSetter__.js +70 -0
- package/out/concepts/NumberInputSetter__.js.map +1 -0
- package/out/concepts/NumericLiteral__.d.ts +49 -0
- package/out/concepts/NumericLiteral__.d.ts.map +1 -0
- package/out/concepts/NumericLiteral__.js +141 -0
- package/out/concepts/NumericLiteral__.js.map +1 -0
- package/out/concepts/OperatePermissionV2__.d.ts +44 -0
- package/out/concepts/OperatePermissionV2__.d.ts.map +1 -0
- package/out/concepts/OperatePermissionV2__.js +82 -0
- package/out/concepts/OperatePermissionV2__.js.map +1 -0
- package/out/concepts/OqlQueryComponent__.d.ts +63 -0
- package/out/concepts/OqlQueryComponent__.d.ts.map +1 -0
- package/out/concepts/OqlQueryComponent__.js +313 -0
- package/out/concepts/OqlQueryComponent__.js.map +1 -0
- package/out/concepts/OrSignPolicyV2__.d.ts +26 -0
- package/out/concepts/OrSignPolicyV2__.d.ts.map +1 -0
- package/out/concepts/OrSignPolicyV2__.js +55 -0
- package/out/concepts/OrSignPolicyV2__.js.map +1 -0
- package/out/concepts/OverriddenLogic__.d.ts +618 -0
- package/out/concepts/OverriddenLogic__.d.ts.map +1 -0
- package/out/concepts/OverriddenLogic__.js +1657 -0
- package/out/concepts/OverriddenLogic__.js.map +1 -0
- package/out/concepts/Paginate__.d.ts +57 -0
- package/out/concepts/Paginate__.d.ts.map +1 -0
- package/out/concepts/Paginate__.js +163 -0
- package/out/concepts/Paginate__.js.map +1 -0
- package/out/concepts/ParamWithGroup__.d.ts +44 -0
- package/out/concepts/ParamWithGroup__.d.ts.map +1 -0
- package/out/concepts/ParamWithGroup__.js +161 -0
- package/out/concepts/ParamWithGroup__.js.map +1 -0
- package/out/concepts/Param__.d.ts +145 -0
- package/out/concepts/Param__.d.ts.map +1 -0
- package/out/concepts/Param__.js +453 -0
- package/out/concepts/Param__.js.map +1 -0
- package/out/concepts/Point__.d.ts +34 -0
- package/out/concepts/Point__.d.ts.map +1 -0
- package/out/concepts/Point__.js +61 -0
- package/out/concepts/Point__.js.map +1 -0
- package/out/concepts/ProcessBindV2__.d.ts +53 -0
- package/out/concepts/ProcessBindV2__.d.ts.map +1 -0
- package/out/concepts/ProcessBindV2__.js +114 -0
- package/out/concepts/ProcessBindV2__.js.map +1 -0
- package/out/concepts/ProcessComponentV2__.d.ts +126 -0
- package/out/concepts/ProcessComponentV2__.d.ts.map +1 -0
- package/out/concepts/ProcessComponentV2__.js +186 -0
- package/out/concepts/ProcessComponentV2__.js.map +1 -0
- package/out/concepts/ProcessComponent__.d.ts +215 -0
- package/out/concepts/ProcessComponent__.d.ts.map +1 -0
- package/out/concepts/ProcessComponent__.js +276 -0
- package/out/concepts/ProcessComponent__.js.map +1 -0
- package/out/concepts/ProcessElementV2__.d.ts +552 -0
- package/out/concepts/ProcessElementV2__.d.ts.map +1 -0
- package/out/concepts/ProcessElementV2__.js +954 -0
- package/out/concepts/ProcessElementV2__.js.map +1 -0
- package/out/concepts/ProcessElement__.d.ts +628 -0
- package/out/concepts/ProcessElement__.d.ts.map +1 -0
- package/out/concepts/ProcessElement__.js +1079 -0
- package/out/concepts/ProcessElement__.js.map +1 -0
- package/out/concepts/ProcessOutcome__.d.ts +36 -0
- package/out/concepts/ProcessOutcome__.d.ts.map +1 -0
- package/out/concepts/ProcessOutcome__.js +97 -0
- package/out/concepts/ProcessOutcome__.js.map +1 -0
- package/out/concepts/ProcessOutcomes__.d.ts +36 -0
- package/out/concepts/ProcessOutcomes__.d.ts.map +1 -0
- package/out/concepts/ProcessOutcomes__.js +104 -0
- package/out/concepts/ProcessOutcomes__.js.map +1 -0
- package/out/concepts/ProcessV2__.d.ts +433 -0
- package/out/concepts/ProcessV2__.d.ts.map +1 -0
- package/out/concepts/ProcessV2__.js +732 -0
- package/out/concepts/ProcessV2__.js.map +1 -0
- package/out/concepts/Process__.d.ts +615 -0
- package/out/concepts/Process__.d.ts.map +1 -0
- package/out/concepts/Process__.js +985 -0
- package/out/concepts/Process__.js.map +1 -0
- package/out/concepts/PropDeclaration__.d.ts +109 -0
- package/out/concepts/PropDeclaration__.d.ts.map +1 -0
- package/out/concepts/PropDeclaration__.js +137 -0
- package/out/concepts/PropDeclaration__.js.map +1 -0
- package/out/concepts/PropertySelectSetter__.d.ts +26 -0
- package/out/concepts/PropertySelectSetter__.d.ts.map +1 -0
- package/out/concepts/PropertySelectSetter__.js +55 -0
- package/out/concepts/PropertySelectSetter__.js.map +1 -0
- package/out/concepts/QueryAggregateExpression__.d.ts +51 -0
- package/out/concepts/QueryAggregateExpression__.d.ts.map +1 -0
- package/out/concepts/QueryAggregateExpression__.js +126 -0
- package/out/concepts/QueryAggregateExpression__.js.map +1 -0
- package/out/concepts/QueryFieldExpression__.d.ts +67 -0
- package/out/concepts/QueryFieldExpression__.d.ts.map +1 -0
- package/out/concepts/QueryFieldExpression__.js +207 -0
- package/out/concepts/QueryFieldExpression__.js.map +1 -0
- package/out/concepts/QueryFromExpression__.d.ts +108 -0
- package/out/concepts/QueryFromExpression__.d.ts.map +1 -0
- package/out/concepts/QueryFromExpression__.js +244 -0
- package/out/concepts/QueryFromExpression__.js.map +1 -0
- package/out/concepts/QueryGroupByExpression__.d.ts +48 -0
- package/out/concepts/QueryGroupByExpression__.d.ts.map +1 -0
- package/out/concepts/QueryGroupByExpression__.js +123 -0
- package/out/concepts/QueryGroupByExpression__.js.map +1 -0
- package/out/concepts/QueryJoinExpression__.d.ts +195 -0
- package/out/concepts/QueryJoinExpression__.d.ts.map +1 -0
- package/out/concepts/QueryJoinExpression__.js +357 -0
- package/out/concepts/QueryJoinExpression__.js.map +1 -0
- package/out/concepts/QueryLimitExpression__.d.ts +48 -0
- package/out/concepts/QueryLimitExpression__.d.ts.map +1 -0
- package/out/concepts/QueryLimitExpression__.js +141 -0
- package/out/concepts/QueryLimitExpression__.js.map +1 -0
- package/out/concepts/QueryOrderByExpression__.d.ts +59 -0
- package/out/concepts/QueryOrderByExpression__.d.ts.map +1 -0
- package/out/concepts/QueryOrderByExpression__.js +158 -0
- package/out/concepts/QueryOrderByExpression__.js.map +1 -0
- package/out/concepts/QuerySelectExpression__.d.ts +213 -0
- package/out/concepts/QuerySelectExpression__.d.ts.map +1 -0
- package/out/concepts/QuerySelectExpression__.js +346 -0
- package/out/concepts/QuerySelectExpression__.js.map +1 -0
- package/out/concepts/Rect__.d.ts +42 -0
- package/out/concepts/Rect__.d.ts.map +1 -0
- package/out/concepts/Rect__.js +67 -0
- package/out/concepts/Rect__.js.map +1 -0
- package/out/concepts/Return__.d.ts +122 -0
- package/out/concepts/Return__.d.ts.map +1 -0
- package/out/concepts/Return__.js +359 -0
- package/out/concepts/Return__.js.map +1 -0
- package/out/concepts/Role__.d.ts +60 -0
- package/out/concepts/Role__.d.ts.map +1 -0
- package/out/concepts/Role__.js +188 -0
- package/out/concepts/Role__.js.map +1 -0
- package/out/concepts/SelectMembers__.d.ts +136 -0
- package/out/concepts/SelectMembers__.d.ts.map +1 -0
- package/out/concepts/SelectMembers__.js +259 -0
- package/out/concepts/SelectMembers__.js.map +1 -0
- package/out/concepts/SequentialPolicyV2__.d.ts +26 -0
- package/out/concepts/SequentialPolicyV2__.d.ts.map +1 -0
- package/out/concepts/SequentialPolicyV2__.js +55 -0
- package/out/concepts/SequentialPolicyV2__.js.map +1 -0
- package/out/concepts/SequentialPolicy__.d.ts +26 -0
- package/out/concepts/SequentialPolicy__.d.ts.map +1 -0
- package/out/concepts/SequentialPolicy__.js +55 -0
- package/out/concepts/SequentialPolicy__.js.map +1 -0
- package/out/concepts/SetterOption__.d.ts +50 -0
- package/out/concepts/SetterOption__.d.ts.map +1 -0
- package/out/concepts/SetterOption__.js +73 -0
- package/out/concepts/SetterOption__.js.map +1 -0
- package/out/concepts/SlotDeclaration__.d.ts +215 -0
- package/out/concepts/SlotDeclaration__.d.ts.map +1 -0
- package/out/concepts/SlotDeclaration__.js +285 -0
- package/out/concepts/SlotDeclaration__.js.map +1 -0
- package/out/concepts/Slot__.d.ts +54 -0
- package/out/concepts/Slot__.d.ts.map +1 -0
- package/out/concepts/Slot__.js +95 -0
- package/out/concepts/Slot__.js.map +1 -0
- package/out/concepts/SqlQueryComponent__.d.ts +59 -0
- package/out/concepts/SqlQueryComponent__.d.ts.map +1 -0
- package/out/concepts/SqlQueryComponent__.js +220 -0
- package/out/concepts/SqlQueryComponent__.js.map +1 -0
- package/out/concepts/Start__.d.ts +31 -0
- package/out/concepts/Start__.d.ts.map +1 -0
- package/out/concepts/Start__.js +75 -0
- package/out/concepts/Start__.js.map +1 -0
- package/out/concepts/StaticString__.d.ts +50 -0
- package/out/concepts/StaticString__.d.ts.map +1 -0
- package/out/concepts/StaticString__.js +114 -0
- package/out/concepts/StaticString__.js.map +1 -0
- package/out/concepts/StringInterpolation__.d.ts +124 -0
- package/out/concepts/StringInterpolation__.d.ts.map +1 -0
- package/out/concepts/StringInterpolation__.js +279 -0
- package/out/concepts/StringInterpolation__.js.map +1 -0
- package/out/concepts/StringLiteral__.d.ts +52 -0
- package/out/concepts/StringLiteral__.d.ts.map +1 -0
- package/out/concepts/StringLiteral__.js +185 -0
- package/out/concepts/StringLiteral__.js.map +1 -0
- package/out/concepts/StructureProperty__.d.ts +134 -0
- package/out/concepts/StructureProperty__.d.ts.map +1 -0
- package/out/concepts/StructureProperty__.js +292 -0
- package/out/concepts/StructureProperty__.js.map +1 -0
- package/out/concepts/Structure__.d.ts +241 -0
- package/out/concepts/Structure__.d.ts.map +1 -0
- package/out/concepts/Structure__.js +485 -0
- package/out/concepts/Structure__.js.map +1 -0
- package/out/concepts/SubLogic__.d.ts +418 -0
- package/out/concepts/SubLogic__.d.ts.map +1 -0
- package/out/concepts/SubLogic__.js +1002 -0
- package/out/concepts/SubLogic__.js.map +1 -0
- package/out/concepts/SwitchCase__.d.ts +93 -0
- package/out/concepts/SwitchCase__.d.ts.map +1 -0
- package/out/concepts/SwitchCase__.js +282 -0
- package/out/concepts/SwitchCase__.js.map +1 -0
- package/out/concepts/SwitchSetter__.d.ts +26 -0
- package/out/concepts/SwitchSetter__.d.ts.map +1 -0
- package/out/concepts/SwitchSetter__.js +55 -0
- package/out/concepts/SwitchSetter__.js.map +1 -0
- package/out/concepts/SwitchStatement__.d.ts +92 -0
- package/out/concepts/SwitchStatement__.d.ts.map +1 -0
- package/out/concepts/SwitchStatement__.js +221 -0
- package/out/concepts/SwitchStatement__.js.map +1 -0
- package/out/concepts/ThemeVariable__.d.ts +30 -0
- package/out/concepts/ThemeVariable__.d.ts.map +1 -0
- package/out/concepts/ThemeVariable__.js +58 -0
- package/out/concepts/ThemeVariable__.js.map +1 -0
- package/out/concepts/Theme__.d.ts +44 -0
- package/out/concepts/Theme__.d.ts.map +1 -0
- package/out/concepts/Theme__.js +83 -0
- package/out/concepts/Theme__.js.map +1 -0
- package/out/concepts/Transactional__.d.ts +86 -0
- package/out/concepts/Transactional__.d.ts.map +1 -0
- package/out/concepts/Transactional__.js +150 -0
- package/out/concepts/Transactional__.js.map +1 -0
- package/out/concepts/TriggerEvent__.d.ts +44 -0
- package/out/concepts/TriggerEvent__.d.ts.map +1 -0
- package/out/concepts/TriggerEvent__.js +93 -0
- package/out/concepts/TriggerEvent__.js.map +1 -0
- package/out/concepts/TriggerLauncher__.d.ts +77 -0
- package/out/concepts/TriggerLauncher__.d.ts.map +1 -0
- package/out/concepts/TriggerLauncher__.js +232 -0
- package/out/concepts/TriggerLauncher__.js.map +1 -0
- package/out/concepts/TypeAnnotation__.d.ts +310 -0
- package/out/concepts/TypeAnnotation__.d.ts.map +1 -0
- package/out/concepts/TypeAnnotation__.js +1169 -0
- package/out/concepts/TypeAnnotation__.js.map +1 -0
- package/out/concepts/TypeParam__.d.ts +40 -0
- package/out/concepts/TypeParam__.d.ts.map +1 -0
- package/out/concepts/TypeParam__.js +91 -0
- package/out/concepts/TypeParam__.js.map +1 -0
- package/out/concepts/UnaryExpression__.d.ts +48 -0
- package/out/concepts/UnaryExpression__.d.ts.map +1 -0
- package/out/concepts/UnaryExpression__.js +176 -0
- package/out/concepts/UnaryExpression__.js.map +1 -0
- package/out/concepts/Unparsed__.d.ts +42 -0
- package/out/concepts/Unparsed__.d.ts.map +1 -0
- package/out/concepts/Unparsed__.js +98 -0
- package/out/concepts/Unparsed__.js.map +1 -0
- package/out/concepts/UseComponent__.d.ts +34 -0
- package/out/concepts/UseComponent__.d.ts.map +1 -0
- package/out/concepts/UseComponent__.js +61 -0
- package/out/concepts/UseComponent__.js.map +1 -0
- package/out/concepts/ValidationRule__.d.ts +130 -0
- package/out/concepts/ValidationRule__.d.ts.map +1 -0
- package/out/concepts/ValidationRule__.js +542 -0
- package/out/concepts/ValidationRule__.js.map +1 -0
- package/out/concepts/Variable__.d.ts +140 -0
- package/out/concepts/Variable__.d.ts.map +1 -0
- package/out/concepts/Variable__.js +457 -0
- package/out/concepts/Variable__.js.map +1 -0
- package/out/concepts/ViewBlockWithImage__.d.ts +34 -0
- package/out/concepts/ViewBlockWithImage__.d.ts.map +1 -0
- package/out/concepts/ViewBlockWithImage__.js +61 -0
- package/out/concepts/ViewBlockWithImage__.js.map +1 -0
- package/out/concepts/ViewBlock__.d.ts +38 -0
- package/out/concepts/ViewBlock__.d.ts.map +1 -0
- package/out/concepts/ViewBlock__.js +64 -0
- package/out/concepts/ViewBlock__.js.map +1 -0
- package/out/concepts/ViewComponentDeclaration__.d.ts +727 -0
- package/out/concepts/ViewComponentDeclaration__.d.ts.map +1 -0
- package/out/concepts/ViewComponentDeclaration__.js +833 -0
- package/out/concepts/ViewComponentDeclaration__.js.map +1 -0
- package/out/concepts/ViewElement__.d.ts +666 -0
- package/out/concepts/ViewElement__.d.ts.map +1 -0
- package/out/concepts/ViewElement__.js +2929 -0
- package/out/concepts/ViewElement__.js.map +1 -0
- package/out/concepts/View__.d.ts +754 -0
- package/out/concepts/View__.d.ts.map +1 -0
- package/out/concepts/View__.js +2907 -0
- package/out/concepts/View__.js.map +1 -0
- package/out/concepts/WhileStatement__.d.ts +96 -0
- package/out/concepts/WhileStatement__.d.ts.map +1 -0
- package/out/concepts/WhileStatement__.js +256 -0
- package/out/concepts/WhileStatement__.js.map +1 -0
- package/out/concepts/basics/index.d.ts +16 -0
- package/out/concepts/basics/index.d.ts.map +1 -0
- package/out/concepts/basics/index.js +54 -0
- package/out/concepts/basics/index.js.map +1 -0
- package/out/concepts/basics/stdlib/index.d.ts +16 -0
- package/out/concepts/basics/stdlib/index.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/index.js +93 -0
- package/out/concepts/basics/stdlib/index.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.auth.d.ts +10 -0
- package/out/concepts/basics/stdlib/nasl.auth.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.auth.js +206 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.browser.d.ts +6 -0
- package/out/concepts/basics/stdlib/nasl.browser.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.browser.js +200 -0
- package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.collection.d.ts +10 -0
- package/out/concepts/basics/stdlib/nasl.collection.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.collection.js +57 -0
- package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.configuration.d.ts +10 -0
- package/out/concepts/basics/stdlib/nasl.configuration.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js +97 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.core.d.ts +8 -0
- package/out/concepts/basics/stdlib/nasl.core.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.core.js +47 -0
- package/out/concepts/basics/stdlib/nasl.core.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.event.d.ts +6 -0
- package/out/concepts/basics/stdlib/nasl.event.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.event.js +34 -0
- package/out/concepts/basics/stdlib/nasl.event.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.http.d.ts +10 -0
- package/out/concepts/basics/stdlib/nasl.http.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.http.js +174 -0
- package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.interface.d.ts +10 -0
- package/out/concepts/basics/stdlib/nasl.interface.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.interface.js +49 -0
- package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.io.d.ts +6 -0
- package/out/concepts/basics/stdlib/nasl.io.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.io.js +61 -0
- package/out/concepts/basics/stdlib/nasl.io.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.logging.d.ts +6 -0
- package/out/concepts/basics/stdlib/nasl.logging.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.logging.js +65 -0
- package/out/concepts/basics/stdlib/nasl.logging.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.process.d.ts +10 -0
- package/out/concepts/basics/stdlib/nasl.process.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.process.js +741 -0
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.processV2.d.ts +12 -0
- package/out/concepts/basics/stdlib/nasl.processV2.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.processV2.js +967 -0
- package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.ui.d.ts +10 -0
- package/out/concepts/basics/stdlib/nasl.ui.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.ui.js +1038 -0
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.util.d.ts +7 -0
- package/out/concepts/basics/stdlib/nasl.util.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.util.js +2501 -0
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.validation.d.ts +6 -0
- package/out/concepts/basics/stdlib/nasl.validation.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/nasl.validation.js +680 -0
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +5 -0
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +47 -0
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -0
- package/out/concepts/basics/stdlib/timeZone.d.ts +6 -0
- package/out/concepts/basics/stdlib/timeZone.d.ts.map +1 -0
- package/out/concepts/basics/stdlib/timeZone.js +196 -0
- package/out/concepts/basics/stdlib/timeZone.js.map +1 -0
- package/out/concepts/basics/types/coreTypeList.d.ts +5 -0
- package/out/concepts/basics/types/coreTypeList.d.ts.map +1 -0
- package/out/concepts/basics/types/coreTypeList.js +14 -0
- package/out/concepts/basics/types/coreTypeList.js.map +1 -0
- package/out/concepts/basics/types/dataTypes.d.ts +9 -0
- package/out/concepts/basics/types/dataTypes.d.ts.map +1 -0
- package/out/concepts/basics/types/dataTypes.js +18 -0
- package/out/concepts/basics/types/dataTypes.js.map +1 -0
- package/out/concepts/basics/types/index.d.ts +5 -0
- package/out/concepts/basics/types/index.d.ts.map +1 -0
- package/out/concepts/basics/types/index.js +17 -0
- package/out/concepts/basics/types/index.js.map +1 -0
- package/out/concepts/index.d.ts +6 -0
- package/out/concepts/index.d.ts.map +1 -0
- package/out/concepts/index.js +36 -0
- package/out/concepts/index.js.map +1 -0
- package/out/concepts/index__.d.ts +178 -0
- package/out/concepts/index__.d.ts.map +1 -0
- package/out/concepts/index__.js +194 -0
- package/out/concepts/index__.js.map +1 -0
- package/out/concepts/types__.d.ts +2 -0
- package/out/concepts/types__.d.ts.map +1 -0
- package/out/concepts/types__.js +3 -0
- package/out/concepts/types__.js.map +1 -0
- package/out/concepts/utils/asserts.d.ts +8822 -0
- package/out/concepts/utils/asserts.d.ts.map +1 -0
- package/out/concepts/utils/asserts.js +11727 -0
- package/out/concepts/utils/asserts.js.map +1 -0
- package/out/concepts/utils/quick-info.d.ts +21 -0
- package/out/concepts/utils/quick-info.d.ts.map +1 -0
- package/out/concepts/utils/quick-info.js +108 -0
- package/out/concepts/utils/quick-info.js.map +1 -0
- package/out/concepts/utils/types.d.ts +580 -0
- package/out/concepts/utils/types.d.ts.map +1 -0
- package/out/concepts/utils/types.js +3 -0
- package/out/concepts/utils/types.js.map +1 -0
- package/out/decorators/constant.d.ts +12 -0
- package/out/decorators/constant.d.ts.map +1 -0
- package/out/decorators/constant.js +6 -0
- package/out/decorators/constant.js.map +1 -0
- package/out/decorators/index.d.ts +34 -0
- package/out/decorators/index.d.ts.map +1 -0
- package/out/decorators/index.js +123 -0
- package/out/decorators/index.js.map +1 -0
- package/out/decorators/utils.d.ts +22 -0
- package/out/decorators/utils.d.ts.map +1 -0
- package/out/decorators/utils.js +50 -0
- package/out/decorators/utils.js.map +1 -0
- package/out/index.d.ts +13 -0
- package/out/index.d.ts.map +1 -0
- package/out/index.js +49 -0
- package/out/index.js.map +1 -0
- package/out/service/actionable.d.ts +3 -0
- package/out/service/actionable.d.ts.map +1 -0
- package/out/service/actionable.js +9 -0
- package/out/service/actionable.js.map +1 -0
- package/out/service/engine.d.ts +7 -0
- package/out/service/engine.d.ts.map +1 -0
- package/out/service/engine.js +120 -0
- package/out/service/engine.js.map +1 -0
- package/out/service/entity2LogicNamespace.d.ts +11 -0
- package/out/service/entity2LogicNamespace.d.ts.map +1 -0
- package/out/service/entity2LogicNamespace.js +379 -0
- package/out/service/entity2LogicNamespace.js.map +1 -0
- package/out/service/formatTsUtils.d.ts +37 -0
- package/out/service/formatTsUtils.d.ts.map +1 -0
- package/out/service/formatTsUtils.js +876 -0
- package/out/service/formatTsUtils.js.map +1 -0
- package/out/service/getConnector.d.ts +13 -0
- package/out/service/getConnector.d.ts.map +1 -0
- package/out/service/getConnector.js +117 -0
- package/out/service/getConnector.js.map +1 -0
- package/out/service/getExtensionModules.d.ts +4 -0
- package/out/service/getExtensionModules.d.ts.map +1 -0
- package/out/service/getExtensionModules.js +34 -0
- package/out/service/getExtensionModules.js.map +1 -0
- package/out/service/getFunctions.d.ts +4 -0
- package/out/service/getFunctions.d.ts.map +1 -0
- package/out/service/getFunctions.js +20 -0
- package/out/service/getFunctions.js.map +1 -0
- package/out/service/getInterfaces.d.ts +3 -0
- package/out/service/getInterfaces.d.ts.map +1 -0
- package/out/service/getInterfaces.js +48 -0
- package/out/service/getInterfaces.js.map +1 -0
- package/out/service/getLogging.d.ts +2 -0
- package/out/service/getLogging.d.ts.map +1 -0
- package/out/service/getLogging.js +9 -0
- package/out/service/getLogging.js.map +1 -0
- package/out/service/getLogics.d.ts +6 -0
- package/out/service/getLogics.d.ts.map +1 -0
- package/out/service/getLogics.js +509 -0
- package/out/service/getLogics.js.map +1 -0
- package/out/service/getMemberIdentifier.d.ts +18 -0
- package/out/service/getMemberIdentifier.d.ts.map +1 -0
- package/out/service/getMemberIdentifier.js +489 -0
- package/out/service/getMemberIdentifier.js.map +1 -0
- package/out/service/getProcessComponents.d.ts +3 -0
- package/out/service/getProcessComponents.d.ts.map +1 -0
- package/out/service/getProcessComponents.js +13 -0
- package/out/service/getProcessComponents.js.map +1 -0
- package/out/service/getProcesses.d.ts +34 -0
- package/out/service/getProcesses.d.ts.map +1 -0
- package/out/service/getProcesses.js +644 -0
- package/out/service/getProcesses.js.map +1 -0
- package/out/service/getProcessesV2.d.ts +91 -0
- package/out/service/getProcessesV2.d.ts.map +1 -0
- package/out/service/getProcessesV2.js +687 -0
- package/out/service/getProcessesV2.js.map +1 -0
- package/out/service/getValidates.d.ts +4 -0
- package/out/service/getValidates.d.ts.map +1 -0
- package/out/service/getValidates.js +14 -0
- package/out/service/getValidates.js.map +1 -0
- package/out/service/index.d.ts +19 -0
- package/out/service/index.d.ts.map +1 -0
- package/out/service/index.js +48 -0
- package/out/service/index.js.map +1 -0
- package/out/service/modules.d.ts +9 -0
- package/out/service/modules.d.ts.map +1 -0
- package/out/service/modules.js +88 -0
- package/out/service/modules.js.map +1 -0
- package/out/service/process2LogicNamespace.d.ts +27 -0
- package/out/service/process2LogicNamespace.d.ts.map +1 -0
- package/out/service/process2LogicNamespace.js +109 -0
- package/out/service/process2LogicNamespace.js.map +1 -0
- package/out/service/transform.d.ts +9 -0
- package/out/service/transform.d.ts.map +1 -0
- package/out/service/transform.js +36 -0
- package/out/service/transform.js.map +1 -0
- package/out/store/event.d.ts +14 -0
- package/out/store/event.d.ts.map +1 -0
- package/out/store/event.js +19 -0
- package/out/store/event.js.map +1 -0
- package/out/store/index.d.ts +8 -0
- package/out/store/index.d.ts.map +1 -0
- package/out/store/index.js +25 -0
- package/out/store/index.js.map +1 -0
- package/out/store/lib.d.ts +16 -0
- package/out/store/lib.d.ts.map +1 -0
- package/out/store/lib.js +21 -0
- package/out/store/lib.js.map +1 -0
- package/out/store/store.d.ts +16 -0
- package/out/store/store.d.ts.map +1 -0
- package/out/store/store.js +18 -0
- package/out/store/store.js.map +1 -0
- package/out/utils/bak-translator.d.ts +2 -0
- package/out/utils/bak-translator.d.ts.map +1 -0
- package/out/utils/bak-translator.js +334 -0
- package/out/utils/bak-translator.js.map +1 -0
- package/out/utils/constant.d.ts +4 -0
- package/out/utils/constant.d.ts.map +1 -0
- package/out/utils/constant.js +34 -0
- package/out/utils/constant.js.map +1 -0
- package/out/utils/index.d.ts +6 -0
- package/out/utils/index.d.ts.map +1 -0
- package/out/utils/index.js +22 -0
- package/out/utils/index.js.map +1 -0
- package/out/utils/node.d.ts +14 -0
- package/out/utils/node.d.ts.map +1 -0
- package/out/utils/node.js +85 -0
- package/out/utils/node.js.map +1 -0
- package/out/utils/utils.d.ts +13 -0
- package/out/utils/utils.d.ts.map +1 -0
- package/out/utils/utils.js +77 -0
- package/out/utils/utils.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,1785 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
+
};
|
|
34
|
+
var BusinessComponent_1;
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BusinessComponent = void 0;
|
|
37
|
+
const utils_1 = require("../utils");
|
|
38
|
+
const nasl_translator_1 = require("@lcap/nasl-translator");
|
|
39
|
+
const View__1 = require("./View__");
|
|
40
|
+
const utils_2 = require("../utils");
|
|
41
|
+
const getBranchCopyUniCode = () => window?.BranchCopyUniCode;
|
|
42
|
+
const removedViewElementCache = {}; // 临时记录删除的页面元素计数的最大值
|
|
43
|
+
const decorators_1 = require("../decorators");
|
|
44
|
+
const utils = __importStar(require("../utils"));
|
|
45
|
+
const asserts = __importStar(require("./utils/asserts"));
|
|
46
|
+
const BaseNode_1 = __importDefault(require("../common/BaseNode"));
|
|
47
|
+
/**
|
|
48
|
+
* 业务组件
|
|
49
|
+
*/
|
|
50
|
+
let BusinessComponent = class BusinessComponent extends BaseNode_1.default {
|
|
51
|
+
static { BusinessComponent_1 = this; }
|
|
52
|
+
/** 类名 */
|
|
53
|
+
static { this.ConceptName = 'BusinessComponent'; }
|
|
54
|
+
/**
|
|
55
|
+
* 是否为抽象类
|
|
56
|
+
* 抽象类不能产生 concept: string
|
|
57
|
+
*/
|
|
58
|
+
static { this.isAbstract = false; }
|
|
59
|
+
/** 继承链 */
|
|
60
|
+
static { this.inheritanceChain = ['BaseNode']; }
|
|
61
|
+
/**
|
|
62
|
+
* @param source 需要合并的部分参数
|
|
63
|
+
*/
|
|
64
|
+
constructor(source) {
|
|
65
|
+
source = Object.assign({}, BusinessComponent_1.getDefaultOptions(), source);
|
|
66
|
+
super(source);
|
|
67
|
+
/**
|
|
68
|
+
* 组件事件列表
|
|
69
|
+
*/
|
|
70
|
+
this.events = [];
|
|
71
|
+
/**
|
|
72
|
+
* 参数分组列表
|
|
73
|
+
*/
|
|
74
|
+
this.params = [];
|
|
75
|
+
/**
|
|
76
|
+
* 变量列表
|
|
77
|
+
*/
|
|
78
|
+
this.variables = [];
|
|
79
|
+
/**
|
|
80
|
+
* 元素绑定事件列表
|
|
81
|
+
*/
|
|
82
|
+
this.bindEvents = [];
|
|
83
|
+
/**
|
|
84
|
+
* 业务组件逻辑列表
|
|
85
|
+
*/
|
|
86
|
+
this.logics = [];
|
|
87
|
+
/**
|
|
88
|
+
* 页面元素列表
|
|
89
|
+
*/
|
|
90
|
+
this.elements = [];
|
|
91
|
+
/**
|
|
92
|
+
* 获取当前业务组件下所有elements上bindEvents下的logic
|
|
93
|
+
*/
|
|
94
|
+
this.elementLogicRoot = [];
|
|
95
|
+
this.existingViewElement = new Set();
|
|
96
|
+
super.subConstructor(source);
|
|
97
|
+
}
|
|
98
|
+
static from(source, parentNode, parentKey) {
|
|
99
|
+
return super.from(source, parentNode, parentKey);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 设置业务组件名称
|
|
103
|
+
*/
|
|
104
|
+
setName(name) {
|
|
105
|
+
const object = {
|
|
106
|
+
name,
|
|
107
|
+
};
|
|
108
|
+
this.update({
|
|
109
|
+
...object,
|
|
110
|
+
field: 'name',
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* 设置业务组件标题
|
|
115
|
+
*/
|
|
116
|
+
setTitle(title) {
|
|
117
|
+
const object = {
|
|
118
|
+
title,
|
|
119
|
+
};
|
|
120
|
+
this.update({
|
|
121
|
+
...object,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* 设置业务组件描述
|
|
126
|
+
*/
|
|
127
|
+
setDescription(description) {
|
|
128
|
+
const object = {
|
|
129
|
+
description,
|
|
130
|
+
};
|
|
131
|
+
this.update({
|
|
132
|
+
...object,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* 设置icon
|
|
137
|
+
*/
|
|
138
|
+
setIcon(icon) {
|
|
139
|
+
const object = {
|
|
140
|
+
icon,
|
|
141
|
+
};
|
|
142
|
+
this.update({
|
|
143
|
+
...object,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
getEventExistingNames(excludedList = []) {
|
|
147
|
+
const excludedSet = new Set(excludedList);
|
|
148
|
+
return (this.events || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
149
|
+
}
|
|
150
|
+
getEventUniqueName(name = 'event1') {
|
|
151
|
+
return utils.unique(name, this.getEventExistingNames(), undefined, false);
|
|
152
|
+
}
|
|
153
|
+
_insertEventAt(options, index) {
|
|
154
|
+
const eventOptions = {};
|
|
155
|
+
const relationOptions = { parentNode: this, parentKey: 'events' };
|
|
156
|
+
const Event = (0, decorators_1.getConceptConstructor)('Event');
|
|
157
|
+
let event;
|
|
158
|
+
if (!options) {
|
|
159
|
+
event = Event.from({
|
|
160
|
+
...eventOptions,
|
|
161
|
+
name: this.getEventUniqueName(),
|
|
162
|
+
}, this, 'events');
|
|
163
|
+
}
|
|
164
|
+
else if (typeof options === 'string') {
|
|
165
|
+
event = Event.from({
|
|
166
|
+
...eventOptions,
|
|
167
|
+
name: options,
|
|
168
|
+
}, this, 'events');
|
|
169
|
+
}
|
|
170
|
+
else if (asserts.isEvent(options)) {
|
|
171
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
172
|
+
event = options;
|
|
173
|
+
Object.assign(event, relationOptions);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
event = Event.from({
|
|
177
|
+
...eventOptions,
|
|
178
|
+
...options,
|
|
179
|
+
}, this, 'events');
|
|
180
|
+
}
|
|
181
|
+
this.events.splice(index, 0, event);
|
|
182
|
+
return event;
|
|
183
|
+
}
|
|
184
|
+
insertEventAt(options, index) {
|
|
185
|
+
const node = this._insertEventAt(options, index);
|
|
186
|
+
node.create({
|
|
187
|
+
index,
|
|
188
|
+
parentNode: this,
|
|
189
|
+
parentKey: 'events',
|
|
190
|
+
});
|
|
191
|
+
return node;
|
|
192
|
+
}
|
|
193
|
+
_addEvent(options) {
|
|
194
|
+
const index = this.events.length;
|
|
195
|
+
return this._insertEventAt(options, index);
|
|
196
|
+
}
|
|
197
|
+
addEvent(options) {
|
|
198
|
+
const node = this._addEvent(options);
|
|
199
|
+
const index = this.events.indexOf(node);
|
|
200
|
+
node.create({
|
|
201
|
+
index,
|
|
202
|
+
parentNode: this,
|
|
203
|
+
parentKey: 'events',
|
|
204
|
+
});
|
|
205
|
+
return node;
|
|
206
|
+
}
|
|
207
|
+
getParamUniqueName(name = 'param1') {
|
|
208
|
+
return utils.unique(name, this.getVarExistingNames(), undefined, false);
|
|
209
|
+
}
|
|
210
|
+
_insertParamAt(options, index) {
|
|
211
|
+
const paramOptions = {};
|
|
212
|
+
const relationOptions = { parentNode: this, parentKey: 'params' };
|
|
213
|
+
const ParamWithGroup = (0, decorators_1.getConceptConstructor)('ParamWithGroup');
|
|
214
|
+
let param;
|
|
215
|
+
if (!options) {
|
|
216
|
+
param = ParamWithGroup.from({
|
|
217
|
+
...paramOptions,
|
|
218
|
+
name: this.getParamUniqueName(),
|
|
219
|
+
}, this, 'params');
|
|
220
|
+
}
|
|
221
|
+
else if (typeof options === 'string') {
|
|
222
|
+
param = ParamWithGroup.from({
|
|
223
|
+
...paramOptions,
|
|
224
|
+
name: options,
|
|
225
|
+
}, this, 'params');
|
|
226
|
+
}
|
|
227
|
+
else if (asserts.isParamWithGroup(options)) {
|
|
228
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
229
|
+
param = options;
|
|
230
|
+
Object.assign(param, relationOptions);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
param = ParamWithGroup.from({
|
|
234
|
+
...paramOptions,
|
|
235
|
+
...options,
|
|
236
|
+
}, this, 'params');
|
|
237
|
+
}
|
|
238
|
+
this.params.splice(index, 0, param);
|
|
239
|
+
return param;
|
|
240
|
+
}
|
|
241
|
+
insertParamAt(options, index) {
|
|
242
|
+
const node = this._insertParamAt(options, index);
|
|
243
|
+
node.create({
|
|
244
|
+
index,
|
|
245
|
+
parentNode: this,
|
|
246
|
+
parentKey: 'params',
|
|
247
|
+
});
|
|
248
|
+
return node;
|
|
249
|
+
}
|
|
250
|
+
_addParam(options) {
|
|
251
|
+
const index = this.params.length;
|
|
252
|
+
return this._insertParamAt(options, index);
|
|
253
|
+
}
|
|
254
|
+
addParam(options) {
|
|
255
|
+
const node = this._addParam(options);
|
|
256
|
+
const index = this.params.indexOf(node);
|
|
257
|
+
node.create({
|
|
258
|
+
index,
|
|
259
|
+
parentNode: this,
|
|
260
|
+
parentKey: 'params',
|
|
261
|
+
});
|
|
262
|
+
return node;
|
|
263
|
+
}
|
|
264
|
+
getVariableUniqueName(name = 'variable1') {
|
|
265
|
+
return utils.unique(name, this.getVarExistingNames(), undefined, false);
|
|
266
|
+
}
|
|
267
|
+
_insertVariableAt(options, index) {
|
|
268
|
+
const variableOptions = {};
|
|
269
|
+
const relationOptions = { parentNode: this, parentKey: 'variables' };
|
|
270
|
+
const Variable = (0, decorators_1.getConceptConstructor)('Variable');
|
|
271
|
+
let variable;
|
|
272
|
+
if (!options) {
|
|
273
|
+
variable = Variable.from({
|
|
274
|
+
...variableOptions,
|
|
275
|
+
name: this.getVariableUniqueName(),
|
|
276
|
+
}, this, 'variables');
|
|
277
|
+
}
|
|
278
|
+
else if (typeof options === 'string') {
|
|
279
|
+
variable = Variable.from({
|
|
280
|
+
...variableOptions,
|
|
281
|
+
name: options,
|
|
282
|
+
}, this, 'variables');
|
|
283
|
+
}
|
|
284
|
+
else if (asserts.isVariable(options)) {
|
|
285
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
286
|
+
variable = options;
|
|
287
|
+
Object.assign(variable, relationOptions);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
variable = Variable.from({
|
|
291
|
+
...variableOptions,
|
|
292
|
+
...options,
|
|
293
|
+
}, this, 'variables');
|
|
294
|
+
}
|
|
295
|
+
this.variables.splice(index, 0, variable);
|
|
296
|
+
return variable;
|
|
297
|
+
}
|
|
298
|
+
insertVariableAt(options, index) {
|
|
299
|
+
const node = this._insertVariableAt(options, index);
|
|
300
|
+
node.create({
|
|
301
|
+
index,
|
|
302
|
+
parentNode: this,
|
|
303
|
+
parentKey: 'variables',
|
|
304
|
+
});
|
|
305
|
+
return node;
|
|
306
|
+
}
|
|
307
|
+
_addVariable(options) {
|
|
308
|
+
const index = this.variables.length;
|
|
309
|
+
return this._insertVariableAt(options, index);
|
|
310
|
+
}
|
|
311
|
+
addVariable(options) {
|
|
312
|
+
const node = this._addVariable(options);
|
|
313
|
+
const index = this.variables.indexOf(node);
|
|
314
|
+
node.create({
|
|
315
|
+
index,
|
|
316
|
+
parentNode: this,
|
|
317
|
+
parentKey: 'variables',
|
|
318
|
+
});
|
|
319
|
+
return node;
|
|
320
|
+
}
|
|
321
|
+
getBindEventExistingNames(excludedList = []) {
|
|
322
|
+
const excludedSet = new Set(excludedList);
|
|
323
|
+
return (this.bindEvents || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
324
|
+
}
|
|
325
|
+
getBindEventUniqueName(name = 'bindEvent1') {
|
|
326
|
+
return utils.unique(name, this.getBindEventExistingNames(), undefined, false);
|
|
327
|
+
}
|
|
328
|
+
_insertBindEventAt(options, index) {
|
|
329
|
+
const bindEventOptions = {};
|
|
330
|
+
const relationOptions = { parentNode: this, parentKey: 'bindEvents' };
|
|
331
|
+
const BindEvent = (0, decorators_1.getConceptConstructor)('BindEvent');
|
|
332
|
+
let bindEvent;
|
|
333
|
+
if (!options) {
|
|
334
|
+
bindEvent = BindEvent.from({
|
|
335
|
+
...bindEventOptions,
|
|
336
|
+
name: this.getBindEventUniqueName(),
|
|
337
|
+
}, this, 'bindEvents');
|
|
338
|
+
}
|
|
339
|
+
else if (typeof options === 'string') {
|
|
340
|
+
bindEvent = BindEvent.from({
|
|
341
|
+
...bindEventOptions,
|
|
342
|
+
name: options,
|
|
343
|
+
}, this, 'bindEvents');
|
|
344
|
+
}
|
|
345
|
+
else if (asserts.isBindEvent(options)) {
|
|
346
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
347
|
+
bindEvent = options;
|
|
348
|
+
Object.assign(bindEvent, relationOptions);
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
bindEvent = BindEvent.from({
|
|
352
|
+
...bindEventOptions,
|
|
353
|
+
...options,
|
|
354
|
+
}, this, 'bindEvents');
|
|
355
|
+
}
|
|
356
|
+
this.bindEvents.splice(index, 0, bindEvent);
|
|
357
|
+
return bindEvent;
|
|
358
|
+
}
|
|
359
|
+
insertBindEventAt(options, index) {
|
|
360
|
+
const node = this._insertBindEventAt(options, index);
|
|
361
|
+
node.create({
|
|
362
|
+
index,
|
|
363
|
+
parentNode: this,
|
|
364
|
+
parentKey: 'bindEvents',
|
|
365
|
+
});
|
|
366
|
+
return node;
|
|
367
|
+
}
|
|
368
|
+
_addBindEvent(options) {
|
|
369
|
+
const index = this.bindEvents.length;
|
|
370
|
+
return this._insertBindEventAt(options, index);
|
|
371
|
+
}
|
|
372
|
+
addBindEvent(options) {
|
|
373
|
+
const node = this._addBindEvent(options);
|
|
374
|
+
const index = this.bindEvents.indexOf(node);
|
|
375
|
+
node.create({
|
|
376
|
+
index,
|
|
377
|
+
parentNode: this,
|
|
378
|
+
parentKey: 'bindEvents',
|
|
379
|
+
});
|
|
380
|
+
return node;
|
|
381
|
+
}
|
|
382
|
+
getLogicUniqueName(name = 'logic1') {
|
|
383
|
+
return utils.unique(name, this.getLogicExistingNames(), undefined, false);
|
|
384
|
+
}
|
|
385
|
+
_insertLogicAt(options, index) {
|
|
386
|
+
const logicOptions = {};
|
|
387
|
+
const relationOptions = { parentNode: this, parentKey: 'logics' };
|
|
388
|
+
const BusinessLogic = (0, decorators_1.getConceptConstructor)('BusinessLogic');
|
|
389
|
+
let logic;
|
|
390
|
+
if (!options) {
|
|
391
|
+
logic = BusinessLogic.from({
|
|
392
|
+
...logicOptions,
|
|
393
|
+
name: this.getLogicUniqueName(),
|
|
394
|
+
}, this, 'logics');
|
|
395
|
+
}
|
|
396
|
+
else if (typeof options === 'string') {
|
|
397
|
+
logic = BusinessLogic.from({
|
|
398
|
+
...logicOptions,
|
|
399
|
+
name: options,
|
|
400
|
+
}, this, 'logics');
|
|
401
|
+
}
|
|
402
|
+
else if (asserts.isBusinessLogic(options)) {
|
|
403
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
404
|
+
logic = options;
|
|
405
|
+
Object.assign(logic, relationOptions);
|
|
406
|
+
}
|
|
407
|
+
else {
|
|
408
|
+
logic = BusinessLogic.from({
|
|
409
|
+
...logicOptions,
|
|
410
|
+
...options,
|
|
411
|
+
}, this, 'logics');
|
|
412
|
+
}
|
|
413
|
+
this.logics.splice(index, 0, logic);
|
|
414
|
+
return logic;
|
|
415
|
+
}
|
|
416
|
+
insertLogicAt(options, index) {
|
|
417
|
+
const node = this._insertLogicAt(options, index);
|
|
418
|
+
node.create({
|
|
419
|
+
index,
|
|
420
|
+
parentNode: this,
|
|
421
|
+
parentKey: 'logics',
|
|
422
|
+
});
|
|
423
|
+
return node;
|
|
424
|
+
}
|
|
425
|
+
_addLogic(options) {
|
|
426
|
+
const index = this.logics.length;
|
|
427
|
+
return this._insertLogicAt(options, index);
|
|
428
|
+
}
|
|
429
|
+
addLogic(options) {
|
|
430
|
+
const node = this._addLogic(options);
|
|
431
|
+
const index = this.logics.indexOf(node);
|
|
432
|
+
node.create({
|
|
433
|
+
index,
|
|
434
|
+
parentNode: this,
|
|
435
|
+
parentKey: 'logics',
|
|
436
|
+
});
|
|
437
|
+
return node;
|
|
438
|
+
}
|
|
439
|
+
_insertViewElementAt(options, index) {
|
|
440
|
+
const viewElementOptions = {};
|
|
441
|
+
const relationOptions = { parentNode: this, parentKey: 'elements' };
|
|
442
|
+
const ViewElement = (0, decorators_1.getConceptConstructor)('ViewElement');
|
|
443
|
+
let viewElement;
|
|
444
|
+
if (!options) {
|
|
445
|
+
viewElement = ViewElement.from({
|
|
446
|
+
...viewElementOptions,
|
|
447
|
+
name: this.getViewElementUniqueName(),
|
|
448
|
+
}, this, 'elements');
|
|
449
|
+
}
|
|
450
|
+
else if (typeof options === 'string') {
|
|
451
|
+
viewElement = ViewElement.from({
|
|
452
|
+
...viewElementOptions,
|
|
453
|
+
name: options,
|
|
454
|
+
}, this, 'elements');
|
|
455
|
+
}
|
|
456
|
+
else if (asserts.isViewElement(options)) {
|
|
457
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
458
|
+
viewElement = options;
|
|
459
|
+
Object.assign(viewElement, relationOptions);
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
viewElement = ViewElement.from({
|
|
463
|
+
...viewElementOptions,
|
|
464
|
+
...options,
|
|
465
|
+
}, this, 'elements');
|
|
466
|
+
}
|
|
467
|
+
this.elements.splice(index, 0, viewElement);
|
|
468
|
+
return viewElement;
|
|
469
|
+
}
|
|
470
|
+
insertViewElementAt(options, index) {
|
|
471
|
+
const node = this._insertViewElementAt(options, index);
|
|
472
|
+
node.create({
|
|
473
|
+
index,
|
|
474
|
+
parentNode: this,
|
|
475
|
+
parentKey: 'elements',
|
|
476
|
+
});
|
|
477
|
+
return node;
|
|
478
|
+
}
|
|
479
|
+
_addViewElement(options) {
|
|
480
|
+
const index = this.elements.length;
|
|
481
|
+
return this._insertViewElementAt(options, index);
|
|
482
|
+
}
|
|
483
|
+
addViewElement(options) {
|
|
484
|
+
const node = this._addViewElement(options);
|
|
485
|
+
const index = this.elements.indexOf(node);
|
|
486
|
+
node.create({
|
|
487
|
+
index,
|
|
488
|
+
parentNode: this,
|
|
489
|
+
parentKey: 'elements',
|
|
490
|
+
});
|
|
491
|
+
return node;
|
|
492
|
+
}
|
|
493
|
+
removeEvent(options) {
|
|
494
|
+
let event;
|
|
495
|
+
if (typeof options === 'string') {
|
|
496
|
+
event = this.events.find((item) => item.name === options);
|
|
497
|
+
if (!event) {
|
|
498
|
+
throw new Error('找不到组件事件 ' + options);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
event = options;
|
|
503
|
+
}
|
|
504
|
+
return event.delete();
|
|
505
|
+
}
|
|
506
|
+
removeParam(options) {
|
|
507
|
+
let param;
|
|
508
|
+
if (typeof options === 'string') {
|
|
509
|
+
param = this.params.find((item) => item.name === options);
|
|
510
|
+
if (!param) {
|
|
511
|
+
throw new Error('找不到带分组的参数 ' + options);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
param = options;
|
|
516
|
+
}
|
|
517
|
+
return param.delete();
|
|
518
|
+
}
|
|
519
|
+
removeVariable(options) {
|
|
520
|
+
let variable;
|
|
521
|
+
if (typeof options === 'string') {
|
|
522
|
+
variable = this.variables.find((item) => item.name === options);
|
|
523
|
+
if (!variable) {
|
|
524
|
+
throw new Error('找不到变量 ' + options);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
variable = options;
|
|
529
|
+
}
|
|
530
|
+
return variable.delete();
|
|
531
|
+
}
|
|
532
|
+
removeBindEvent(options) {
|
|
533
|
+
let bindEvent;
|
|
534
|
+
if (typeof options === 'string') {
|
|
535
|
+
bindEvent = this.bindEvents.find((item) => item.name === options);
|
|
536
|
+
if (!bindEvent) {
|
|
537
|
+
throw new Error('找不到元素绑定事件 ' + options);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
else {
|
|
541
|
+
bindEvent = options;
|
|
542
|
+
}
|
|
543
|
+
return bindEvent.delete();
|
|
544
|
+
}
|
|
545
|
+
removeLogic(options) {
|
|
546
|
+
let logic;
|
|
547
|
+
if (typeof options === 'string') {
|
|
548
|
+
logic = this.logics.find((item) => item.name === options);
|
|
549
|
+
if (!logic) {
|
|
550
|
+
throw new Error('找不到业务组件逻辑 ' + options);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
else {
|
|
554
|
+
logic = options;
|
|
555
|
+
}
|
|
556
|
+
return logic.delete();
|
|
557
|
+
}
|
|
558
|
+
removeViewElement(options) {
|
|
559
|
+
let viewElement;
|
|
560
|
+
if (typeof options === 'string') {
|
|
561
|
+
viewElement = this.elements.find((item) => item.name === options);
|
|
562
|
+
if (!viewElement) {
|
|
563
|
+
throw new Error('找不到页面元素 ' + options);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
else {
|
|
567
|
+
viewElement = options;
|
|
568
|
+
}
|
|
569
|
+
return viewElement.delete();
|
|
570
|
+
}
|
|
571
|
+
//================================================================================
|
|
572
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
573
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
574
|
+
//================================================================================
|
|
575
|
+
getLogicExistingNames(excludedList = []) {
|
|
576
|
+
const excludedSet = new Set(excludedList);
|
|
577
|
+
const varList = [];
|
|
578
|
+
if (Array.isArray(this.params)) {
|
|
579
|
+
varList.push(...this.params);
|
|
580
|
+
}
|
|
581
|
+
if (Array.isArray(this.variables)) {
|
|
582
|
+
varList.push(...this.variables);
|
|
583
|
+
}
|
|
584
|
+
if (Array.isArray(this.logics)) {
|
|
585
|
+
varList.push(...this.logics);
|
|
586
|
+
}
|
|
587
|
+
if (Array.isArray(this.bindEvents)) {
|
|
588
|
+
this.bindEvents.forEach((bindEvent) => {
|
|
589
|
+
if (Array.isArray(bindEvent.logics)) {
|
|
590
|
+
varList.push(...bindEvent.logics);
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
return varList.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
595
|
+
}
|
|
596
|
+
static getDefaultOptions() {
|
|
597
|
+
return {
|
|
598
|
+
title: '业务组件',
|
|
599
|
+
icon: 'default',
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
getNamespace() {
|
|
603
|
+
if (this.parentNode && this.parentNode.getNamespace) {
|
|
604
|
+
const parentNamespace = this.parentNode.getNamespace();
|
|
605
|
+
const parentName = this.parentNode.name;
|
|
606
|
+
const arr = [parentNamespace];
|
|
607
|
+
if (this.parentNode.concept !== 'App' && parentName) {
|
|
608
|
+
arr.push(parentName);
|
|
609
|
+
}
|
|
610
|
+
return `${arr.join('.')}.businessComponents`;
|
|
611
|
+
}
|
|
612
|
+
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
613
|
+
}
|
|
614
|
+
getTsNamespace() {
|
|
615
|
+
const parentNodeNamespace = this.getNamespace();
|
|
616
|
+
let tsCalleeNamespace = parentNodeNamespace.replace(/\.[0-9]/g, (m) => m.replace('.', '.$'));
|
|
617
|
+
tsCalleeNamespace = tsCalleeNamespace.replace(/-/g, '_');
|
|
618
|
+
return tsCalleeNamespace;
|
|
619
|
+
}
|
|
620
|
+
getElementLogicRoot() {
|
|
621
|
+
const Param = (0, decorators_1.getConceptConstructor)('Param');
|
|
622
|
+
const logics = [];
|
|
623
|
+
// 页面上的绑定的事件
|
|
624
|
+
this.bindEvents.forEach((bindEvent) => {
|
|
625
|
+
bindEvent.logics.forEach((logic) => {
|
|
626
|
+
// 键盘事件
|
|
627
|
+
if (['keydown', 'keyup'].includes(bindEvent.name)) {
|
|
628
|
+
logic.virtualParams = [
|
|
629
|
+
Param.from({
|
|
630
|
+
name: 'event',
|
|
631
|
+
typeAnnotation: null,
|
|
632
|
+
}, logic, 'virtualParams'),
|
|
633
|
+
];
|
|
634
|
+
}
|
|
635
|
+
// 生命周期没有event
|
|
636
|
+
logics.push(logic);
|
|
637
|
+
});
|
|
638
|
+
});
|
|
639
|
+
this.elements.forEach((item) => {
|
|
640
|
+
utils.traverse((current) => {
|
|
641
|
+
current.node.bindEvents.forEach((bindEvent) => {
|
|
642
|
+
bindEvent.logics.forEach((logic) => {
|
|
643
|
+
if (logic.name.startsWith('__')) {
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
// 绑定参数才有 event 的 current
|
|
647
|
+
logic.virtualParams = bindEvent.getContextRenderLogicParams(logic);
|
|
648
|
+
logics.push(logic);
|
|
649
|
+
});
|
|
650
|
+
});
|
|
651
|
+
}, { node: item });
|
|
652
|
+
});
|
|
653
|
+
if (logics.length) {
|
|
654
|
+
const expanded = (this.elementLogicRoot.length && this.elementLogicRoot[0].expanded) || false;
|
|
655
|
+
this.elementLogicRoot = [
|
|
656
|
+
{
|
|
657
|
+
concept: 'elementLogicRoot',
|
|
658
|
+
expanded,
|
|
659
|
+
children: logics,
|
|
660
|
+
},
|
|
661
|
+
];
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
this.elementLogicRoot = [];
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
getVarExistingNames(excludedList = []) {
|
|
668
|
+
const excludedSet = new Set(excludedList);
|
|
669
|
+
const varList = [];
|
|
670
|
+
if (Array.isArray(this.params)) {
|
|
671
|
+
varList.push(...this.params);
|
|
672
|
+
}
|
|
673
|
+
if (Array.isArray(this.variables)) {
|
|
674
|
+
varList.push(...this.variables);
|
|
675
|
+
}
|
|
676
|
+
if (Array.isArray(this.logics)) {
|
|
677
|
+
this.logics.forEach((logic) => {
|
|
678
|
+
varList.push(logic);
|
|
679
|
+
if (Array.isArray(logic.params)) {
|
|
680
|
+
varList.push(...logic.params);
|
|
681
|
+
}
|
|
682
|
+
if (Array.isArray(logic.returns)) {
|
|
683
|
+
varList.push(...logic.returns);
|
|
684
|
+
}
|
|
685
|
+
if (Array.isArray(logic.variables)) {
|
|
686
|
+
varList.push(...logic.variables);
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
// 事件逻辑的变量不允许和页面逻辑下的重复
|
|
691
|
+
if (Array.isArray(this.elementLogicRoot) && this.elementLogicRoot.length) {
|
|
692
|
+
this.elementLogicRoot[0]?.children.forEach((logic) => {
|
|
693
|
+
if (Array.isArray(logic.variables)) {
|
|
694
|
+
varList.push(...logic.variables);
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
return varList.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
699
|
+
}
|
|
700
|
+
// 收集已经存在的ViewElement
|
|
701
|
+
collectExistingViewElementName(excludedList = []) {
|
|
702
|
+
const excludedSet = new Set(excludedList);
|
|
703
|
+
this.elements.forEach((element) => {
|
|
704
|
+
utils.traverse(({ node }) => {
|
|
705
|
+
if (!excludedSet.has(node)) {
|
|
706
|
+
this.existingViewElement.add(node.name);
|
|
707
|
+
}
|
|
708
|
+
}, {
|
|
709
|
+
node: element,
|
|
710
|
+
});
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
collectExistingBusinessComponent() {
|
|
714
|
+
const excludedSet = new Set();
|
|
715
|
+
// 先把自身加进去
|
|
716
|
+
excludedSet.add(this);
|
|
717
|
+
this.elements.forEach((element) => {
|
|
718
|
+
const set = element.collectExistingBusinessComponent();
|
|
719
|
+
if (set.size) {
|
|
720
|
+
set.forEach((value) => {
|
|
721
|
+
if (!excludedSet.has(value)) {
|
|
722
|
+
excludedSet.add(value);
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
return excludedSet;
|
|
728
|
+
}
|
|
729
|
+
// 获取当前业务组件的所有组件的名字
|
|
730
|
+
getViewElementExistingNames(excludedList = []) {
|
|
731
|
+
if (!this.existingViewElement.size) {
|
|
732
|
+
this.collectExistingViewElementName();
|
|
733
|
+
}
|
|
734
|
+
return Array.from(this.existingViewElement);
|
|
735
|
+
}
|
|
736
|
+
getViewElementUniqueNameOld(name = 'viewElement1') {
|
|
737
|
+
this.collectExistingViewElementName();
|
|
738
|
+
const viewElementUniqueName = utils.unique(name, this.existingViewElement);
|
|
739
|
+
this.existingViewElement.add(viewElementUniqueName);
|
|
740
|
+
return viewElementUniqueName;
|
|
741
|
+
}
|
|
742
|
+
getViewElementUniqueName(name = 'viewElement_1') {
|
|
743
|
+
this.collectExistingViewElementName();
|
|
744
|
+
const BranchCopyUniCode = getBranchCopyUniCode();
|
|
745
|
+
let newName = name;
|
|
746
|
+
const prefix = name.replace(/\d*$/, '');
|
|
747
|
+
if (BranchCopyUniCode && prefix.indexOf(`_${BranchCopyUniCode}_`) === -1) {
|
|
748
|
+
newName = name.replace(/\d*$/, (m) => `_${BranchCopyUniCode}_${m}`);
|
|
749
|
+
}
|
|
750
|
+
// 主分支无 BranchCopyUniCode
|
|
751
|
+
if (!BranchCopyUniCode && prefix.slice(-1) !== '_') {
|
|
752
|
+
newName = name.replace(/\d*$/, (m) => `_${m}`);
|
|
753
|
+
}
|
|
754
|
+
const newPrefix = newName.replace(/\d*$/, '');
|
|
755
|
+
const newPrefixNum = removedViewElementCache?.[newPrefix] ? removedViewElementCache[newPrefix] : 1;
|
|
756
|
+
const startNum = newPrefixNum < Number.MAX_SAFE_INTEGER ? newPrefixNum + 1 : BigInt(newPrefixNum) + BigInt(1);
|
|
757
|
+
const viewElementUniqueName = utils.uniqueMax(newName, this.existingViewElement, removedViewElementCache?.[newPrefix] ? startNum : newPrefixNum);
|
|
758
|
+
this.existingViewElement.add(viewElementUniqueName);
|
|
759
|
+
return viewElementUniqueName;
|
|
760
|
+
}
|
|
761
|
+
getViewElementByName(name) {
|
|
762
|
+
let res = null;
|
|
763
|
+
for (let i = 0; i < (this.elements || []).length; i += 1) {
|
|
764
|
+
const element = this.elements[i];
|
|
765
|
+
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
|
766
|
+
utils.traverse(({ node }) => {
|
|
767
|
+
if (node.concept === 'ViewElement' && node.name === name) {
|
|
768
|
+
res = node;
|
|
769
|
+
}
|
|
770
|
+
}, {
|
|
771
|
+
node: element,
|
|
772
|
+
});
|
|
773
|
+
if (res) {
|
|
774
|
+
break;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
return res;
|
|
778
|
+
}
|
|
779
|
+
// 获取当前element,铺平
|
|
780
|
+
elementsMethods(elements, allMethods, parentNodeNames) {
|
|
781
|
+
if (elements) {
|
|
782
|
+
elements.forEach((item) => {
|
|
783
|
+
const { bindAttrs = [], name } = item;
|
|
784
|
+
const isDataSource = bindAttrs.some((attr) => attr.name === 'dataSource');
|
|
785
|
+
const isInclude = parentNodeNames.includes(name);
|
|
786
|
+
allMethods.push(item);
|
|
787
|
+
if (item.children) {
|
|
788
|
+
if (isDataSource) {
|
|
789
|
+
if (isInclude) {
|
|
790
|
+
this.elementsMethods(item.children, allMethods, parentNodeNames);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
else {
|
|
794
|
+
this.elementsMethods(item.children, allMethods, parentNodeNames);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
mergeBlock({ code, nodePath, position, slotTarget, cb, }) {
|
|
801
|
+
const ViewElement = (0, decorators_1.getConceptConstructor)('ViewElement');
|
|
802
|
+
const Logic = (0, decorators_1.getConceptConstructor)('Logic');
|
|
803
|
+
const ParamWithGroup = (0, decorators_1.getConceptConstructor)('ParamWithGroup');
|
|
804
|
+
const Variable = (0, decorators_1.getConceptConstructor)('Variable');
|
|
805
|
+
const BindEvent = (0, decorators_1.getConceptConstructor)('BindEvent');
|
|
806
|
+
const Structure = (0, decorators_1.getConceptConstructor)('Structure');
|
|
807
|
+
let template = utils.sliceTagContent(code, 'template');
|
|
808
|
+
if (slotTarget) {
|
|
809
|
+
template = `<template #${slotTarget}>${template}</template>`;
|
|
810
|
+
}
|
|
811
|
+
let targetNode = this.getAncestor('App')?.findNodeByPath(nodePath);
|
|
812
|
+
let parentNode = position === 'append' ? targetNode : targetNode.parentNode;
|
|
813
|
+
const definitionStr = utils.sliceTagContent(code, 'definition') || '{}';
|
|
814
|
+
const definition = JSON.parse(definitionStr);
|
|
815
|
+
let node = null;
|
|
816
|
+
if (template) {
|
|
817
|
+
node = ViewElement.fromHTML(template, {
|
|
818
|
+
view: this,
|
|
819
|
+
definition,
|
|
820
|
+
});
|
|
821
|
+
if (!parentNode) {
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
824
|
+
if (position === 'append') {
|
|
825
|
+
parentNode.addViewElement(node);
|
|
826
|
+
cb && cb(parentNode, node);
|
|
827
|
+
}
|
|
828
|
+
else {
|
|
829
|
+
const index = targetNode.getIndexOfParent();
|
|
830
|
+
if (position === 'insertBefore') {
|
|
831
|
+
parentNode.insertViewElementAt(node, index);
|
|
832
|
+
}
|
|
833
|
+
else if (position === 'insertAfter') {
|
|
834
|
+
parentNode.insertViewElementAt(node, index + 1);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
// 服务端逻辑
|
|
839
|
+
if (Array.isArray(definition.logics)) {
|
|
840
|
+
definition.logics.forEach((logicOption) => {
|
|
841
|
+
const logic = Logic.from({
|
|
842
|
+
...logicOption,
|
|
843
|
+
}, this.rootNode, 'logics');
|
|
844
|
+
this.rootNode.addLogic(logic);
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
// 全局结构体
|
|
848
|
+
if (Array.isArray(definition.structures)) {
|
|
849
|
+
definition.structures.forEach((structureOption) => {
|
|
850
|
+
const structure = Structure.from({
|
|
851
|
+
...structureOption,
|
|
852
|
+
}, this.rootNode, 'structures');
|
|
853
|
+
this.rootNode.addStructure(structure);
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
// 页面入参
|
|
857
|
+
if (Array.isArray(definition.viewParams)) {
|
|
858
|
+
definition.viewParams.forEach((paramsOption) => {
|
|
859
|
+
const param = ParamWithGroup.from({
|
|
860
|
+
...paramsOption,
|
|
861
|
+
}, this, 'params');
|
|
862
|
+
this._addParam(param);
|
|
863
|
+
param.addParamsPrepare();
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
// 页面变量
|
|
867
|
+
if (Array.isArray(definition.viewVariables)) {
|
|
868
|
+
definition.viewVariables.forEach((variableOption) => {
|
|
869
|
+
const variable = Variable.from({
|
|
870
|
+
...variableOption,
|
|
871
|
+
}, this, 'variables');
|
|
872
|
+
this.addVariable(variable);
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
// 页面事件
|
|
876
|
+
if (Array.isArray(definition.viewBindEvents)) {
|
|
877
|
+
definition.viewBindEvents.forEach((eventOption) => {
|
|
878
|
+
const newLogic = definition.viewLogics.find((logic) => eventOption.calleeName === logic.name);
|
|
879
|
+
const bindEvent = this.bindEvents.find((currentEventItem) => currentEventItem.name === eventOption.name);
|
|
880
|
+
// 如果没有event对象就先新增一个,如果已经有了就在内部添加logic
|
|
881
|
+
if (!bindEvent) {
|
|
882
|
+
const event = BindEvent.from({
|
|
883
|
+
...eventOption,
|
|
884
|
+
calleeName: '',
|
|
885
|
+
logics: [newLogic],
|
|
886
|
+
}, this, 'bindEvents');
|
|
887
|
+
this.addBindEvent(event);
|
|
888
|
+
}
|
|
889
|
+
else {
|
|
890
|
+
bindEvent.addLogic(newLogic);
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
return node;
|
|
895
|
+
}
|
|
896
|
+
onChange($event) {
|
|
897
|
+
this.emit('change', $event);
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* 转换成设计器中使用的 Vue template 内容
|
|
901
|
+
* @param options
|
|
902
|
+
*/
|
|
903
|
+
genDesignerVueTemplate(options) {
|
|
904
|
+
return this.elements
|
|
905
|
+
.map((element) => `${element.toDesignerVue({
|
|
906
|
+
isRoot: true,
|
|
907
|
+
asCompontent: options?.asCompontent,
|
|
908
|
+
})}\n`)
|
|
909
|
+
.join('');
|
|
910
|
+
}
|
|
911
|
+
get frontendType() {
|
|
912
|
+
return this.getAncestor('FrontendType');
|
|
913
|
+
}
|
|
914
|
+
get path() {
|
|
915
|
+
return `/${this.frontendType?.kind}/${this.name}`;
|
|
916
|
+
}
|
|
917
|
+
get slotElems() {
|
|
918
|
+
const slotElems = [];
|
|
919
|
+
this.elements.forEach((element) => {
|
|
920
|
+
utils.traverse(({ node }) => {
|
|
921
|
+
if (node.tag === 'slot') {
|
|
922
|
+
slotElems.push(node);
|
|
923
|
+
}
|
|
924
|
+
}, {
|
|
925
|
+
node: element,
|
|
926
|
+
});
|
|
927
|
+
});
|
|
928
|
+
return slotElems;
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* 转换成 Vue 文件
|
|
932
|
+
*/
|
|
933
|
+
toVue(options) {
|
|
934
|
+
let result = '';
|
|
935
|
+
result += `<template>\n${this.genVueTemplate(options)}\n</template>\n`;
|
|
936
|
+
result += `<script>\n${this.genScript()}\n</script>\n`;
|
|
937
|
+
return result;
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* 生成宿主语言的文件路径
|
|
941
|
+
* @param name 一般不用传,用于 rename
|
|
942
|
+
*/
|
|
943
|
+
getEmbeddedFilePath(name = this.name) {
|
|
944
|
+
return `/embedded/${this.rootNode?.name || this.parentNode.name}/frontendTypes/${this.getAncestor('FrontendType')?.name}/businessComponents/${name}.ts`;
|
|
945
|
+
}
|
|
946
|
+
*toEmbeddedTSFile() {
|
|
947
|
+
let code = `namespace ${this.getTsNamespace()} {\n`;
|
|
948
|
+
const state = (0, nasl_translator_1.createCompilerState)(code, {
|
|
949
|
+
tabSize: 1,
|
|
950
|
+
});
|
|
951
|
+
try {
|
|
952
|
+
code += yield* this.toEmbeddedTS(state);
|
|
953
|
+
}
|
|
954
|
+
catch (err) {
|
|
955
|
+
code += '';
|
|
956
|
+
console.log(err);
|
|
957
|
+
}
|
|
958
|
+
code += '}\n';
|
|
959
|
+
return {
|
|
960
|
+
code,
|
|
961
|
+
filePath: this.getEmbeddedFilePath(),
|
|
962
|
+
sourceMap: state.sourceMap,
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
getAncestorViewElementsWithDataSource(logic) {
|
|
966
|
+
let element = logic;
|
|
967
|
+
const viewElements = [];
|
|
968
|
+
while (element) {
|
|
969
|
+
if (element.concept &&
|
|
970
|
+
element.concept === 'ViewElement' &&
|
|
971
|
+
element.bindAttrs.find((bAttr) => bAttr.name === 'dataSource')) {
|
|
972
|
+
viewElements.push(element);
|
|
973
|
+
}
|
|
974
|
+
element = element.parentNode;
|
|
975
|
+
}
|
|
976
|
+
return viewElements;
|
|
977
|
+
}
|
|
978
|
+
*handleCurrentItemCode(code, logic) {
|
|
979
|
+
const viewElementsWithDataSource = this.getAncestorViewElementsWithDataSource(logic);
|
|
980
|
+
yield* (0, utils_1.wrapForEachToGenerator)(viewElementsWithDataSource, function* wrapForEach(viewElement, index) {
|
|
981
|
+
const currentIndex = viewElementsWithDataSource.length - 1 - index;
|
|
982
|
+
const currentItemCode = `current${currentIndex === 0 ? '' : currentIndex}.item`;
|
|
983
|
+
if (code.includes(currentItemCode)) {
|
|
984
|
+
const dataSource = viewElement.bindAttrs.find((bAttr) => bAttr.name === 'dataSource');
|
|
985
|
+
if (dataSource) {
|
|
986
|
+
const businessComponent = viewElement.getAncestor('BusinessComponent');
|
|
987
|
+
const dataSourceTS = yield* dataSource.expression.toEmbeddedTS();
|
|
988
|
+
const logic = businessComponent.logics.find((logic) => logic.name === dataSourceTS);
|
|
989
|
+
if (logic) {
|
|
990
|
+
code = code.replaceAll(currentItemCode, `nasl.ui.getCurrentItemType(${dataSourceTS}(${logic.params.map(() => 'null').join(',')}))`);
|
|
991
|
+
}
|
|
992
|
+
else {
|
|
993
|
+
const variable = businessComponent.variables.find((variable) => variable.name === dataSourceTS);
|
|
994
|
+
code = code.replaceAll(currentItemCode, `nasl.ui.getCurrentItemType(${variable ? variable.name : dataSourceTS})`);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
return code;
|
|
1000
|
+
}
|
|
1001
|
+
removeExistingViewElement(viewElement) {
|
|
1002
|
+
if (this.existingViewElement.has(viewElement.name)) {
|
|
1003
|
+
this.existingViewElement.delete(viewElement.name);
|
|
1004
|
+
}
|
|
1005
|
+
const prefix = viewElement?.name.replace(/\d*$/, '');
|
|
1006
|
+
let lastDigit = viewElement?.name.match(/\d+$/)?.[0];
|
|
1007
|
+
if (lastDigit === undefined)
|
|
1008
|
+
return;
|
|
1009
|
+
//@ts-ignore
|
|
1010
|
+
lastDigit = lastDigit < Number.MAX_SAFE_INTEGER ? parseInt(lastDigit) : BigInt(lastDigit);
|
|
1011
|
+
if (removedViewElementCache?.[prefix]) {
|
|
1012
|
+
//@ts-ignore
|
|
1013
|
+
if (lastDigit > removedViewElementCache[prefix])
|
|
1014
|
+
//@ts-ignore
|
|
1015
|
+
removedViewElementCache[prefix] = lastDigit;
|
|
1016
|
+
}
|
|
1017
|
+
else {
|
|
1018
|
+
//@ts-ignore
|
|
1019
|
+
removedViewElementCache[prefix] = lastDigit;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
*getRightCode(code, assignment, rightNode) {
|
|
1023
|
+
code = code.replaceAll('\n', ' ');
|
|
1024
|
+
const logic = assignment.logic;
|
|
1025
|
+
const logicRtn = logic?.returns[0];
|
|
1026
|
+
// 调用接口,参数替换成 null
|
|
1027
|
+
if (asserts.isCallInterface(rightNode)) {
|
|
1028
|
+
const { _interface } = rightNode.getModuleInterface();
|
|
1029
|
+
return _interface
|
|
1030
|
+
? `${rightNode.tsCalleeKey}(${_interface.params.map(() => 'null').join(',')})`
|
|
1031
|
+
: null;
|
|
1032
|
+
}
|
|
1033
|
+
// 调用服务端逻辑,参数替换成 null
|
|
1034
|
+
if (asserts.isCallLogic(rightNode) && rightNode.calleeNamespace === 'app.logics') {
|
|
1035
|
+
const calleeName = rightNode?.calleeName;
|
|
1036
|
+
const calleeLogic = this.getAncestor('App').logics.find((l) => l.name === calleeName);
|
|
1037
|
+
return calleeLogic ? `app.logics.${calleeName}(${calleeLogic.params.map(() => 'null').join(',')})` : null;
|
|
1038
|
+
}
|
|
1039
|
+
// 调用依赖库逻辑可能会有子逻辑,子逻辑拼接可能有ts忽略先去掉
|
|
1040
|
+
if (asserts.isCallLogic(rightNode) && rightNode.calleeNamespace?.startsWith('extensions.')) {
|
|
1041
|
+
code = code.replaceAll('// @ts-ignore', '');
|
|
1042
|
+
}
|
|
1043
|
+
// view 局部变量,申明提升前增加判断,使用 logic 内的 result 直接替换成对应 logic,logic 内部变量替换成 null
|
|
1044
|
+
if (logicRtn && code.includes(logicRtn.name)) {
|
|
1045
|
+
if (code === logicRtn.name)
|
|
1046
|
+
return `${logic.name}(${logic.params.map(() => 'null').join(',')})`;
|
|
1047
|
+
code = this.handleReplaceCode(code, logicRtn.name, `${logic.name}(${logic.params.map(() => 'null').join(',')})`);
|
|
1048
|
+
logic.params.forEach((param) => {
|
|
1049
|
+
if (code.includes(param.name))
|
|
1050
|
+
code = this.handleReplaceCode(code, param.name, 'null');
|
|
1051
|
+
});
|
|
1052
|
+
logic.variables.forEach((variable) => {
|
|
1053
|
+
if (code.includes(variable.name))
|
|
1054
|
+
code = this.handleReplaceCode(code, variable.name, 'null');
|
|
1055
|
+
});
|
|
1056
|
+
return code;
|
|
1057
|
+
}
|
|
1058
|
+
// 处理 current.item、current1.item 等数据
|
|
1059
|
+
if (/current(\d)*\.item/.test(code)) {
|
|
1060
|
+
code = yield* this.handleCurrentItemCode(code, logic);
|
|
1061
|
+
return code;
|
|
1062
|
+
}
|
|
1063
|
+
// 直接赋值 logic 内局部变量、输入参数直接提示系统无法推断类型
|
|
1064
|
+
const useLogicVar = logic.params.find((param) => code.includes(param.name)) ||
|
|
1065
|
+
logic.variables.find((variable) => code.includes(variable.name));
|
|
1066
|
+
return useLogicVar ? 'null' : code;
|
|
1067
|
+
}
|
|
1068
|
+
handleReplaceCode(code, variable, replaceCode) {
|
|
1069
|
+
return code.replace(/\S+/g, ($1) => {
|
|
1070
|
+
if ($1 === `${variable},`)
|
|
1071
|
+
return `${replaceCode},`;
|
|
1072
|
+
if ($1 === variable)
|
|
1073
|
+
return replaceCode;
|
|
1074
|
+
let fnCode = $1;
|
|
1075
|
+
if ($1.startsWith(`${variable}.`))
|
|
1076
|
+
fnCode = $1.replaceAll(`${variable}.`, `${replaceCode}.`);
|
|
1077
|
+
if ($1.startsWith(`${variable},`))
|
|
1078
|
+
fnCode = $1.replaceAll(`${variable},`, `${replaceCode},`);
|
|
1079
|
+
if ($1.includes(`(${variable},`))
|
|
1080
|
+
fnCode = $1.replaceAll(`(${variable},`, `(${replaceCode},`);
|
|
1081
|
+
if ($1.includes(`(${variable}.`))
|
|
1082
|
+
fnCode = $1.replaceAll(`(${variable}.`, `(${replaceCode}.`);
|
|
1083
|
+
if ($1.includes(`(${variable})`))
|
|
1084
|
+
fnCode = $1.replaceAll(`(${variable})`, `(${replaceCode})`);
|
|
1085
|
+
if ($1.includes(`,${variable},`))
|
|
1086
|
+
fnCode = $1.replaceAll(`,${variable},`, `,${replaceCode},`);
|
|
1087
|
+
if ($1.includes(`,${variable}.`))
|
|
1088
|
+
fnCode = $1.replaceAll(`,${variable}.`, `,${replaceCode}.`);
|
|
1089
|
+
if ($1.includes(`,${variable})`))
|
|
1090
|
+
fnCode = $1.replaceAll(`,${variable})`, `,${replaceCode})`);
|
|
1091
|
+
return fnCode;
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
// 获取当前element,铺平
|
|
1095
|
+
elementsAttrs(elements, componentList, allComponentList, currentIndex) {
|
|
1096
|
+
if (elements) {
|
|
1097
|
+
elements.forEach((item) => {
|
|
1098
|
+
let index = currentIndex ?? -1;
|
|
1099
|
+
if (item.tag === 'template' && item.haveScope()) {
|
|
1100
|
+
index += 1;
|
|
1101
|
+
}
|
|
1102
|
+
if (View__1.ComponentCompletionPropertyMap[item.tag]) {
|
|
1103
|
+
componentList.push(item);
|
|
1104
|
+
}
|
|
1105
|
+
item.currentIndex = index;
|
|
1106
|
+
allComponentList.push(item);
|
|
1107
|
+
if (item.children.length > 0) {
|
|
1108
|
+
this.elementsAttrs(item.children, componentList, allComponentList, index);
|
|
1109
|
+
}
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
*toEmbeddedTS(state = (0, nasl_translator_1.createCompilerState)()) {
|
|
1114
|
+
const self = this;
|
|
1115
|
+
// 获取虚拟logic的参数和内容
|
|
1116
|
+
// 用作展示和tots查找引用
|
|
1117
|
+
self.getElementLogicRoot();
|
|
1118
|
+
/**
|
|
1119
|
+
* 这部分需要先执行
|
|
1120
|
+
**/
|
|
1121
|
+
// elements类型声明定义
|
|
1122
|
+
let code = `interface IElements {\n`;
|
|
1123
|
+
// 生成所有的name和类型定义
|
|
1124
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(element) {
|
|
1125
|
+
code += yield* element.toEmbeddedTSDefinition((0, nasl_translator_1.shiftState)(state, code, {
|
|
1126
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
1127
|
+
}));
|
|
1128
|
+
});
|
|
1129
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}}\n`;
|
|
1130
|
+
code += `let __elements: IElements;\n`;
|
|
1131
|
+
const elementsPathMap = {};
|
|
1132
|
+
// 深度遍历拿到element path
|
|
1133
|
+
if (Array.isArray(self.elements)) {
|
|
1134
|
+
self.elements.forEach((item) => {
|
|
1135
|
+
item.toEmbeddedTSRefPath(elementsPathMap);
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
if (Array.isArray(self.elements)) {
|
|
1139
|
+
// elementsRefTree
|
|
1140
|
+
code += `function elementsRefTree() {\n`;
|
|
1141
|
+
code += `return {\n`;
|
|
1142
|
+
code += `children: {\n`;
|
|
1143
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(item) {
|
|
1144
|
+
code += yield* item.toEmbeddedTSRefTree((0, nasl_translator_1.shiftState)(state, code, { inline: true }), { elementsPathMap });
|
|
1145
|
+
});
|
|
1146
|
+
code += `},\n`;
|
|
1147
|
+
code += `};\n`;
|
|
1148
|
+
code += `};\n`;
|
|
1149
|
+
code += `const __elementsRef = {\n`;
|
|
1150
|
+
for (const key in elementsPathMap) {
|
|
1151
|
+
const pathStr = elementsPathMap[key];
|
|
1152
|
+
const pathArr = pathStr.split('.');
|
|
1153
|
+
const path = pathArr.reduce((prev, cur) => {
|
|
1154
|
+
return `${prev}.children.${cur}()`;
|
|
1155
|
+
}, 'elementsRefTree()');
|
|
1156
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}${key}: ${path},\n`;
|
|
1157
|
+
}
|
|
1158
|
+
code += `};\n`;
|
|
1159
|
+
// code += `${indent((state?.tabSize || 0) + 1)}interface `;
|
|
1160
|
+
// code += `__elements_completionProperty {\n`;
|
|
1161
|
+
// const componentList: Array<ViewElement> = [];
|
|
1162
|
+
// self.elementsAttrs(self.elements, componentList);
|
|
1163
|
+
// const variableList: string[] = [];
|
|
1164
|
+
// yield* wrapForEach(self.elements, function* warpForEachGenerator(item) {
|
|
1165
|
+
// code += yield* item.toEmbeddedTSVariableDefinition(shiftState(state, code, { inline: true }), variableList);
|
|
1166
|
+
// });
|
|
1167
|
+
// code += indent((state?.tabSize || 0) + 1) + `}\n`;
|
|
1168
|
+
// code += indent((state?.tabSize || 0) + 1);
|
|
1169
|
+
// code += `let __elements_completionProperty: __elements_completionProperty;\n`;
|
|
1170
|
+
// code += indent((state?.tabSize || 0) + 1);
|
|
1171
|
+
// code += `let __elements_variable_function = {\n`;
|
|
1172
|
+
// yield* wrapForEach(self.elements, function* warpForEachGenerator(item) {
|
|
1173
|
+
// code += yield* item.toEmbeddedTSVariableFunctionDefinition(shiftState(state, code, { inline: true }));
|
|
1174
|
+
// });
|
|
1175
|
+
// code += indent((state?.tabSize || 0) + 1) + `}\n`;
|
|
1176
|
+
// code += indent((state?.tabSize || 0) + 1);
|
|
1177
|
+
// code += `let __elements_stashFunctionVariable = {\n`;
|
|
1178
|
+
// yield* wrapForEach(variableList, function* warpForEachGenerator(item) {
|
|
1179
|
+
// code += indent((state?.tabSize || 0) + 2);
|
|
1180
|
+
// code += `${item}`;
|
|
1181
|
+
// });
|
|
1182
|
+
// code += indent((state?.tabSize || 0) + 1) + `}\n`;
|
|
1183
|
+
}
|
|
1184
|
+
const advanceMap = new Map();
|
|
1185
|
+
const callFunctionAdvanceMap = new Map();
|
|
1186
|
+
yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
|
|
1187
|
+
if (el &&
|
|
1188
|
+
// 批量赋值
|
|
1189
|
+
(asserts.isBatchAssignment(el) ||
|
|
1190
|
+
// 赋值
|
|
1191
|
+
(asserts.isAssignment(el) && el.left?.name) ||
|
|
1192
|
+
// 内置函数对集合类型的推导
|
|
1193
|
+
(asserts.isCallFunction(el) && el.derivablecollection?.name))) {
|
|
1194
|
+
if (el?.getAncestor('SubLogic')) {
|
|
1195
|
+
return;
|
|
1196
|
+
}
|
|
1197
|
+
if (asserts.isAssignment(el)) {
|
|
1198
|
+
const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && el.left?.name === variable.name);
|
|
1199
|
+
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1200
|
+
advanceMap.set(advanceVar, el);
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
else if (asserts.isCallFunction(el)) {
|
|
1204
|
+
// 需要被推导的集合
|
|
1205
|
+
const expression = el.derivablecollection;
|
|
1206
|
+
const advanceVar = self.variables?.find((variable) => {
|
|
1207
|
+
return !variable.typeAnnotation && expression?.name === variable.name;
|
|
1208
|
+
});
|
|
1209
|
+
if (advanceVar && !callFunctionAdvanceMap.get(advanceVar)) {
|
|
1210
|
+
callFunctionAdvanceMap.set(advanceVar, el);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
else if (asserts.isBatchAssignment(el)) {
|
|
1214
|
+
yield* (0, utils_1.wrapForEachToGenerator)(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
|
|
1215
|
+
const leftCode = leftIndex.length === 1
|
|
1216
|
+
? yield* el.left?.expression?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1217
|
+
(0, utils_1.returnOrigin)('')
|
|
1218
|
+
: yield* el.left?.members[leftIndex[1]]?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1219
|
+
(0, utils_1.returnOrigin)('');
|
|
1220
|
+
const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && leftCode === variable.name);
|
|
1221
|
+
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1222
|
+
advanceMap.set(advanceVar, el);
|
|
1223
|
+
}
|
|
1224
|
+
});
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
});
|
|
1228
|
+
// 用来储存默认值翻译结构是__IDENTIFIER__或者__IDENTIFIER__()的节点
|
|
1229
|
+
const IDENTIFIERMAP = new Set();
|
|
1230
|
+
if (Array.isArray(self.params)) {
|
|
1231
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param) {
|
|
1232
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1233
|
+
code += yield* param.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
|
|
1234
|
+
code += ';\n';
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
if (Array.isArray(self.variables)) {
|
|
1238
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.variables, function* warpForEachGenerator(variable) {
|
|
1239
|
+
const ts = yield* variable.defaultValue?.toEmbeddedTS?.() ?? (0, utils_1.returnOrigin)('');
|
|
1240
|
+
if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
|
|
1241
|
+
IDENTIFIERMAP.add(variable);
|
|
1242
|
+
}
|
|
1243
|
+
if (!advanceMap.get(variable) && !callFunctionAdvanceMap.get(variable)) {
|
|
1244
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1245
|
+
code += yield* variable.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
|
|
1246
|
+
code += ';\n';
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
// 变量提升
|
|
1251
|
+
state.isVariableHost = true;
|
|
1252
|
+
yield* (0, utils_1.wrapIteratorToGenerator)(advanceMap.entries(), function* warpForEachGenerator([variable, assignment]) {
|
|
1253
|
+
// 有默认值的用默认值来推导类型, 但是如果是__IDENTIFIER__或者__IDENTIFIER__(),就不需要默认值来推导了
|
|
1254
|
+
if (variable.defaultValue?.expression && !IDENTIFIERMAP.has(variable)) {
|
|
1255
|
+
code += `let ${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}`;
|
|
1256
|
+
code += yield* variable.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
|
|
1257
|
+
return;
|
|
1258
|
+
}
|
|
1259
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}// @ts-ignore\n`;
|
|
1260
|
+
code += `let ${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}`;
|
|
1261
|
+
code += yield* variable.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
|
|
1262
|
+
code += ' = ';
|
|
1263
|
+
if (asserts.isBatchAssignment(assignment)) {
|
|
1264
|
+
yield* (0, utils_1.wrapForEachToGenerator)(assignment.assignmentLines, function* warpForEachGenerator({ leftIndex, rightIndex }) {
|
|
1265
|
+
const leftCode = leftIndex.length === 1
|
|
1266
|
+
? yield* assignment.left.expression.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }))
|
|
1267
|
+
: yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1268
|
+
(0, utils_1.returnOrigin)('');
|
|
1269
|
+
if (leftCode === variable.name) {
|
|
1270
|
+
const rightNode = rightIndex.length === 1
|
|
1271
|
+
? assignment.rights[rightIndex[0]]?.expression
|
|
1272
|
+
: assignment.rights[rightIndex[0]]?.members[rightIndex[1]];
|
|
1273
|
+
const rightCode = yield* rightNode?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1274
|
+
(0, utils_1.returnOrigin)('');
|
|
1275
|
+
code += yield* self.getRightCode(rightCode, assignment, rightNode);
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1279
|
+
else {
|
|
1280
|
+
let rightCode = '';
|
|
1281
|
+
// 因为右侧枚举要赋值就得new 一下;
|
|
1282
|
+
if (assignment.right &&
|
|
1283
|
+
asserts.isIdentifier(assignment.right) &&
|
|
1284
|
+
assignment.right.namespace &&
|
|
1285
|
+
assignment.right.namespace.endsWith('enums')) {
|
|
1286
|
+
rightCode += 'new ';
|
|
1287
|
+
}
|
|
1288
|
+
rightCode +=
|
|
1289
|
+
assignment.right && assignment.right.toEmbeddedTS
|
|
1290
|
+
? yield* assignment.right.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }))
|
|
1291
|
+
: '__RIGHT__';
|
|
1292
|
+
code += yield* self.getRightCode(rightCode, assignment, assignment.right);
|
|
1293
|
+
}
|
|
1294
|
+
code += ';\n';
|
|
1295
|
+
});
|
|
1296
|
+
yield* (0, utils_1.wrapIteratorToGenerator)(callFunctionAdvanceMap.entries(), function* warpForEachGenerator([node, assignment]) {
|
|
1297
|
+
//
|
|
1298
|
+
if (advanceMap.get(node)) {
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1301
|
+
// 有默认值的用默认值来推导类型, 但是如果是__IDENTIFIER__或者__IDENTIFIER__(),就不需要默认值来推导了
|
|
1302
|
+
if (node.defaultValue?.expression && !IDENTIFIERMAP.has(node)) {
|
|
1303
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1304
|
+
code += yield* node.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
|
|
1305
|
+
return;
|
|
1306
|
+
}
|
|
1307
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}// @ts-ignore\n`;
|
|
1308
|
+
yield* (0, utils_1.wrapForEachToGenerator)([
|
|
1309
|
+
{
|
|
1310
|
+
key: 'key',
|
|
1311
|
+
node: assignment.keyOfCollection,
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
key: 'item',
|
|
1315
|
+
node: assignment.itemOfCollection,
|
|
1316
|
+
},
|
|
1317
|
+
], function* warpForEachGenerator({ key, node: itemNode }) {
|
|
1318
|
+
if (itemNode) {
|
|
1319
|
+
code += `const __${key}_${node?.name} = `;
|
|
1320
|
+
const itemCode = yield* itemNode?.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1321
|
+
(0, utils_1.returnOrigin)('');
|
|
1322
|
+
code += yield* self.getRightCode(itemCode, assignment, itemNode);
|
|
1323
|
+
code += ';\n';
|
|
1324
|
+
}
|
|
1325
|
+
});
|
|
1326
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1327
|
+
code += yield* node.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
|
|
1328
|
+
const nodeName = node?.name;
|
|
1329
|
+
const keyNode = assignment.keyOfCollection;
|
|
1330
|
+
const itemNode = assignment.itemOfCollection;
|
|
1331
|
+
if (assignment.isDerivableMap && keyNode && itemNode) {
|
|
1332
|
+
code += `: nasl.collection.Map<typeof __key_${nodeName}, typeof __item_${nodeName}>`;
|
|
1333
|
+
}
|
|
1334
|
+
else if (assignment.isDerivableList && itemNode) {
|
|
1335
|
+
code += `: nasl.collection.List<typeof __item_${nodeName}>;`;
|
|
1336
|
+
}
|
|
1337
|
+
code += ';\n';
|
|
1338
|
+
});
|
|
1339
|
+
// 变量提升结束
|
|
1340
|
+
delete state.isVariableHost;
|
|
1341
|
+
/* 默认值草稿区 ---------------------------*/
|
|
1342
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}function __playground(){\n`;
|
|
1343
|
+
/* 参数的默认值是__IDENTIFIER__或者__IDENTIFIER__()时不赋默认值,但是需要ts翻译出来进行报错校验 */
|
|
1344
|
+
for (const node of IDENTIFIERMAP.values()) {
|
|
1345
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 2)}`;
|
|
1346
|
+
code += yield* node.defaultValue.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { inline: true }));
|
|
1347
|
+
code += '; ';
|
|
1348
|
+
}
|
|
1349
|
+
code += '\n';
|
|
1350
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 2)}return\n`;
|
|
1351
|
+
function* setPlaygroundCode(arr, name) {
|
|
1352
|
+
if (arr.length) {
|
|
1353
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}/* -----以下是 ${name} 的默认值草稿------ */\n`;
|
|
1354
|
+
}
|
|
1355
|
+
for (const item1 of arr) {
|
|
1356
|
+
for (const item of item1.defaultValue?.playground ?? []) {
|
|
1357
|
+
code += yield* item.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
1358
|
+
code += ';\n';
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
yield* setPlaygroundCode(self.variables, 'variables');
|
|
1363
|
+
yield* setPlaygroundCode(self.params, 'params');
|
|
1364
|
+
code += `${(0, nasl_translator_1.indent)(state?.tabSize || 0)}}\n`;
|
|
1365
|
+
code += `export class ${self.tsName} extends nasl.ui.ViewComponent {\n`;
|
|
1366
|
+
// 需要类型推导的局部变量/返回值需要调整申明顺序
|
|
1367
|
+
code += `constructor(
|
|
1368
|
+
options?: {
|
|
1369
|
+
[propName: string]: any,
|
|
1370
|
+
bindAttr?: {
|
|
1371
|
+
__NASLIF?: nasl.core.Boolean,
|
|
1372
|
+
`;
|
|
1373
|
+
if (Array.isArray(self.params)) {
|
|
1374
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param, index) {
|
|
1375
|
+
code += `${param.name}?: `;
|
|
1376
|
+
code += yield* param.typeAnnotation.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code));
|
|
1377
|
+
code += ',\n';
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
code += `
|
|
1381
|
+
},
|
|
1382
|
+
slotDefault?: () => Array<any>,
|
|
1383
|
+
}) {
|
|
1384
|
+
super();\n`;
|
|
1385
|
+
// 绑定事件
|
|
1386
|
+
if (Array.isArray(self.bindEvents)) {
|
|
1387
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.bindEvents, function* warpForEachGenerator(event) {
|
|
1388
|
+
code += yield* event.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, {
|
|
1389
|
+
tabSize: state?.tabSize || 0,
|
|
1390
|
+
}), true);
|
|
1391
|
+
code += '\n';
|
|
1392
|
+
});
|
|
1393
|
+
}
|
|
1394
|
+
code += `\n}`;
|
|
1395
|
+
// 自定义事件的定义
|
|
1396
|
+
if (Array.isArray(self.events) && self.events.length) {
|
|
1397
|
+
code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1398
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.events, function* warpForEachGenerator(event) {
|
|
1399
|
+
code += yield* event.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, {
|
|
1400
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
1401
|
+
}));
|
|
1402
|
+
code += '\n';
|
|
1403
|
+
});
|
|
1404
|
+
code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1405
|
+
}
|
|
1406
|
+
// 逻辑
|
|
1407
|
+
if (Array.isArray(self.logics) && self.logics.length) {
|
|
1408
|
+
code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1409
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.logics, function* warpForEachGenerator(logic) {
|
|
1410
|
+
code += yield* logic.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, {
|
|
1411
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
1412
|
+
}), 'noExport');
|
|
1413
|
+
code += '\n';
|
|
1414
|
+
code += yield* logic.toInnerEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, {
|
|
1415
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
1416
|
+
}));
|
|
1417
|
+
});
|
|
1418
|
+
code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1419
|
+
}
|
|
1420
|
+
// render函数
|
|
1421
|
+
code += `\n${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}`;
|
|
1422
|
+
code += `__render(`;
|
|
1423
|
+
code += `){\n`;
|
|
1424
|
+
code += (0, nasl_translator_1.indent)(state?.tabSize || 0);
|
|
1425
|
+
// elements 元素
|
|
1426
|
+
if (Array.isArray(self.elements)) {
|
|
1427
|
+
// 生成嵌套式的内容
|
|
1428
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.elements, function* warpForEachGenerator(element) {
|
|
1429
|
+
code += yield* element.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, {
|
|
1430
|
+
tabSize: (state?.tabSize || 0) + 3,
|
|
1431
|
+
}));
|
|
1432
|
+
code += '\n';
|
|
1433
|
+
});
|
|
1434
|
+
}
|
|
1435
|
+
code += `\n${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}}\n`;
|
|
1436
|
+
if (Array.isArray(self.params)) {
|
|
1437
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}$destination(options: {`;
|
|
1438
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param, index) {
|
|
1439
|
+
code += `${param.name}?: `;
|
|
1440
|
+
code += yield* param.typeAnnotation.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code));
|
|
1441
|
+
code += ', ';
|
|
1442
|
+
});
|
|
1443
|
+
// 锚点
|
|
1444
|
+
code += `_anchor?: nasl.core.String`;
|
|
1445
|
+
code += '}){}\n';
|
|
1446
|
+
}
|
|
1447
|
+
code += `${(0, nasl_translator_1.indent)((state?.tabSize || 0) + 1)}}\n`;
|
|
1448
|
+
return code;
|
|
1449
|
+
}
|
|
1450
|
+
*toEmbeddedDeclarationTS(state = (0, nasl_translator_1.createCompilerState)()) {
|
|
1451
|
+
const self = this;
|
|
1452
|
+
let code = `export declare class ${self.tsName} extends nasl.ui.ViewComponent {\n`;
|
|
1453
|
+
// 需要类型推导的局部变量/返回值需要调整申明顺序
|
|
1454
|
+
code += `constructor(
|
|
1455
|
+
options?: {
|
|
1456
|
+
[propName: string]: any,
|
|
1457
|
+
bindAttr?: {
|
|
1458
|
+
__NASLIF?: nasl.core.Boolean,
|
|
1459
|
+
`;
|
|
1460
|
+
if (Array.isArray(self.params)) {
|
|
1461
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param, index) {
|
|
1462
|
+
code += `${param.name}?: `;
|
|
1463
|
+
code += yield* param.typeAnnotation.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code));
|
|
1464
|
+
code += ',\n';
|
|
1465
|
+
});
|
|
1466
|
+
}
|
|
1467
|
+
code += `
|
|
1468
|
+
},
|
|
1469
|
+
slotDefault?: () => Array<any>,
|
|
1470
|
+
});\n`;
|
|
1471
|
+
// 自定义事件的定义
|
|
1472
|
+
if (Array.isArray(self.events) && self.events.length) {
|
|
1473
|
+
code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1474
|
+
yield* (0, utils_1.wrapForEachToGenerator)(self.events, function* warpForEachGenerator(event) {
|
|
1475
|
+
code += yield* event.toEmbeddedTS((0, nasl_translator_1.shiftState)(state, code, {
|
|
1476
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
1477
|
+
}));
|
|
1478
|
+
code += '\n';
|
|
1479
|
+
});
|
|
1480
|
+
code += (0, nasl_translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1481
|
+
}
|
|
1482
|
+
code += '}\n';
|
|
1483
|
+
return code;
|
|
1484
|
+
}
|
|
1485
|
+
toEmbeddedDeclarationTSFile() {
|
|
1486
|
+
let code = `namespace ${this.getTsNamespace()} {\n`;
|
|
1487
|
+
try {
|
|
1488
|
+
code += utils.runGeneratorSync(this.toEmbeddedDeclarationTS((0, nasl_translator_1.createCompilerState)(code, {
|
|
1489
|
+
tabSize: 1,
|
|
1490
|
+
onlyDeclaration: true,
|
|
1491
|
+
})));
|
|
1492
|
+
}
|
|
1493
|
+
catch (err) {
|
|
1494
|
+
code += '';
|
|
1495
|
+
console.log(err);
|
|
1496
|
+
}
|
|
1497
|
+
code += '}\n';
|
|
1498
|
+
return {
|
|
1499
|
+
code,
|
|
1500
|
+
filePath: this.getEmbeddedFilePath(),
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* 转换成 VueOptions
|
|
1505
|
+
* @TODO 后面 template 可以优化成 render 函数
|
|
1506
|
+
*/
|
|
1507
|
+
toVueOptions(options) {
|
|
1508
|
+
return {
|
|
1509
|
+
template: this.genVueTemplate(options),
|
|
1510
|
+
script: this.genScript(),
|
|
1511
|
+
};
|
|
1512
|
+
}
|
|
1513
|
+
genVueTemplate(options) {
|
|
1514
|
+
return this.elements?.map((element) => `${element?.toVue(options)}\n`).join('');
|
|
1515
|
+
}
|
|
1516
|
+
getViewBindEvents() {
|
|
1517
|
+
const bindEvents = [];
|
|
1518
|
+
// 页面上的绑定的事件
|
|
1519
|
+
this.bindEvents.forEach((bindEvent) => {
|
|
1520
|
+
bindEvents.push(bindEvent);
|
|
1521
|
+
});
|
|
1522
|
+
this.elements.forEach((item) => {
|
|
1523
|
+
utils.traverse((current) => {
|
|
1524
|
+
current.node.bindEvents.forEach((bindEvent) => {
|
|
1525
|
+
bindEvents.push(bindEvent);
|
|
1526
|
+
});
|
|
1527
|
+
}, { node: item });
|
|
1528
|
+
});
|
|
1529
|
+
return bindEvents;
|
|
1530
|
+
}
|
|
1531
|
+
// 获取页面上需要替换的表达式
|
|
1532
|
+
getViewExpressions() {
|
|
1533
|
+
const bindExpressions = [];
|
|
1534
|
+
this.elements.forEach((item) => {
|
|
1535
|
+
utils.traverse((current) => {
|
|
1536
|
+
const { node } = current;
|
|
1537
|
+
const playgroundNodePath = (node?.nodePath || '').split('.').find((nodePathNode) => {
|
|
1538
|
+
return nodePathNode.match(/(.+)\[.+\]/)?.[1] === 'playground';
|
|
1539
|
+
});
|
|
1540
|
+
if (!playgroundNodePath) {
|
|
1541
|
+
//// 处理三种情况
|
|
1542
|
+
//if (
|
|
1543
|
+
// ['BindAttribute', 'BindDirective', 'BindStyle'].includes(node.concept)
|
|
1544
|
+
// && node.needReplaceWithIdentifier
|
|
1545
|
+
//) {
|
|
1546
|
+
// bindExpressions.push(node);
|
|
1547
|
+
//}
|
|
1548
|
+
if (node?.concept === 'Match') {
|
|
1549
|
+
bindExpressions.push(node);
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
}, {
|
|
1553
|
+
node: item,
|
|
1554
|
+
}, {
|
|
1555
|
+
mode: 'anyObject',
|
|
1556
|
+
depthFirst: true,
|
|
1557
|
+
excludedKeySet: new Set([
|
|
1558
|
+
'bindEvents',
|
|
1559
|
+
'parentNode',
|
|
1560
|
+
'sourceMap',
|
|
1561
|
+
'storageJSON',
|
|
1562
|
+
'tsErrorDetail',
|
|
1563
|
+
'NaslAnnotatedJSON',
|
|
1564
|
+
'calledFrom',
|
|
1565
|
+
'_events',
|
|
1566
|
+
'_collectingList',
|
|
1567
|
+
'_historyList',
|
|
1568
|
+
]),
|
|
1569
|
+
});
|
|
1570
|
+
});
|
|
1571
|
+
return bindExpressions;
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* 生成 Vue 中需要的 JS 代码
|
|
1575
|
+
* @TODO 这一版先做成 componentOptions 式的,后面再美化
|
|
1576
|
+
*/
|
|
1577
|
+
genScript() {
|
|
1578
|
+
const componentList = [];
|
|
1579
|
+
const allComponentList = [];
|
|
1580
|
+
this.elementsAttrs(this.elements, componentList, allComponentList, -1);
|
|
1581
|
+
const definition = {
|
|
1582
|
+
params: this.params,
|
|
1583
|
+
variables: this.variables,
|
|
1584
|
+
logics: this.logics,
|
|
1585
|
+
events: this.bindEvents,
|
|
1586
|
+
title: this.title,
|
|
1587
|
+
viewBindEvents: this.getViewBindEvents(),
|
|
1588
|
+
viewExpressions: this.getViewExpressions(),
|
|
1589
|
+
elements: componentList,
|
|
1590
|
+
elementsAll: allComponentList,
|
|
1591
|
+
};
|
|
1592
|
+
let code = '';
|
|
1593
|
+
const keyboardEventMixinCode = `const keyboardEventMixin = {
|
|
1594
|
+
mounted() {
|
|
1595
|
+
document.addEventListener('keydown', this.onKeyDown);
|
|
1596
|
+
document.addEventListener('keyup', this.onKeyUp);
|
|
1597
|
+
},
|
|
1598
|
+
beforeDestory() {
|
|
1599
|
+
document.removeEventListener('keydown', this.onKeyDown);
|
|
1600
|
+
document.removeEventListener('keyup', this.onKeyUp);
|
|
1601
|
+
},
|
|
1602
|
+
methods: {
|
|
1603
|
+
async onKeyDown(e) {
|
|
1604
|
+
${this.bindEvents
|
|
1605
|
+
.filter((event) => ['keydown'].includes(event.name))
|
|
1606
|
+
.map((event) => `await this.${event.view.name}_${event.name}(e);`)
|
|
1607
|
+
.join('\n')}
|
|
1608
|
+
},
|
|
1609
|
+
async onKeyUp(e) {
|
|
1610
|
+
${this.bindEvents
|
|
1611
|
+
.filter((event) => ['keyup'].includes(event.name))
|
|
1612
|
+
.map((event) => `await this.${event.view.name}_${event.name}(e);`)
|
|
1613
|
+
.join('\n')}
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
};\n`;
|
|
1617
|
+
code += keyboardEventMixinCode;
|
|
1618
|
+
code += 'export default {\n';
|
|
1619
|
+
code += 'mixins: [';
|
|
1620
|
+
const mixins = [];
|
|
1621
|
+
// 键盘事件mixin
|
|
1622
|
+
mixins.push('keyboardEventMixin');
|
|
1623
|
+
code += mixins.join(',');
|
|
1624
|
+
code += '],';
|
|
1625
|
+
code += (0, utils_2.translator)(definition, this);
|
|
1626
|
+
code += '};\n';
|
|
1627
|
+
return code;
|
|
1628
|
+
}
|
|
1629
|
+
// 生成预览的模板
|
|
1630
|
+
genPreviewTemplate() {
|
|
1631
|
+
return `<template>
|
|
1632
|
+
<bs-${this.name}>
|
|
1633
|
+
${this.slotElems
|
|
1634
|
+
.map((slotElem) => {
|
|
1635
|
+
const slotName = slotElem.name;
|
|
1636
|
+
return `<template #${slotName}></template>`;
|
|
1637
|
+
})
|
|
1638
|
+
.join('')}
|
|
1639
|
+
</bs-${this.name}>
|
|
1640
|
+
</template>`;
|
|
1641
|
+
}
|
|
1642
|
+
getAllViewElementNames(excludeName) {
|
|
1643
|
+
const res = [];
|
|
1644
|
+
this.elements.forEach((element) => {
|
|
1645
|
+
utils.traverse(({ node }) => {
|
|
1646
|
+
if (node.name !== excludeName)
|
|
1647
|
+
res.push(node.name);
|
|
1648
|
+
}, {
|
|
1649
|
+
node: element,
|
|
1650
|
+
});
|
|
1651
|
+
});
|
|
1652
|
+
return Array.from(res);
|
|
1653
|
+
}
|
|
1654
|
+
getViewCallLogics() {
|
|
1655
|
+
const callbackLogics = [];
|
|
1656
|
+
this.traverseChildren((el) => {
|
|
1657
|
+
if (asserts.isIdentifier(el) && el.namespace?.endsWith('logics')) {
|
|
1658
|
+
callbackLogics.push(`${el.namespace}.${el.name}`);
|
|
1659
|
+
}
|
|
1660
|
+
});
|
|
1661
|
+
return callbackLogics;
|
|
1662
|
+
}
|
|
1663
|
+
toNaturalTS(state = (0, nasl_translator_1.createCompilerState)()) {
|
|
1664
|
+
let code = `export namespace ${this.name} {\n`;
|
|
1665
|
+
// this.businessComponents.forEach((component) => {
|
|
1666
|
+
// this.frontends.forEach((frontend) => {
|
|
1667
|
+
// code += frontend.toNaturalTS(state);
|
|
1668
|
+
// code += '\n';
|
|
1669
|
+
// });
|
|
1670
|
+
// });
|
|
1671
|
+
code += '}';
|
|
1672
|
+
return code;
|
|
1673
|
+
}
|
|
1674
|
+
toTextualNASL(state = (0, nasl_translator_1.createCompilerState)()) {
|
|
1675
|
+
let code = '';
|
|
1676
|
+
code += (0, nasl_translator_1.createDecoratorCode)(state, this, ['title', 'description']);
|
|
1677
|
+
code += `viewComponent ${this.name}`;
|
|
1678
|
+
code += `(\n`;
|
|
1679
|
+
this.params.forEach((param, index) => {
|
|
1680
|
+
code += param.toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { tabSize: state.tabSize + 1 }));
|
|
1681
|
+
code += ',\n';
|
|
1682
|
+
});
|
|
1683
|
+
this.events.forEach((event, index) => {
|
|
1684
|
+
code += event.toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { tabSize: state.tabSize + 1 }));
|
|
1685
|
+
code += ',\n';
|
|
1686
|
+
});
|
|
1687
|
+
code += ') {\n';
|
|
1688
|
+
this.variables.forEach((variable) => {
|
|
1689
|
+
code += `${(0, nasl_translator_1.indent)(state.tabSize + 1)}let `;
|
|
1690
|
+
code += variable.toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { tabSize: state.tabSize + 1, inline: true }));
|
|
1691
|
+
code += ';\n';
|
|
1692
|
+
});
|
|
1693
|
+
if (this.variables.length)
|
|
1694
|
+
code += '\n';
|
|
1695
|
+
this.logics.forEach((logic) => {
|
|
1696
|
+
code += logic.toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { tabSize: state.tabSize + 1 }));
|
|
1697
|
+
code += '\n';
|
|
1698
|
+
});
|
|
1699
|
+
if (this.logics.length)
|
|
1700
|
+
code += '\n';
|
|
1701
|
+
code += this.elements[0].toTextualNASL((0, nasl_translator_1.shiftState)(state, code, { tabSize: state.tabSize + 1 }));
|
|
1702
|
+
code += `\n${(0, nasl_translator_1.indent)(state.tabSize)}}`;
|
|
1703
|
+
return code;
|
|
1704
|
+
}
|
|
1705
|
+
};
|
|
1706
|
+
exports.BusinessComponent = BusinessComponent;
|
|
1707
|
+
__decorate([
|
|
1708
|
+
(0, decorators_1.property)()
|
|
1709
|
+
// @ts-ignore
|
|
1710
|
+
], BusinessComponent.prototype, "concept", void 0);
|
|
1711
|
+
__decorate([
|
|
1712
|
+
(0, decorators_1.property)()
|
|
1713
|
+
], BusinessComponent.prototype, "name", void 0);
|
|
1714
|
+
__decorate([
|
|
1715
|
+
(0, decorators_1.property)()
|
|
1716
|
+
], BusinessComponent.prototype, "title", void 0);
|
|
1717
|
+
__decorate([
|
|
1718
|
+
(0, decorators_1.property)()
|
|
1719
|
+
], BusinessComponent.prototype, "description", void 0);
|
|
1720
|
+
__decorate([
|
|
1721
|
+
(0, decorators_1.property)({
|
|
1722
|
+
objectRef: 'Event',
|
|
1723
|
+
isArray: true,
|
|
1724
|
+
defaultValue: [],
|
|
1725
|
+
})
|
|
1726
|
+
], BusinessComponent.prototype, "events", void 0);
|
|
1727
|
+
__decorate([
|
|
1728
|
+
(0, decorators_1.property)({
|
|
1729
|
+
objectRef: 'ParamWithGroup',
|
|
1730
|
+
isArray: true,
|
|
1731
|
+
defaultValue: [],
|
|
1732
|
+
})
|
|
1733
|
+
], BusinessComponent.prototype, "params", void 0);
|
|
1734
|
+
__decorate([
|
|
1735
|
+
(0, decorators_1.property)({
|
|
1736
|
+
objectRef: 'Variable',
|
|
1737
|
+
isArray: true,
|
|
1738
|
+
defaultValue: [],
|
|
1739
|
+
})
|
|
1740
|
+
], BusinessComponent.prototype, "variables", void 0);
|
|
1741
|
+
__decorate([
|
|
1742
|
+
(0, decorators_1.property)({
|
|
1743
|
+
objectRef: 'BindEvent',
|
|
1744
|
+
isArray: true,
|
|
1745
|
+
defaultValue: [],
|
|
1746
|
+
})
|
|
1747
|
+
], BusinessComponent.prototype, "bindEvents", void 0);
|
|
1748
|
+
__decorate([
|
|
1749
|
+
(0, decorators_1.property)({
|
|
1750
|
+
objectRef: 'BusinessLogic',
|
|
1751
|
+
isArray: true,
|
|
1752
|
+
defaultValue: [],
|
|
1753
|
+
})
|
|
1754
|
+
], BusinessComponent.prototype, "logics", void 0);
|
|
1755
|
+
__decorate([
|
|
1756
|
+
(0, decorators_1.property)({
|
|
1757
|
+
objectRef: 'ViewElement',
|
|
1758
|
+
isArray: true,
|
|
1759
|
+
defaultValue: [],
|
|
1760
|
+
})
|
|
1761
|
+
], BusinessComponent.prototype, "elements", void 0);
|
|
1762
|
+
__decorate([
|
|
1763
|
+
(0, decorators_1.property)()
|
|
1764
|
+
], BusinessComponent.prototype, "icon", void 0);
|
|
1765
|
+
__decorate([
|
|
1766
|
+
nasl_translator_1.withSourceMapGenerator
|
|
1767
|
+
], BusinessComponent.prototype, "toEmbeddedTS", null);
|
|
1768
|
+
__decorate([
|
|
1769
|
+
nasl_translator_1.withSourceMapGenerator
|
|
1770
|
+
], BusinessComponent.prototype, "toEmbeddedDeclarationTS", null);
|
|
1771
|
+
__decorate([
|
|
1772
|
+
(0, nasl_translator_1.withSourceMap)()
|
|
1773
|
+
], BusinessComponent.prototype, "toNaturalTS", null);
|
|
1774
|
+
__decorate([
|
|
1775
|
+
(0, nasl_translator_1.withSourceMap)()
|
|
1776
|
+
], BusinessComponent.prototype, "toTextualNASL", null);
|
|
1777
|
+
exports.BusinessComponent = BusinessComponent = BusinessComponent_1 = __decorate([
|
|
1778
|
+
(0, decorators_1.concept)('业务组件')
|
|
1779
|
+
], BusinessComponent);
|
|
1780
|
+
exports.default = BusinessComponent;
|
|
1781
|
+
//================================================================================
|
|
1782
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1783
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
1784
|
+
//================================================================================
|
|
1785
|
+
//# sourceMappingURL=BusinessComponent__.js.map
|