@lcap/nasl 3.7.0-alpha.1 → 3.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/automate/engine/utils.d.ts +1 -1
- package/out/automate/engine/utils.js +3 -7
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/myProcess.js +65 -65
- package/out/automate/template/myProcess.js.map +1 -1
- package/out/bak/translator.js +42 -12
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.d.ts +2 -0
- package/out/breakpoint/generator/BreakpointNode.js +7 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/shared/constants.js +1 -0
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/utils.js +1 -1
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +4 -3
- package/out/common/BaseNode.js +61 -10
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/ComponentAPI.d.ts +5 -3
- package/out/common/EventEmitter.d.ts +1 -0
- package/out/common/EventEmitter.js.map +1 -1
- package/out/concepts/Abort__.d.ts +5 -4
- package/out/concepts/Abort__.js +5 -7
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/AbstractInterface__.d.ts +9 -6
- package/out/concepts/AbstractInterface__.js +8 -11
- package/out/concepts/AbstractInterface__.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +5 -12
- package/out/concepts/Anchor__.js +5 -44
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +10 -47
- package/out/concepts/AnonymousFunction__.js +14 -159
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +321 -437
- package/out/concepts/App__.js +460 -986
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +5 -12
- package/out/concepts/Argument__.js +11 -46
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +8 -5
- package/out/concepts/Assignee__.js +9 -66
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.d.ts +5 -6
- package/out/concepts/AssignmentLine__.js +7 -11
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +5 -26
- package/out/concepts/Assignment__.js +5 -64
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +14 -51
- package/out/concepts/Attribute__.js +36 -126
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +10 -10
- package/out/concepts/AuthInterface__.js +18 -13
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +6 -3
- package/out/concepts/AuthLogicForCallInterface__.js +6 -32
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.d.ts +19 -19
- package/out/concepts/AuthLogic__.js +26 -25
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +19 -47
- package/out/concepts/BackendVariable__.js +43 -134
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +6 -13
- package/out/concepts/Backend__.js +13 -50
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BaseSetter__.d.ts +25 -0
- package/out/concepts/BaseSetter__.js +53 -0
- package/out/concepts/BaseSetter__.js.map +1 -0
- package/out/concepts/BatchAssignment__.d.ts +9 -21
- package/out/concepts/BatchAssignment__.js +11 -86
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +5 -22
- package/out/concepts/BinaryExpression__.js +32 -59
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +60 -107
- package/out/concepts/BindAttribute__.js +144 -251
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +26 -42
- package/out/concepts/BindDirective__.js +63 -105
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +27 -36
- package/out/concepts/BindEvent__.js +50 -109
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +24 -41
- package/out/concepts/BindStyle__.js +48 -88
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/Block__.d.ts +5 -2
- package/out/concepts/Block__.js +5 -31
- package/out/concepts/Block__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +5 -0
- package/out/concepts/BooleanLiteral__.js +8 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/BusinessComponent__.d.ts +47 -49
- package/out/concepts/BusinessComponent__.js +122 -444
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.d.ts +5 -0
- package/out/concepts/BusinessLogic__.js +8 -1
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +6 -4
- package/out/concepts/CallAuthInterface__.js +6 -34
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +5 -0
- package/out/concepts/CallConnector__.js +11 -2
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallEvent__.d.ts +6 -7
- package/out/concepts/CallEvent__.js +11 -40
- package/out/concepts/CallEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +17 -9
- package/out/concepts/CallFunction__.js +84 -130
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +6 -7
- package/out/concepts/CallInterface__.js +14 -41
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +11 -24
- package/out/concepts/CallLogic__.js +68 -140
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +70 -126
- package/out/concepts/CallQueryComponent__.js +134 -308
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/CapsulesSetter__.d.ts +109 -0
- package/out/concepts/CapsulesSetter__.js +163 -0
- package/out/concepts/CapsulesSetter__.js.map +1 -0
- package/out/concepts/Comment__.d.ts +5 -0
- package/out/concepts/Comment__.js +8 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts +6 -26
- package/out/concepts/CompletionProperty__.js +24 -74
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +6 -13
- package/out/concepts/ConfigGroup__.js +13 -50
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.d.ts +5 -11
- package/out/concepts/ConfigPropertyValue__.js +11 -19
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +11 -18
- package/out/concepts/ConfigProperty__.js +25 -58
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +6 -13
- package/out/concepts/Configuration__.js +6 -49
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +11 -18
- package/out/concepts/Connection__.js +25 -58
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.d.ts +28 -34
- package/out/concepts/ConnectorTrigger__.js +55 -50
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.d.ts +106 -504
- package/out/concepts/Connector__.js +134 -791
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +27 -55
- package/out/concepts/Constant__.js +45 -137
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/CountersignPolicy__.d.ts +6 -5
- package/out/concepts/CountersignPolicy__.js +8 -12
- package/out/concepts/CountersignPolicy__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +11 -18
- package/out/concepts/DataSource__.js +25 -58
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.d.ts +5 -6
- package/out/concepts/DatabaseTypeAnnotation__.js +11 -13
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/DefaultValue__.d.ts +7 -19
- package/out/concepts/DefaultValue__.js +6 -56
- package/out/concepts/DefaultValue__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +10 -21
- package/out/concepts/Destination__.js +15 -55
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +5 -4
- package/out/concepts/End__.js +7 -8
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +20 -26
- package/out/concepts/EntityIndex__.js +40 -39
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +17 -56
- package/out/concepts/EntityProperty__.js +70 -181
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +18 -26
- package/out/concepts/Entity__.js +38 -98
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +15 -21
- package/out/concepts/EnumItem__.js +27 -31
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/EnumSelectSetter__.d.ts +109 -0
- package/out/concepts/EnumSelectSetter__.js +163 -0
- package/out/concepts/EnumSelectSetter__.js.map +1 -0
- package/out/concepts/Enum__.d.ts +10 -28
- package/out/concepts/Enum__.js +35 -102
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/EventDeclaration__.d.ts +41 -0
- package/out/concepts/EventDeclaration__.js +81 -0
- package/out/concepts/EventDeclaration__.js.map +1 -0
- package/out/concepts/Event__.d.ts +16 -27
- package/out/concepts/Event__.js +37 -78
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +8 -25
- package/out/concepts/ExternalDestination__.js +8 -58
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +7 -55
- package/out/concepts/ForEachStatement__.js +6 -128
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +38 -46
- package/out/concepts/FrontendLibrary__.js +55 -121
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/FrontendType__.d.ts +8 -12
- package/out/concepts/FrontendType__.js +15 -109
- package/out/concepts/FrontendType__.js.map +1 -1
- package/out/concepts/FrontendVariable__.d.ts +5 -0
- package/out/concepts/FrontendVariable__.js +8 -1
- package/out/concepts/FrontendVariable__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +9 -41
- package/out/concepts/Frontend__.js +36 -209
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.d.ts +13 -34
- package/out/concepts/Function__.js +22 -194
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/I18nInfo__.d.ts +6 -7
- package/out/concepts/I18nInfo__.js +14 -14
- package/out/concepts/I18nInfo__.js.map +1 -1
- package/out/concepts/IconSetter__.d.ts +29 -0
- package/out/concepts/IconSetter__.js +62 -0
- package/out/concepts/IconSetter__.js.map +1 -0
- package/out/concepts/Identifier__.d.ts +5 -0
- package/out/concepts/Identifier__.js +20 -6
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +5 -12
- package/out/concepts/IfStatement__.js +5 -44
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/ImageSetter__.d.ts +25 -0
- package/out/concepts/ImageSetter__.js +53 -0
- package/out/concepts/ImageSetter__.js.map +1 -0
- package/out/concepts/ImportedInterface__.d.ts +9 -0
- package/out/concepts/ImportedInterface__.js +11 -1
- package/out/concepts/ImportedInterface__.js.map +1 -1
- package/out/concepts/InputSetter__.d.ts +29 -0
- package/out/concepts/InputSetter__.js +62 -0
- package/out/concepts/InputSetter__.js.map +1 -0
- package/out/concepts/Integration__.d.ts +7 -26
- package/out/concepts/Integration__.js +6 -93
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +34 -62
- package/out/concepts/InterfaceParam__.js +63 -147
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +42 -48
- package/out/concepts/Interface__.js +89 -158
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +5 -4
- package/out/concepts/JSBlock__.js +8 -8
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +5 -0
- package/out/concepts/JavaLogic__.js +14 -3
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicDeclaration__.d.ts +289 -0
- package/out/concepts/LogicDeclaration__.js +352 -0
- package/out/concepts/LogicDeclaration__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +39 -45
- package/out/concepts/LogicItem__.js +76 -62
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +45 -63
- package/out/concepts/Logic__.js +159 -280
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +6 -4
- package/out/concepts/MatchCase__.js +16 -68
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +8 -14
- package/out/concepts/Match__.js +17 -49
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +8 -23
- package/out/concepts/MemberExpression__.js +85 -103
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +36 -54
- package/out/concepts/MetadataType__.js +44 -119
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +5 -6
- package/out/concepts/MicroApp__.js +30 -18
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.d.ts +99 -128
- package/out/concepts/Module__.js +133 -532
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.d.ts +31 -33
- package/out/concepts/MsgTriggerEvent__.js +39 -67
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.d.ts +11 -14
- package/out/concepts/MsgTriggerLauncher__.js +18 -44
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/MultiApprovalPolicy__.d.ts +8 -9
- package/out/concepts/MultiApprovalPolicy__.js +7 -13
- package/out/concepts/MultiApprovalPolicy__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +112 -138
- package/out/concepts/Namespace__.js +122 -501
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +11 -21
- package/out/concepts/NewComposite__.js +48 -146
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +6 -14
- package/out/concepts/NewList__.js +7 -77
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +6 -14
- package/out/concepts/NewMap__.js +7 -77
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.d.ts +6 -0
- package/out/concepts/New__.js +9 -0
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +5 -0
- package/out/concepts/NullLiteral__.js +5 -0
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumberInputSetter__.d.ts +45 -0
- package/out/concepts/NumberInputSetter__.js +98 -0
- package/out/concepts/NumberInputSetter__.js.map +1 -0
- package/out/concepts/NumericLiteral__.d.ts +6 -13
- package/out/concepts/NumericLiteral__.js +8 -45
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +7 -17
- package/out/concepts/OqlQueryComponent__.js +16 -53
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +38 -59
- package/out/concepts/OverriddenLogic__.js +55 -252
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Paginate__.d.ts +59 -0
- package/out/concepts/Paginate__.js +158 -0
- package/out/concepts/Paginate__.js.map +1 -0
- package/out/concepts/ParamWithGroup__.d.ts +13 -10
- package/out/concepts/ParamWithGroup__.js +15 -6
- package/out/concepts/ParamWithGroup__.js.map +1 -1
- package/out/concepts/Param__.d.ts +33 -76
- package/out/concepts/Param__.js +63 -159
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.d.ts +5 -6
- package/out/concepts/Point__.js +11 -13
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.d.ts +12 -20
- package/out/concepts/ProcessComponent__.js +32 -90
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +21 -66
- package/out/concepts/ProcessElement__.js +48 -360
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +5 -4
- package/out/concepts/ProcessOutcome__.js +8 -8
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +5 -4
- package/out/concepts/ProcessOutcomes__.js +6 -7
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.d.ts +16 -26
- package/out/concepts/Process__.js +29 -186
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/PropDeclaration__.d.ts +99 -0
- package/out/concepts/PropDeclaration__.js +183 -0
- package/out/concepts/PropDeclaration__.js.map +1 -0
- package/out/concepts/PropertySelectSetter__.d.ts +25 -0
- package/out/concepts/PropertySelectSetter__.js +53 -0
- package/out/concepts/PropertySelectSetter__.js.map +1 -0
- package/out/concepts/QueryAggregateExpression__.d.ts +6 -13
- package/out/concepts/QueryAggregateExpression__.js +11 -46
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +5 -0
- package/out/concepts/QueryFieldExpression__.js +17 -4
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +6 -3
- package/out/concepts/QueryFromExpression__.js +14 -34
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +5 -12
- package/out/concepts/QueryGroupByExpression__.js +5 -44
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +29 -26
- package/out/concepts/QueryJoinExpression__.js +34 -52
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +5 -22
- package/out/concepts/QueryLimitExpression__.js +5 -57
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +5 -22
- package/out/concepts/QueryOrderByExpression__.js +5 -57
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +37 -34
- package/out/concepts/QuerySelectExpression__.js +37 -59
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.d.ts +5 -6
- package/out/concepts/Rect__.js +17 -15
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +28 -56
- package/out/concepts/Return__.js +50 -139
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +5 -11
- package/out/concepts/Role__.js +21 -21
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +8 -20
- package/out/concepts/SelectMembers__.js +10 -58
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/SequentialPolicy__.d.ts +5 -0
- package/out/concepts/SequentialPolicy__.js +5 -0
- package/out/concepts/SequentialPolicy__.js.map +1 -1
- package/out/concepts/SetterOption__.d.ts +49 -0
- package/out/concepts/SetterOption__.js +99 -0
- package/out/concepts/SetterOption__.js.map +1 -0
- package/out/concepts/SlotDeclaration__.d.ts +213 -0
- package/out/concepts/SlotDeclaration__.js +287 -0
- package/out/concepts/SlotDeclaration__.js.map +1 -0
- package/out/concepts/Slot__.d.ts +7 -31
- package/out/concepts/Slot__.js +27 -72
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +6 -17
- package/out/concepts/SqlQueryComponent__.js +14 -54
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +5 -4
- package/out/concepts/Start__.js +5 -7
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StaticString__.d.ts +6 -12
- package/out/concepts/StaticString__.js +14 -21
- package/out/concepts/StaticString__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +5 -2
- package/out/concepts/StringInterpolation__.js +7 -33
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +6 -1
- package/out/concepts/StringLiteral__.js +16 -2
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +13 -49
- package/out/concepts/StructureProperty__.js +35 -137
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +13 -21
- package/out/concepts/Structure__.js +28 -90
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +6 -13
- package/out/concepts/SwitchCase__.js +6 -45
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchSetter__.d.ts +25 -0
- package/out/concepts/SwitchSetter__.js +53 -0
- package/out/concepts/SwitchSetter__.js.map +1 -0
- package/out/concepts/SwitchStatement__.d.ts +6 -3
- package/out/concepts/SwitchStatement__.js +5 -31
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/ThemeVariable__.d.ts +29 -0
- package/out/concepts/ThemeVariable__.js +58 -0
- package/out/concepts/ThemeVariable__.js.map +1 -0
- package/out/concepts/Theme__.d.ts +5 -6
- package/out/concepts/Theme__.js +11 -13
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +29 -35
- package/out/concepts/Transactional__.js +54 -56
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TriggerEvent__.d.ts +8 -20
- package/out/concepts/TriggerEvent__.js +13 -57
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +12 -17
- package/out/concepts/TriggerLauncher__.js +30 -27
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -11
- package/out/concepts/TypeAnnotation__.js +40 -89
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +5 -0
- package/out/concepts/TypeParam__.js +12 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +5 -12
- package/out/concepts/UnaryExpression__.js +8 -45
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +5 -0
- package/out/concepts/Unparsed__.js +8 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.d.ts +6 -7
- package/out/concepts/UseComponent__.js +11 -13
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +7 -28
- package/out/concepts/ValidationRule__.js +18 -71
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +30 -58
- package/out/concepts/Variable__.js +51 -140
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlockWithImage__.d.ts +33 -0
- package/out/concepts/ViewBlockWithImage__.js +63 -0
- package/out/concepts/ViewBlockWithImage__.js.map +1 -0
- package/out/concepts/ViewBlock__.d.ts +11 -12
- package/out/concepts/ViewBlock__.js +22 -18
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponentDeclaration__.d.ts +721 -0
- package/out/concepts/ViewComponentDeclaration__.js +808 -0
- package/out/concepts/ViewComponentDeclaration__.js.map +1 -0
- package/out/concepts/ViewElement__.d.ts +38 -37
- package/out/concepts/ViewElement__.js +415 -432
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +39 -46
- package/out/concepts/View__.js +509 -342
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +6 -13
- package/out/concepts/WhileStatement__.js +6 -45
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +68 -33
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.js +101 -3
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +31 -31
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +24 -8
- package/out/concepts/index__.js +24 -8
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/utils/asserts.d.ts +1079 -313
- package/out/concepts/utils/asserts.js +1461 -441
- package/out/concepts/utils/asserts.js.map +1 -1
- package/out/concepts/utils/types.d.ts +82 -30
- package/out/config.d.ts +9 -0
- package/out/config.js +5 -0
- package/out/config.js.map +1 -1
- package/out/decorators/index.d.ts +1 -6
- package/out/decorators/index.js +7 -16
- package/out/decorators/index.js.map +1 -1
- package/out/enums/KEYWORDS.js +2 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +2 -0
- package/out/generator/genBundleFiles.js +105 -25
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +2 -4
- package/out/generator/genReleaseBody.js +0 -1
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/permission.d.ts +5 -1
- package/out/generator/permission.js +3 -2
- package/out/generator/permission.js.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/natural/genNaturalTS.js +2 -5
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/index.d.ts +2 -0
- package/out/natural/index.js +2 -0
- package/out/natural/index.js.map +1 -1
- package/out/natural/naslStdlibMap.d.ts +1 -2
- package/out/natural/naslStdlibMap.js +32 -23
- package/out/natural/naslStdlibMap.js.map +1 -1
- package/out/natural/prompt/analyzeClaims.d.ts +1 -0
- package/out/natural/prompt/analyzeClaims.js +21 -0
- package/out/natural/prompt/analyzeClaims.js.map +1 -0
- package/out/natural/prompt/executeClaims.d.ts +1 -0
- package/out/natural/prompt/executeClaims.js +73 -0
- package/out/natural/prompt/executeClaims.js.map +1 -0
- package/out/natural/transformTSCode.js +13 -2
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/createUiTs.d.ts +2 -1
- package/out/server/createUiTs.js +133 -161
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +1 -15
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/extendBaseNode.js +36 -9
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.js +9 -9
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getConnector.d.ts +1 -0
- package/out/server/getConnector.js +38 -35
- package/out/server/getConnector.js.map +1 -1
- package/out/server/getFunctions.js +3 -3
- package/out/server/getFunctions.js.map +1 -1
- package/out/server/getLogics.js +51 -15
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +87 -144
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +11 -1
- package/out/server/naslServer.js +118 -74
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +24 -5
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -0
- package/out/service/storage/init.js +12 -7
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +16 -16
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +23 -23
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.d.ts +2 -2
- package/out/templator/genCurdMultipleKeyBlock.js +28 -38
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +15 -15
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +8 -8
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +18 -20
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +10 -10
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +32 -37
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.js +10 -10
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +18 -10
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +15 -15
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +19 -24
- package/out/templator/utils.js +20 -30
- package/out/templator/utils.js.map +1 -1
- package/out/translator/types.d.ts +2 -0
- package/out/utils/index.d.ts +6 -1
- package/out/utils/index.js +37 -4
- package/out/utils/index.js.map +1 -1
- package/out/utils/string.d.ts +12 -0
- package/out/utils/string.js +15 -1
- package/out/utils/string.js.map +1 -1
- package/out/utils/time-slicing/performance.js +3 -3
- package/out/utils/time-slicing/performance.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.auth.ts +4 -0
- package/sandbox/stdlib/nasl.collection.ts +5 -3
- package/sandbox/stdlib/nasl.core.ts +16 -1
- package/sandbox/stdlib/nasl.oql.ts +2 -2
- package/sandbox/stdlib/nasl.process.ts +18 -0
- package/sandbox/stdlib/nasl.ui.components.h5.ts +1751 -0
- package/sandbox/stdlib/nasl.ui.components.pc.ts +3479 -0
- package/sandbox/stdlib/nasl.ui.definition.ts +53 -2688
- package/sandbox/stdlib/nasl.ui.ts +2 -1
- package/sandbox/stdlib/nasl.util.ts +7 -5
- package/sandbox-natural/stdlib/nasl.core.ts +3 -0
- package/sandbox-natural/stdlib/nasl.oql.ts +4 -3
- package/src/automate/engine/utils.js +3 -7
- package/src/automate/template/myProcess.js +65 -65
- package/src/bak/translator.js +62 -29
- package/src/breakpoint/generator/BreakpointNode.ts +9 -0
- package/src/breakpoint/shared/constants.ts +1 -0
- package/src/breakpoint/shared/utils.ts +1 -1
- package/src/common/BaseNode.ts +71 -9
- package/src/common/ComponentAPI.ts +6 -3
- package/src/common/EventEmitter.ts +1 -0
- package/src/concepts/Abort__.ts +8 -8
- package/src/concepts/AbstractInterface__.ts +14 -14
- package/src/concepts/Anchor__.ts +8 -60
- package/src/concepts/AnonymousFunction__.ts +21 -198
- package/src/concepts/App__.ts +1151 -1837
- package/src/concepts/Argument__.ts +16 -64
- package/src/concepts/Assignee__.ts +14 -72
- package/src/concepts/AssignmentLine__.ts +9 -14
- package/src/concepts/Assignment__.ts +9 -92
- package/src/concepts/Attribute__.ts +49 -176
- package/src/concepts/AuthInterface__.ts +19 -20
- package/src/concepts/AuthLogicForCallInterface__.ts +9 -36
- package/src/concepts/AuthLogic__.ts +45 -46
- package/src/concepts/BackendVariable__.ts +45 -167
- package/src/concepts/Backend__.ts +13 -57
- package/src/concepts/BaseSetter__.ts +72 -0
- package/src/concepts/BatchAssignment__.ts +18 -105
- package/src/concepts/BinaryExpression__.ts +36 -89
- package/src/concepts/BindAttribute__.ts +194 -343
- package/src/concepts/BindDirective__.ts +80 -135
- package/src/concepts/BindEvent__.ts +62 -126
- package/src/concepts/BindStyle__.ts +59 -112
- package/src/concepts/Block__.ts +8 -34
- package/src/concepts/BooleanLiteral__.ts +12 -5
- package/src/concepts/BusinessComponent__.ts +201 -502
- package/src/concepts/BusinessLogic__.ts +15 -15
- package/src/concepts/CallAuthInterface__.ts +10 -39
- package/src/concepts/CallConnector__.ts +15 -6
- package/src/concepts/CallEvent__.ts +16 -45
- package/src/concepts/CallFunction__.ts +104 -134
- package/src/concepts/CallInterface__.ts +20 -47
- package/src/concepts/CallLogic__.ts +93 -175
- package/src/concepts/CallQueryComponent__.ts +226 -520
- package/src/concepts/CapsulesSetter__.ts +254 -0
- package/src/concepts/Comment__.ts +11 -5
- package/src/concepts/CompletionProperty__.ts +29 -100
- package/src/concepts/ConfigGroup__.ts +13 -57
- package/src/concepts/ConfigPropertyValue__.ts +14 -26
- package/src/concepts/ConfigProperty__.ts +28 -68
- package/src/concepts/Configuration__.ts +9 -56
- package/src/concepts/Connection__.ts +27 -68
- package/src/concepts/ConnectorTrigger__.ts +57 -65
- package/src/concepts/Connector__.ts +339 -1448
- package/src/concepts/Constant__.ts +59 -182
- package/src/concepts/CountersignPolicy__.ts +12 -18
- package/src/concepts/DataSource__.ts +29 -68
- package/src/concepts/DatabaseTypeAnnotation__.ts +14 -19
- package/src/concepts/DefaultValue__.ts +10 -74
- package/src/concepts/Destination__.ts +28 -80
- package/src/concepts/End__.ts +11 -9
- package/src/concepts/EntityIndex__.ts +44 -51
- package/src/concepts/EntityProperty__.ts +86 -238
- package/src/concepts/Entity__.ts +43 -111
- package/src/concepts/EnumItem__.ts +29 -40
- package/src/concepts/EnumSelectSetter__.ts +254 -0
- package/src/concepts/Enum__.ts +38 -129
- package/src/concepts/EventDeclaration__.ts +95 -0
- package/src/concepts/Event__.ts +43 -92
- package/src/concepts/ExternalDestination__.ts +17 -91
- package/src/concepts/ForEachStatement__.ts +15 -198
- package/src/concepts/FrontendLibrary__.ts +111 -161
- package/src/concepts/FrontendType__.ts +21 -118
- package/src/concepts/FrontendVariable__.ts +10 -4
- package/src/concepts/Frontend__.ts +44 -250
- package/src/concepts/Function__.ts +28 -220
- package/src/concepts/I18nInfo__.ts +18 -20
- package/src/concepts/IconSetter__.ts +72 -0
- package/src/concepts/Identifier__.ts +27 -16
- package/src/concepts/IfStatement__.ts +9 -60
- package/src/concepts/ImageSetter__.ts +65 -0
- package/src/concepts/ImportedInterface__.ts +17 -4
- package/src/concepts/InputSetter__.ts +72 -0
- package/src/concepts/Integration__.ts +10 -114
- package/src/concepts/InterfaceParam__.ts +67 -186
- package/src/concepts/Interface__.ts +106 -200
- package/src/concepts/JSBlock__.ts +11 -11
- package/src/concepts/JavaLogic__.ts +19 -9
- package/src/concepts/LogicDeclaration__.ts +657 -0
- package/src/concepts/LogicItem__.ts +91 -96
- package/src/concepts/Logic__.ts +287 -434
- package/src/concepts/MatchCase__.ts +22 -72
- package/src/concepts/Match__.ts +23 -67
- package/src/concepts/MemberExpression__.ts +136 -132
- package/src/concepts/MetadataType__.ts +72 -167
- package/src/concepts/MicroApp__.ts +34 -29
- package/src/concepts/Module__.ts +259 -681
- package/src/concepts/MsgTriggerEvent__.ts +44 -79
- package/src/concepts/MsgTriggerLauncher__.ts +21 -54
- package/src/concepts/MultiApprovalPolicy__.ts +10 -18
- package/src/concepts/Namespace__.ts +278 -652
- package/src/concepts/NewComposite__.ts +62 -170
- package/src/concepts/NewList__.ts +12 -94
- package/src/concepts/NewMap__.ts +12 -94
- package/src/concepts/New__.ts +13 -2
- package/src/concepts/NullLiteral__.ts +8 -2
- package/src/concepts/NumberInputSetter__.ts +104 -0
- package/src/concepts/NumericLiteral__.ts +13 -63
- package/src/concepts/OqlQueryComponent__.ts +23 -71
- package/src/concepts/OverriddenLogic__.ts +71 -287
- package/src/concepts/Paginate__.ts +185 -0
- package/src/concepts/ParamWithGroup__.ts +26 -17
- package/src/concepts/Param__.ts +70 -211
- package/src/concepts/Point__.ts +14 -19
- package/src/concepts/ProcessComponent__.ts +33 -104
- package/src/concepts/ProcessElement__.ts +67 -422
- package/src/concepts/ProcessOutcome__.ts +12 -11
- package/src/concepts/ProcessOutcomes__.ts +9 -9
- package/src/concepts/Process__.ts +36 -200
- package/src/concepts/PropDeclaration__.ts +209 -0
- package/src/concepts/PropertySelectSetter__.ts +65 -0
- package/src/concepts/QueryAggregateExpression__.ts +18 -65
- package/src/concepts/QueryFieldExpression__.ts +22 -10
- package/src/concepts/QueryFromExpression__.ts +21 -41
- package/src/concepts/QueryGroupByExpression__.ts +8 -60
- package/src/concepts/QueryJoinExpression__.ts +64 -101
- package/src/concepts/QueryLimitExpression__.ts +9 -86
- package/src/concepts/QueryOrderByExpression__.ts +9 -86
- package/src/concepts/QuerySelectExpression__.ts +70 -118
- package/src/concepts/Rect__.ts +22 -23
- package/src/concepts/Return__.ts +60 -185
- package/src/concepts/Role__.ts +22 -29
- package/src/concepts/SelectMembers__.ts +16 -77
- package/src/concepts/SequentialPolicy__.ts +7 -2
- package/src/concepts/SetterOption__.ts +111 -0
- package/src/concepts/SlotDeclaration__.ts +488 -0
- package/src/concepts/Slot__.ts +35 -105
- package/src/concepts/SqlQueryComponent__.ts +21 -73
- package/src/concepts/Start__.ts +7 -8
- package/src/concepts/StaticString__.ts +16 -26
- package/src/concepts/StringInterpolation__.ts +9 -36
- package/src/concepts/StringLiteral__.ts +16 -7
- package/src/concepts/StructureProperty__.ts +38 -176
- package/src/concepts/Structure__.ts +32 -102
- package/src/concepts/SwitchCase__.ts +10 -62
- package/src/concepts/SwitchSetter__.ts +65 -0
- package/src/concepts/SwitchStatement__.ts +9 -35
- package/src/concepts/ThemeVariable__.ts +71 -0
- package/src/concepts/Theme__.ts +15 -17
- package/src/concepts/Transactional__.ts +67 -77
- package/src/concepts/TriggerEvent__.ts +14 -76
- package/src/concepts/TriggerLauncher__.ts +34 -38
- package/src/concepts/TypeAnnotation__.ts +50 -100
- package/src/concepts/TypeParam__.ts +10 -5
- package/src/concepts/UnaryExpression__.ts +12 -62
- package/src/concepts/Unparsed__.ts +11 -5
- package/src/concepts/UseComponent__.ts +14 -19
- package/src/concepts/ValidationRule__.ts +26 -105
- package/src/concepts/Variable__.ts +71 -195
- package/src/concepts/ViewBlockWithImage__.ts +80 -0
- package/src/concepts/ViewBlock__.ts +24 -27
- package/src/concepts/ViewComponentDeclaration__.ts +1670 -0
- package/src/concepts/ViewElement__.ts +502 -486
- package/src/concepts/View__.ts +576 -389
- package/src/concepts/WhileStatement__.ts +11 -62
- package/src/concepts/basics/stdlib/nasl.auth.ts +97 -34
- package/src/concepts/basics/stdlib/nasl.process.ts +103 -7
- package/src/concepts/basics/stdlib/nasl.util.ts +31 -31
- package/src/concepts/index__.ts +24 -8
- package/src/concepts/utils/asserts.ts +1544 -446
- package/src/concepts/utils/types.ts +121 -41
- package/src/config.ts +6 -0
- package/src/decorators/index.ts +3 -8
- package/src/enums/KEYWORDS.ts +2 -0
- package/src/generator/genBundleFiles.ts +129 -29
- package/src/generator/genReleaseBody.ts +0 -2
- package/src/generator/permission.ts +2 -2
- package/src/index.ts +1 -0
- package/src/natural/genNaturalTS.ts +2 -2
- package/src/natural/index.ts +3 -0
- package/src/natural/naslStdlibMap.ts +25 -19
- package/src/natural/prompt/analyzeClaims.ts +16 -0
- package/src/natural/prompt/executeClaims.ts +69 -0
- package/src/natural/transformTSCode.ts +12 -2
- package/src/server/createUiTs.ts +121 -155
- package/src/server/entity2LogicNamespace.ts +1 -16
- package/src/server/extendBaseNode.ts +46 -15
- package/src/server/formatTsUtils.ts +13 -13
- package/src/server/getConnector.ts +43 -35
- package/src/server/getFunctions.ts +3 -3
- package/src/server/getLogics.ts +34 -17
- package/src/server/getMemberIdentifier.ts +101 -145
- package/src/server/naslServer.ts +136 -74
- package/src/server/translator.ts +23 -5
- package/src/service/storage/init.ts +15 -8
- package/src/templator/genCreateBlock.ts +16 -16
- package/src/templator/genCurdEditMultipleKeyBlock.ts +23 -23
- package/src/templator/genCurdMultipleKeyBlock.ts +34 -44
- package/src/templator/genEditTableBlock.ts +15 -15
- package/src/templator/genEnumSelectBlock.ts +8 -8
- package/src/templator/genGridViewBlock.ts +18 -20
- package/src/templator/genListViewBlock.ts +10 -10
- package/src/templator/genQueryComponent.ts +33 -38
- package/src/templator/genSelectBlock.ts +10 -10
- package/src/templator/genTableBlock.ts +20 -12
- package/src/templator/genUpdateBlock.ts +15 -15
- package/src/templator/utils.ts +21 -30
- package/src/translator/types.ts +4 -0
- package/src/utils/index.ts +40 -5
- package/src/utils/string.ts +14 -0
- package/src/utils/time-slicing/performance.ts +3 -3
- package/test/concepts/call-interface/__snapshots__/getQuickInfoOffset.spec.ts.snap +1 -1
- package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -1
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +7 -8
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +5 -5
- package/test/concepts/entity/__snapshots__/toEmbeddedTS.spec.ts.snap +2 -2
- package/test/concepts/member-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -1
- package/test/concepts/member-expression/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/member-expression/fixtures/elements.table-view.data.json +363 -10
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +655 -611
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +127 -6
- package/test/concepts/view-element/fixtures/table-data-source-calllogic-with-server-validation.json +2074 -0
- package/test/concepts/view-element/toEmbeddedTS.spec.ts +11 -0
- package/test/concepts/view-element/toVue.spec.ts +0 -1
- package/ts-worker/src/start.js +1 -0
- package/out/concepts/ViewComponent__.d.ts +0 -568
- package/out/concepts/ViewComponent__.js +0 -809
- package/out/concepts/ViewComponent__.js.map +0 -1
- package/src/concepts/ViewComponent__.ts +0 -1444
package/src/concepts/App__.ts
CHANGED
|
@@ -34,43 +34,42 @@ interface compilerInfoMapProps {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
type composeCacheType = {
|
|
37
|
-
[key: string]: composeCacheType
|
|
37
|
+
[key: string]: composeCacheType;
|
|
38
38
|
} & {
|
|
39
39
|
nodes?: any[];
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
|
|
43
42
|
//================================================================================
|
|
44
43
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
45
44
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
46
45
|
//================================================================================
|
|
47
46
|
import { EventPayload, Params } from '../common/EventEmitter';
|
|
48
|
-
import { concept, excludedInJSON, property, getConceptConstructor
|
|
47
|
+
import { concept, excludedInJSON, property, getConceptConstructor } from '../decorators';
|
|
49
48
|
|
|
50
49
|
import * as utils from '../utils';
|
|
51
50
|
import * as types from './utils/types';
|
|
52
51
|
import * as asserts from './utils/asserts';
|
|
53
52
|
import { v4 as uuidv4 } from 'uuid';
|
|
54
53
|
import BaseNode from '../common/BaseNode';
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
54
|
+
import DataSource from './DataSource__';
|
|
55
|
+
import Structure from './Structure__';
|
|
56
|
+
import Enum from './Enum__';
|
|
57
|
+
import Logic from './Logic__';
|
|
58
|
+
import OverriddenLogic from './OverriddenLogic__';
|
|
59
|
+
import AbstractInterface from './AbstractInterface__';
|
|
60
|
+
import FrontendType from './FrontendType__';
|
|
62
61
|
import Backend from './Backend__';
|
|
63
|
-
import
|
|
64
|
-
import
|
|
62
|
+
import Process from './Process__';
|
|
63
|
+
import Role from './Role__';
|
|
65
64
|
import Configuration from './Configuration__';
|
|
66
|
-
import
|
|
67
|
-
import
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import
|
|
72
|
-
import
|
|
73
|
-
import
|
|
65
|
+
import Module from './Module__';
|
|
66
|
+
import Connector from './Connector__';
|
|
67
|
+
import Integration from './Integration__';
|
|
68
|
+
import AuthLogic from './AuthLogic__';
|
|
69
|
+
import AuthLogicForCallInterface from './AuthLogicForCallInterface__';
|
|
70
|
+
import Connection from './Connection__';
|
|
71
|
+
import TriggerLauncher from './TriggerLauncher__';
|
|
72
|
+
import MetadataType from './MetadataType__';
|
|
74
73
|
|
|
75
74
|
/**
|
|
76
75
|
* 应用
|
|
@@ -79,15 +78,13 @@ import type MetadataType from './MetadataType__';
|
|
|
79
78
|
export class App extends BaseNode {
|
|
80
79
|
/** 类名 */
|
|
81
80
|
static readonly ConceptName: string = 'App';
|
|
82
|
-
|
|
83
|
-
/** 继承链 */
|
|
84
|
-
static readonly inheritanceChain: string[] = ['BaseNode'];
|
|
85
|
-
|
|
86
81
|
/**
|
|
87
|
-
*
|
|
82
|
+
* 是否为抽象类
|
|
83
|
+
* 抽象类不能产生 concept: string
|
|
88
84
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
static isAbstract: boolean = false;
|
|
86
|
+
/** 继承链 */
|
|
87
|
+
static readonly inheritanceChain: string[] = ['BaseNode'];
|
|
91
88
|
|
|
92
89
|
/**
|
|
93
90
|
* 产品概念
|
|
@@ -95,54 +92,77 @@ export class App extends BaseNode {
|
|
|
95
92
|
@property('concept')
|
|
96
93
|
// @ts-ignore
|
|
97
94
|
readonly concept!: 'App';
|
|
95
|
+
/**
|
|
96
|
+
* 应用 Id
|
|
97
|
+
*/
|
|
98
|
+
@property({
|
|
99
|
+
objectRef: '',
|
|
100
|
+
})
|
|
101
|
+
id: string = '';
|
|
98
102
|
|
|
99
103
|
/**
|
|
100
104
|
* IDE 版本
|
|
101
105
|
*/
|
|
102
|
-
@property(
|
|
103
|
-
|
|
106
|
+
@property({
|
|
107
|
+
objectRef: '',
|
|
108
|
+
})
|
|
109
|
+
ideVersion: string;
|
|
104
110
|
|
|
105
111
|
/**
|
|
106
112
|
* 应用标识
|
|
107
113
|
*/
|
|
108
|
-
@property(
|
|
109
|
-
|
|
114
|
+
@property({
|
|
115
|
+
objectRef: '',
|
|
116
|
+
})
|
|
117
|
+
name: string = '';
|
|
110
118
|
|
|
111
119
|
/**
|
|
112
120
|
* 应用标题
|
|
113
121
|
*/
|
|
114
|
-
@property(
|
|
115
|
-
|
|
122
|
+
@property({
|
|
123
|
+
objectRef: '',
|
|
124
|
+
})
|
|
125
|
+
title: string;
|
|
116
126
|
|
|
117
127
|
/**
|
|
118
128
|
* 应用图标
|
|
119
129
|
*/
|
|
120
|
-
@property(
|
|
121
|
-
|
|
130
|
+
@property({
|
|
131
|
+
objectRef: '',
|
|
132
|
+
})
|
|
133
|
+
icon: string;
|
|
122
134
|
|
|
123
135
|
/**
|
|
124
136
|
* 应用描述
|
|
125
137
|
*/
|
|
126
|
-
@property(
|
|
127
|
-
|
|
138
|
+
@property({
|
|
139
|
+
objectRef: '',
|
|
140
|
+
})
|
|
141
|
+
desc: string;
|
|
128
142
|
|
|
129
143
|
/**
|
|
130
144
|
* 域名
|
|
131
145
|
*/
|
|
132
|
-
@property(
|
|
133
|
-
|
|
146
|
+
@property({
|
|
147
|
+
objectRef: '',
|
|
148
|
+
})
|
|
149
|
+
dnsAddr: string;
|
|
134
150
|
|
|
135
151
|
/**
|
|
136
152
|
* 是否有用户中心
|
|
137
153
|
*/
|
|
138
|
-
@property(
|
|
139
|
-
|
|
154
|
+
@property({
|
|
155
|
+
objectRef: '',
|
|
156
|
+
})
|
|
157
|
+
hasUserCenter: boolean;
|
|
140
158
|
|
|
141
159
|
/**
|
|
142
160
|
* 是否有权限
|
|
143
161
|
*/
|
|
144
|
-
@property(
|
|
145
|
-
|
|
162
|
+
@property({
|
|
163
|
+
objectRef: '',
|
|
164
|
+
})
|
|
165
|
+
hasAuth: boolean;
|
|
146
166
|
|
|
147
167
|
/**
|
|
148
168
|
* 数据源列表
|
|
@@ -276,7 +296,7 @@ export class App extends BaseNode {
|
|
|
276
296
|
@property({
|
|
277
297
|
objectRef: 'Integration',
|
|
278
298
|
})
|
|
279
|
-
integration
|
|
299
|
+
integration: Integration;
|
|
280
300
|
|
|
281
301
|
/**
|
|
282
302
|
* 暴露接口的接口鉴权
|
|
@@ -341,17 +361,6 @@ export class App extends BaseNode {
|
|
|
341
361
|
return super.from(source, parentNode, parentKey) as App;
|
|
342
362
|
}
|
|
343
363
|
|
|
344
|
-
/**
|
|
345
|
-
* 从父级删除该节点
|
|
346
|
-
* @internal
|
|
347
|
-
*/
|
|
348
|
-
_delete() {
|
|
349
|
-
let params: Params = null;
|
|
350
|
-
if (this.parentNode) {
|
|
351
|
-
params = (this.parentNode as any)?.__removeApp?.(this);
|
|
352
|
-
}
|
|
353
|
-
return params;
|
|
354
|
-
}
|
|
355
364
|
/**
|
|
356
365
|
* 设置集成
|
|
357
366
|
*/
|
|
@@ -519,7 +528,7 @@ export class App extends BaseNode {
|
|
|
519
528
|
|
|
520
529
|
getStructureExistingNames(excludedList: Array<Structure> = []) {
|
|
521
530
|
const excludedSet = new Set(excludedList);
|
|
522
|
-
return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
531
|
+
return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
523
532
|
}
|
|
524
533
|
getStructureUniqueName(name = 'Structure1') {
|
|
525
534
|
return utils.unique(name, this.getStructureExistingNames(), undefined, true);
|
|
@@ -673,7 +682,7 @@ export class App extends BaseNode {
|
|
|
673
682
|
|
|
674
683
|
getEnumExistingNames(excludedList: Array<Enum> = []) {
|
|
675
684
|
const excludedSet = new Set(excludedList);
|
|
676
|
-
return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
685
|
+
return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
677
686
|
}
|
|
678
687
|
getEnumUniqueName(name = 'Enum1') {
|
|
679
688
|
return utils.unique(name, this.getEnumExistingNames(), undefined, true);
|
|
@@ -827,7 +836,7 @@ export class App extends BaseNode {
|
|
|
827
836
|
|
|
828
837
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
829
838
|
const excludedSet = new Set(excludedList);
|
|
830
|
-
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
839
|
+
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
831
840
|
}
|
|
832
841
|
getLogicUniqueName(name = 'logic1') {
|
|
833
842
|
return utils.unique(name, this.getLogicExistingNames(), undefined, true);
|
|
@@ -979,502 +988,323 @@ export class App extends BaseNode {
|
|
|
979
988
|
return node;
|
|
980
989
|
}
|
|
981
990
|
|
|
991
|
+
getOverriddenLogicExistingNames(excludedList: Array<OverriddenLogic> = []) {
|
|
992
|
+
const excludedSet = new Set(excludedList);
|
|
993
|
+
return ((this.overriddenLogics as OverriddenLogic[]) || [])
|
|
994
|
+
.filter((item) => !excludedSet.has(item))
|
|
995
|
+
.map((item) => item.name);
|
|
996
|
+
}
|
|
997
|
+
getOverriddenLogicUniqueName(name = 'overriddenLogic1') {
|
|
998
|
+
return utils.unique(name, this.getOverriddenLogicExistingNames(), undefined, true);
|
|
999
|
+
}
|
|
1000
|
+
|
|
982
1001
|
/**
|
|
983
|
-
*
|
|
1002
|
+
* 插入覆写逻辑
|
|
984
1003
|
* @internal
|
|
985
|
-
* @param name
|
|
1004
|
+
* @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
|
|
986
1005
|
*/
|
|
987
|
-
|
|
1006
|
+
_insertOverriddenLogicAt(name: string, index: number): OverriddenLogic;
|
|
988
1007
|
|
|
989
1008
|
/**
|
|
990
|
-
*
|
|
1009
|
+
* 插入覆写逻辑
|
|
991
1010
|
* @internal
|
|
992
|
-
* @param
|
|
1011
|
+
* @param overriddenLogicOptions 覆写逻辑参数
|
|
993
1012
|
*/
|
|
994
|
-
|
|
1013
|
+
_insertOverriddenLogicAt(overriddenLogicOptions: Partial<OverriddenLogic>, index: number): OverriddenLogic;
|
|
995
1014
|
|
|
996
1015
|
/**
|
|
997
|
-
*
|
|
1016
|
+
* 插入覆写逻辑
|
|
998
1017
|
* @internal
|
|
999
|
-
* @param
|
|
1018
|
+
* @param overriddenLogic 已有的覆写逻辑实例
|
|
1000
1019
|
*/
|
|
1001
|
-
|
|
1020
|
+
_insertOverriddenLogicAt(overriddenLogic: OverriddenLogic, index: number): OverriddenLogic;
|
|
1002
1021
|
|
|
1003
|
-
|
|
1004
|
-
const
|
|
1005
|
-
const relationOptions = { parentNode: this, parentKey: '
|
|
1006
|
-
const
|
|
1007
|
-
let
|
|
1022
|
+
_insertOverriddenLogicAt(options: string | Partial<OverriddenLogic> | OverriddenLogic, index: number) {
|
|
1023
|
+
const overriddenLogicOptions: any = {};
|
|
1024
|
+
const relationOptions = { parentNode: this, parentKey: 'overriddenLogics' };
|
|
1025
|
+
const OverriddenLogic = getConceptConstructor('OverriddenLogic');
|
|
1026
|
+
let overriddenLogic: OverriddenLogic;
|
|
1008
1027
|
if (!options) {
|
|
1009
|
-
|
|
1028
|
+
overriddenLogic = OverriddenLogic.from(
|
|
1010
1029
|
{
|
|
1011
|
-
...
|
|
1012
|
-
name: this.
|
|
1030
|
+
...overriddenLogicOptions,
|
|
1031
|
+
name: this.getOverriddenLogicUniqueName(),
|
|
1013
1032
|
},
|
|
1014
1033
|
this,
|
|
1015
|
-
'
|
|
1034
|
+
'overriddenLogics',
|
|
1016
1035
|
);
|
|
1017
1036
|
} else if (typeof options === 'string') {
|
|
1018
|
-
|
|
1037
|
+
overriddenLogic = OverriddenLogic.from(
|
|
1019
1038
|
{
|
|
1020
|
-
...
|
|
1039
|
+
...overriddenLogicOptions,
|
|
1021
1040
|
name: options,
|
|
1022
1041
|
},
|
|
1023
1042
|
this,
|
|
1024
|
-
'
|
|
1043
|
+
'overriddenLogics',
|
|
1025
1044
|
);
|
|
1026
|
-
} else if (asserts.
|
|
1045
|
+
} else if (asserts.isOverriddenLogic(options)) {
|
|
1027
1046
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1028
|
-
|
|
1029
|
-
Object.assign(
|
|
1047
|
+
overriddenLogic = options;
|
|
1048
|
+
Object.assign(overriddenLogic, relationOptions);
|
|
1030
1049
|
} else {
|
|
1031
|
-
|
|
1050
|
+
overriddenLogic = OverriddenLogic.from(
|
|
1032
1051
|
{
|
|
1033
|
-
...
|
|
1052
|
+
...overriddenLogicOptions,
|
|
1034
1053
|
...options,
|
|
1035
1054
|
},
|
|
1036
1055
|
this,
|
|
1037
|
-
'
|
|
1056
|
+
'overriddenLogics',
|
|
1038
1057
|
);
|
|
1039
1058
|
}
|
|
1040
|
-
this.
|
|
1041
|
-
return
|
|
1059
|
+
this.overriddenLogics.splice(index, 0, overriddenLogic);
|
|
1060
|
+
return overriddenLogic;
|
|
1042
1061
|
}
|
|
1043
1062
|
|
|
1044
1063
|
/**
|
|
1045
|
-
*
|
|
1046
|
-
* @param name
|
|
1064
|
+
* 插入覆写逻辑
|
|
1065
|
+
* @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
|
|
1047
1066
|
*/
|
|
1048
|
-
|
|
1067
|
+
insertOverriddenLogicAt(name: string, index: number): OverriddenLogic;
|
|
1049
1068
|
|
|
1050
1069
|
/**
|
|
1051
|
-
*
|
|
1052
|
-
* @param
|
|
1070
|
+
* 插入覆写逻辑
|
|
1071
|
+
* @param overriddenLogicOptions 覆写逻辑参数
|
|
1053
1072
|
*/
|
|
1054
|
-
|
|
1073
|
+
insertOverriddenLogicAt(overriddenLogicOptions: Partial<OverriddenLogic>, index: number): OverriddenLogic;
|
|
1055
1074
|
|
|
1056
1075
|
/**
|
|
1057
|
-
*
|
|
1058
|
-
* @param
|
|
1076
|
+
* 插入覆写逻辑
|
|
1077
|
+
* @param overriddenLogic 已有的覆写逻辑实例
|
|
1059
1078
|
*/
|
|
1060
|
-
|
|
1079
|
+
insertOverriddenLogicAt(overriddenLogic: OverriddenLogic, index: number): OverriddenLogic;
|
|
1061
1080
|
|
|
1062
|
-
|
|
1063
|
-
const node = this.
|
|
1081
|
+
insertOverriddenLogicAt(options: string | Partial<OverriddenLogic> | OverriddenLogic, index: number) {
|
|
1082
|
+
const node = this._insertOverriddenLogicAt(options as any, index);
|
|
1064
1083
|
node.create({
|
|
1065
1084
|
index,
|
|
1066
1085
|
parentNode: this,
|
|
1067
|
-
parentKey: '
|
|
1086
|
+
parentKey: 'overriddenLogics',
|
|
1068
1087
|
});
|
|
1069
1088
|
return node;
|
|
1070
1089
|
}
|
|
1071
1090
|
|
|
1072
1091
|
/**
|
|
1073
|
-
*
|
|
1092
|
+
* 添加覆写逻辑
|
|
1074
1093
|
* @internal
|
|
1075
|
-
* @param name
|
|
1094
|
+
* @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
|
|
1076
1095
|
*/
|
|
1077
|
-
|
|
1096
|
+
_addOverriddenLogic(name?: string): OverriddenLogic;
|
|
1078
1097
|
|
|
1079
1098
|
/**
|
|
1080
|
-
*
|
|
1099
|
+
* 添加覆写逻辑
|
|
1081
1100
|
* @internal
|
|
1082
|
-
* @param
|
|
1101
|
+
* @param overriddenLogicOptions 覆写逻辑参数
|
|
1083
1102
|
*/
|
|
1084
|
-
|
|
1103
|
+
_addOverriddenLogic(overriddenLogicOptions: Partial<OverriddenLogic>): OverriddenLogic;
|
|
1085
1104
|
|
|
1086
1105
|
/**
|
|
1087
|
-
*
|
|
1106
|
+
* 添加覆写逻辑
|
|
1088
1107
|
* @internal
|
|
1089
|
-
* @param
|
|
1108
|
+
* @param overriddenLogic 已有的覆写逻辑实例
|
|
1090
1109
|
*/
|
|
1091
|
-
|
|
1110
|
+
_addOverriddenLogic(overriddenLogic: OverriddenLogic): OverriddenLogic;
|
|
1092
1111
|
|
|
1093
|
-
|
|
1094
|
-
const index =
|
|
1095
|
-
return this.
|
|
1112
|
+
_addOverriddenLogic(options?: string | Partial<OverriddenLogic> | OverriddenLogic) {
|
|
1113
|
+
const index = 0;
|
|
1114
|
+
return this._insertOverriddenLogicAt(options as any, index);
|
|
1096
1115
|
}
|
|
1097
1116
|
|
|
1098
1117
|
/**
|
|
1099
|
-
*
|
|
1118
|
+
* 添加覆写逻辑
|
|
1100
1119
|
* @internal
|
|
1101
|
-
* @param name
|
|
1120
|
+
* @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
|
|
1102
1121
|
*/
|
|
1103
|
-
|
|
1122
|
+
addOverriddenLogic(name?: string): OverriddenLogic;
|
|
1104
1123
|
|
|
1105
1124
|
/**
|
|
1106
|
-
*
|
|
1107
|
-
* @param
|
|
1125
|
+
* 添加覆写逻辑
|
|
1126
|
+
* @param overriddenLogicOptions 覆写逻辑参数
|
|
1108
1127
|
*/
|
|
1109
|
-
|
|
1128
|
+
addOverriddenLogic(overriddenLogicOptions: Partial<OverriddenLogic>): OverriddenLogic;
|
|
1110
1129
|
|
|
1111
1130
|
/**
|
|
1112
|
-
*
|
|
1113
|
-
* @param
|
|
1131
|
+
* 添加覆写逻辑
|
|
1132
|
+
* @param overriddenLogic 已有的覆写逻辑实例
|
|
1114
1133
|
*/
|
|
1115
|
-
|
|
1134
|
+
addOverriddenLogic(overriddenLogic: OverriddenLogic): OverriddenLogic;
|
|
1116
1135
|
|
|
1117
|
-
|
|
1118
|
-
const node = this.
|
|
1119
|
-
const index = this.
|
|
1136
|
+
addOverriddenLogic(options?: string | Partial<OverriddenLogic> | OverriddenLogic) {
|
|
1137
|
+
const node = this._addOverriddenLogic(options as any);
|
|
1138
|
+
const index = this.overriddenLogics.indexOf(node);
|
|
1120
1139
|
node.create({
|
|
1121
1140
|
index,
|
|
1122
1141
|
parentNode: this,
|
|
1123
|
-
parentKey: '
|
|
1142
|
+
parentKey: 'overriddenLogics',
|
|
1124
1143
|
});
|
|
1125
1144
|
return node;
|
|
1126
1145
|
}
|
|
1127
1146
|
|
|
1147
|
+
getInterfaceExistingNames(excludedList: Array<AbstractInterface> = []) {
|
|
1148
|
+
const excludedSet = new Set(excludedList);
|
|
1149
|
+
return ((this.interfaces as AbstractInterface[]) || [])
|
|
1150
|
+
.filter((item) => !excludedSet.has(item))
|
|
1151
|
+
.map((item) => item.name);
|
|
1152
|
+
}
|
|
1153
|
+
getInterfaceUniqueName(name = 'Interface1') {
|
|
1154
|
+
return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1128
1157
|
/**
|
|
1129
|
-
*
|
|
1158
|
+
* 插入接口
|
|
1130
1159
|
* @internal
|
|
1131
|
-
* @param name
|
|
1160
|
+
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
1132
1161
|
*/
|
|
1133
|
-
|
|
1134
|
-
name: string,
|
|
1135
|
-
index: number,
|
|
1136
|
-
): AuthLogicForCallInterface;
|
|
1162
|
+
_insertInterfaceAt(name: string, index: number): AbstractInterface;
|
|
1137
1163
|
|
|
1138
1164
|
/**
|
|
1139
|
-
*
|
|
1165
|
+
* 插入接口
|
|
1140
1166
|
* @internal
|
|
1141
|
-
* @param
|
|
1167
|
+
* @param itfaceOptions 接口参数
|
|
1142
1168
|
*/
|
|
1143
|
-
|
|
1144
|
-
authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
|
|
1145
|
-
index: number,
|
|
1146
|
-
): AuthLogicForCallInterface;
|
|
1169
|
+
_insertInterfaceAt(itfaceOptions: Partial<AbstractInterface>, index: number): AbstractInterface;
|
|
1147
1170
|
|
|
1148
1171
|
/**
|
|
1149
|
-
*
|
|
1172
|
+
* 插入接口
|
|
1150
1173
|
* @internal
|
|
1151
|
-
* @param
|
|
1174
|
+
* @param itface 已有的接口实例
|
|
1152
1175
|
*/
|
|
1153
|
-
|
|
1154
|
-
authLogicForCallInterface: AuthLogicForCallInterface,
|
|
1155
|
-
index: number,
|
|
1156
|
-
): AuthLogicForCallInterface;
|
|
1176
|
+
_insertInterfaceAt(itface: AbstractInterface, index: number): AbstractInterface;
|
|
1157
1177
|
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
const relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
|
|
1164
|
-
const AuthLogicForCallInterface = getConceptConstructor('AuthLogicForCallInterface');
|
|
1165
|
-
let authLogicForCallInterface: AuthLogicForCallInterface;
|
|
1178
|
+
_insertInterfaceAt(options: string | Partial<AbstractInterface> | AbstractInterface, index: number) {
|
|
1179
|
+
const itfaceOptions: any = {};
|
|
1180
|
+
const relationOptions = { parentNode: this, parentKey: 'interfaces' };
|
|
1181
|
+
const AbstractInterface = getConceptConstructor('AbstractInterface');
|
|
1182
|
+
let itface: AbstractInterface;
|
|
1166
1183
|
if (!options) {
|
|
1167
|
-
|
|
1184
|
+
itface = AbstractInterface.from(
|
|
1168
1185
|
{
|
|
1169
|
-
...
|
|
1170
|
-
name: this.
|
|
1186
|
+
...itfaceOptions,
|
|
1187
|
+
name: this.getInterfaceUniqueName(),
|
|
1171
1188
|
},
|
|
1172
1189
|
this,
|
|
1173
|
-
'
|
|
1190
|
+
'interfaces',
|
|
1174
1191
|
);
|
|
1175
1192
|
} else if (typeof options === 'string') {
|
|
1176
|
-
|
|
1193
|
+
itface = AbstractInterface.from(
|
|
1177
1194
|
{
|
|
1178
|
-
...
|
|
1195
|
+
...itfaceOptions,
|
|
1179
1196
|
name: options,
|
|
1180
1197
|
},
|
|
1181
1198
|
this,
|
|
1182
|
-
'
|
|
1199
|
+
'interfaces',
|
|
1183
1200
|
);
|
|
1184
|
-
} else if (asserts.
|
|
1201
|
+
} else if (asserts.isAbstractInterface(options)) {
|
|
1185
1202
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1186
|
-
|
|
1187
|
-
Object.assign(
|
|
1203
|
+
itface = options;
|
|
1204
|
+
Object.assign(itface, relationOptions);
|
|
1188
1205
|
} else {
|
|
1189
|
-
|
|
1206
|
+
itface = AbstractInterface.from(
|
|
1190
1207
|
{
|
|
1191
|
-
...
|
|
1208
|
+
...itfaceOptions,
|
|
1192
1209
|
...options,
|
|
1193
1210
|
},
|
|
1194
1211
|
this,
|
|
1195
|
-
'
|
|
1212
|
+
'interfaces',
|
|
1196
1213
|
);
|
|
1197
1214
|
}
|
|
1198
|
-
this.
|
|
1199
|
-
return
|
|
1215
|
+
this.interfaces.splice(index, 0, itface);
|
|
1216
|
+
return itface;
|
|
1200
1217
|
}
|
|
1201
1218
|
|
|
1202
1219
|
/**
|
|
1203
|
-
*
|
|
1204
|
-
* @param name
|
|
1220
|
+
* 插入接口
|
|
1221
|
+
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
1205
1222
|
*/
|
|
1206
|
-
|
|
1223
|
+
insertInterfaceAt(name: string, index: number): AbstractInterface;
|
|
1207
1224
|
|
|
1208
1225
|
/**
|
|
1209
|
-
*
|
|
1210
|
-
* @param
|
|
1226
|
+
* 插入接口
|
|
1227
|
+
* @param itfaceOptions 接口参数
|
|
1211
1228
|
*/
|
|
1212
|
-
|
|
1213
|
-
authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
|
|
1214
|
-
index: number,
|
|
1215
|
-
): AuthLogicForCallInterface;
|
|
1229
|
+
insertInterfaceAt(itfaceOptions: Partial<AbstractInterface>, index: number): AbstractInterface;
|
|
1216
1230
|
|
|
1217
1231
|
/**
|
|
1218
|
-
*
|
|
1219
|
-
* @param
|
|
1232
|
+
* 插入接口
|
|
1233
|
+
* @param itface 已有的接口实例
|
|
1220
1234
|
*/
|
|
1221
|
-
|
|
1222
|
-
authLogicForCallInterface: AuthLogicForCallInterface,
|
|
1223
|
-
index: number,
|
|
1224
|
-
): AuthLogicForCallInterface;
|
|
1235
|
+
insertInterfaceAt(itface: AbstractInterface, index: number): AbstractInterface;
|
|
1225
1236
|
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
index: number,
|
|
1229
|
-
) {
|
|
1230
|
-
const node = this._insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(options as any, index);
|
|
1237
|
+
insertInterfaceAt(options: string | Partial<AbstractInterface> | AbstractInterface, index: number) {
|
|
1238
|
+
const node = this._insertInterfaceAt(options as any, index);
|
|
1231
1239
|
node.create({
|
|
1232
1240
|
index,
|
|
1233
1241
|
parentNode: this,
|
|
1234
|
-
parentKey: '
|
|
1242
|
+
parentKey: 'interfaces',
|
|
1235
1243
|
});
|
|
1236
1244
|
return node;
|
|
1237
1245
|
}
|
|
1238
1246
|
|
|
1239
1247
|
/**
|
|
1240
|
-
*
|
|
1248
|
+
* 添加接口
|
|
1241
1249
|
* @internal
|
|
1242
|
-
* @param name
|
|
1243
|
-
*/
|
|
1244
|
-
_addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(name?: string): AuthLogicForCallInterface;
|
|
1245
|
-
|
|
1246
|
-
/**
|
|
1247
|
-
* 添加调用接口的鉴权逻辑
|
|
1248
|
-
* @internal
|
|
1249
|
-
* @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
|
|
1250
|
-
*/
|
|
1251
|
-
_addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
|
|
1252
|
-
authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
|
|
1253
|
-
): AuthLogicForCallInterface;
|
|
1254
|
-
|
|
1255
|
-
/**
|
|
1256
|
-
* 添加调用接口的鉴权逻辑
|
|
1257
|
-
* @internal
|
|
1258
|
-
* @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
|
|
1259
|
-
*/
|
|
1260
|
-
_addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
|
|
1261
|
-
authLogicForCallInterface: AuthLogicForCallInterface,
|
|
1262
|
-
): AuthLogicForCallInterface;
|
|
1263
|
-
|
|
1264
|
-
_addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
|
|
1265
|
-
options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
|
|
1266
|
-
) {
|
|
1267
|
-
const index = this.authLogicsForCallInterface.length;
|
|
1268
|
-
return this._insertAuthLogicForCallInterfaceInAuthLogicsForCallInterfaceAt(options as any, index);
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
/**
|
|
1272
|
-
* 添加调用接口的鉴权逻辑
|
|
1273
|
-
* @internal
|
|
1274
|
-
* @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
|
|
1275
|
-
*/
|
|
1276
|
-
addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(name?: string): AuthLogicForCallInterface;
|
|
1277
|
-
|
|
1278
|
-
/**
|
|
1279
|
-
* 添加调用接口的鉴权逻辑
|
|
1280
|
-
* @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
|
|
1281
|
-
*/
|
|
1282
|
-
addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
|
|
1283
|
-
authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
|
|
1284
|
-
): AuthLogicForCallInterface;
|
|
1285
|
-
|
|
1286
|
-
/**
|
|
1287
|
-
* 添加调用接口的鉴权逻辑
|
|
1288
|
-
* @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
|
|
1289
|
-
*/
|
|
1290
|
-
addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
|
|
1291
|
-
authLogicForCallInterface: AuthLogicForCallInterface,
|
|
1292
|
-
): AuthLogicForCallInterface;
|
|
1293
|
-
|
|
1294
|
-
addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(
|
|
1295
|
-
options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
|
|
1296
|
-
) {
|
|
1297
|
-
const node = this._addAuthLogicForCallInterfaceInAuthLogicsForCallInterface(options as any);
|
|
1298
|
-
const index = this.authLogicsForCallInterface.indexOf(node);
|
|
1299
|
-
node.create({
|
|
1300
|
-
index,
|
|
1301
|
-
parentNode: this,
|
|
1302
|
-
parentKey: 'authLogicsForCallInterface',
|
|
1303
|
-
});
|
|
1304
|
-
return node;
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
getOverriddenLogicExistingNames(excludedList: Array<OverriddenLogic> = []) {
|
|
1308
|
-
const excludedSet = new Set(excludedList);
|
|
1309
|
-
return ((this.overriddenLogics as OverriddenLogic[]) || [])
|
|
1310
|
-
.filter((item) => !excludedSet.has(item))
|
|
1311
|
-
.map((item) => item?.name);
|
|
1312
|
-
}
|
|
1313
|
-
getOverriddenLogicUniqueName(name = 'overriddenLogic1') {
|
|
1314
|
-
return utils.unique(name, this.getOverriddenLogicExistingNames(), undefined, true);
|
|
1315
|
-
}
|
|
1316
|
-
|
|
1317
|
-
/**
|
|
1318
|
-
* 插入覆写逻辑
|
|
1319
|
-
* @internal
|
|
1320
|
-
* @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
|
|
1321
|
-
*/
|
|
1322
|
-
_insertOverriddenLogicAt(name: string, index: number): OverriddenLogic;
|
|
1323
|
-
|
|
1324
|
-
/**
|
|
1325
|
-
* 插入覆写逻辑
|
|
1326
|
-
* @internal
|
|
1327
|
-
* @param overriddenLogicOptions 覆写逻辑参数
|
|
1328
|
-
*/
|
|
1329
|
-
_insertOverriddenLogicAt(overriddenLogicOptions: Partial<OverriddenLogic>, index: number): OverriddenLogic;
|
|
1330
|
-
|
|
1331
|
-
/**
|
|
1332
|
-
* 插入覆写逻辑
|
|
1333
|
-
* @internal
|
|
1334
|
-
* @param overriddenLogic 已有的覆写逻辑实例
|
|
1335
|
-
*/
|
|
1336
|
-
_insertOverriddenLogicAt(overriddenLogic: OverriddenLogic, index: number): OverriddenLogic;
|
|
1337
|
-
|
|
1338
|
-
_insertOverriddenLogicAt(options: string | Partial<OverriddenLogic> | OverriddenLogic, index: number) {
|
|
1339
|
-
const overriddenLogicOptions: any = {};
|
|
1340
|
-
const relationOptions = { parentNode: this, parentKey: 'overriddenLogics' };
|
|
1341
|
-
const OverriddenLogic = getConceptConstructor('OverriddenLogic');
|
|
1342
|
-
let overriddenLogic: OverriddenLogic;
|
|
1343
|
-
if (!options) {
|
|
1344
|
-
overriddenLogic = OverriddenLogic.from(
|
|
1345
|
-
{
|
|
1346
|
-
...overriddenLogicOptions,
|
|
1347
|
-
name: this.getOverriddenLogicUniqueName(),
|
|
1348
|
-
},
|
|
1349
|
-
this,
|
|
1350
|
-
'overriddenLogics',
|
|
1351
|
-
);
|
|
1352
|
-
} else if (typeof options === 'string') {
|
|
1353
|
-
overriddenLogic = OverriddenLogic.from(
|
|
1354
|
-
{
|
|
1355
|
-
...overriddenLogicOptions,
|
|
1356
|
-
name: options,
|
|
1357
|
-
},
|
|
1358
|
-
this,
|
|
1359
|
-
'overriddenLogics',
|
|
1360
|
-
);
|
|
1361
|
-
} else if (asserts.isOverriddenLogic(options)) {
|
|
1362
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1363
|
-
overriddenLogic = options;
|
|
1364
|
-
Object.assign(overriddenLogic, relationOptions);
|
|
1365
|
-
} else {
|
|
1366
|
-
overriddenLogic = OverriddenLogic.from(
|
|
1367
|
-
{
|
|
1368
|
-
...overriddenLogicOptions,
|
|
1369
|
-
...options,
|
|
1370
|
-
},
|
|
1371
|
-
this,
|
|
1372
|
-
'overriddenLogics',
|
|
1373
|
-
);
|
|
1374
|
-
}
|
|
1375
|
-
this.overriddenLogics.splice(index, 0, overriddenLogic);
|
|
1376
|
-
return overriddenLogic;
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
/**
|
|
1380
|
-
* 插入覆写逻辑
|
|
1381
|
-
* @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
|
|
1382
|
-
*/
|
|
1383
|
-
insertOverriddenLogicAt(name: string, index: number): OverriddenLogic;
|
|
1384
|
-
|
|
1385
|
-
/**
|
|
1386
|
-
* 插入覆写逻辑
|
|
1387
|
-
* @param overriddenLogicOptions 覆写逻辑参数
|
|
1388
|
-
*/
|
|
1389
|
-
insertOverriddenLogicAt(overriddenLogicOptions: Partial<OverriddenLogic>, index: number): OverriddenLogic;
|
|
1390
|
-
|
|
1391
|
-
/**
|
|
1392
|
-
* 插入覆写逻辑
|
|
1393
|
-
* @param overriddenLogic 已有的覆写逻辑实例
|
|
1394
|
-
*/
|
|
1395
|
-
insertOverriddenLogicAt(overriddenLogic: OverriddenLogic, index: number): OverriddenLogic;
|
|
1396
|
-
|
|
1397
|
-
insertOverriddenLogicAt(options: string | Partial<OverriddenLogic> | OverriddenLogic, index: number) {
|
|
1398
|
-
const node = this._insertOverriddenLogicAt(options as any, index);
|
|
1399
|
-
node.create({
|
|
1400
|
-
index,
|
|
1401
|
-
parentNode: this,
|
|
1402
|
-
parentKey: 'overriddenLogics',
|
|
1403
|
-
});
|
|
1404
|
-
return node;
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
/**
|
|
1408
|
-
* 添加覆写逻辑
|
|
1409
|
-
* @internal
|
|
1410
|
-
* @param name 覆写逻辑名称,如果不填会自动生成一个唯一名称
|
|
1250
|
+
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
1411
1251
|
*/
|
|
1412
|
-
|
|
1252
|
+
_addInterface(name?: string): AbstractInterface;
|
|
1413
1253
|
|
|
1414
1254
|
/**
|
|
1415
|
-
*
|
|
1255
|
+
* 添加接口
|
|
1416
1256
|
* @internal
|
|
1417
|
-
* @param
|
|
1257
|
+
* @param itfaceOptions 接口参数
|
|
1418
1258
|
*/
|
|
1419
|
-
|
|
1259
|
+
_addInterface(itfaceOptions: Partial<AbstractInterface>): AbstractInterface;
|
|
1420
1260
|
|
|
1421
1261
|
/**
|
|
1422
|
-
*
|
|
1262
|
+
* 添加接口
|
|
1423
1263
|
* @internal
|
|
1424
|
-
* @param
|
|
1264
|
+
* @param itface 已有的接口实例
|
|
1425
1265
|
*/
|
|
1426
|
-
|
|
1266
|
+
_addInterface(itface: AbstractInterface): AbstractInterface;
|
|
1427
1267
|
|
|
1428
|
-
|
|
1268
|
+
_addInterface(options?: string | Partial<AbstractInterface> | AbstractInterface) {
|
|
1429
1269
|
const index = 0;
|
|
1430
|
-
return this.
|
|
1270
|
+
return this._insertInterfaceAt(options as any, index);
|
|
1431
1271
|
}
|
|
1432
1272
|
|
|
1433
1273
|
/**
|
|
1434
|
-
*
|
|
1274
|
+
* 添加接口
|
|
1435
1275
|
* @internal
|
|
1436
|
-
* @param name
|
|
1276
|
+
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
1437
1277
|
*/
|
|
1438
|
-
|
|
1278
|
+
addInterface(name?: string): AbstractInterface;
|
|
1439
1279
|
|
|
1440
1280
|
/**
|
|
1441
|
-
*
|
|
1442
|
-
* @param
|
|
1281
|
+
* 添加接口
|
|
1282
|
+
* @param itfaceOptions 接口参数
|
|
1443
1283
|
*/
|
|
1444
|
-
|
|
1284
|
+
addInterface(itfaceOptions: Partial<AbstractInterface>): AbstractInterface;
|
|
1445
1285
|
|
|
1446
1286
|
/**
|
|
1447
|
-
*
|
|
1448
|
-
* @param
|
|
1287
|
+
* 添加接口
|
|
1288
|
+
* @param itface 已有的接口实例
|
|
1449
1289
|
*/
|
|
1450
|
-
|
|
1290
|
+
addInterface(itface: AbstractInterface): AbstractInterface;
|
|
1451
1291
|
|
|
1452
|
-
|
|
1453
|
-
const node = this.
|
|
1454
|
-
const index = this.
|
|
1292
|
+
addInterface(options?: string | Partial<AbstractInterface> | AbstractInterface) {
|
|
1293
|
+
const node = this._addInterface(options as any);
|
|
1294
|
+
const index = this.interfaces.indexOf(node);
|
|
1455
1295
|
node.create({
|
|
1456
1296
|
index,
|
|
1457
1297
|
parentNode: this,
|
|
1458
|
-
parentKey: '
|
|
1298
|
+
parentKey: 'interfaces',
|
|
1459
1299
|
});
|
|
1460
1300
|
return node;
|
|
1461
1301
|
}
|
|
1462
1302
|
|
|
1463
|
-
getAbstractInterfaceExistingNames(excludedList: Array<AbstractInterface> = []) {
|
|
1464
|
-
const excludedSet = new Set(excludedList);
|
|
1465
|
-
return ((this.interfaces as AbstractInterface[]) || [])
|
|
1466
|
-
.filter((item) => !excludedSet.has(item))
|
|
1467
|
-
.map((item) => item?.name);
|
|
1468
|
-
}
|
|
1469
|
-
getAbstractInterfaceUniqueName(name = 'Interface1') {
|
|
1470
|
-
return utils.unique(name, this.getAbstractInterfaceExistingNames(), undefined, true);
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
1303
|
getFrontendTypeExistingNames(excludedList: Array<FrontendType> = []) {
|
|
1474
1304
|
const excludedSet = new Set(excludedList);
|
|
1475
1305
|
return ((this.frontendTypes as FrontendType[]) || [])
|
|
1476
1306
|
.filter((item) => !excludedSet.has(item))
|
|
1477
|
-
.map((item) => item
|
|
1307
|
+
.map((item) => item.name);
|
|
1478
1308
|
}
|
|
1479
1309
|
getFrontendTypeUniqueName(name = 'frontendType1') {
|
|
1480
1310
|
return utils.unique(name, this.getFrontendTypeExistingNames(), undefined, true);
|
|
@@ -1628,7 +1458,7 @@ export class App extends BaseNode {
|
|
|
1628
1458
|
|
|
1629
1459
|
getProcessExistingNames(excludedList: Array<Process> = []) {
|
|
1630
1460
|
const excludedSet = new Set(excludedList);
|
|
1631
|
-
return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
1461
|
+
return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1632
1462
|
}
|
|
1633
1463
|
getProcessUniqueName(name = 'Process1') {
|
|
1634
1464
|
return utils.unique(name, this.getProcessExistingNames(), undefined, true);
|
|
@@ -1782,7 +1612,7 @@ export class App extends BaseNode {
|
|
|
1782
1612
|
|
|
1783
1613
|
getRoleExistingNames(excludedList: Array<Role> = []) {
|
|
1784
1614
|
const excludedSet = new Set(excludedList);
|
|
1785
|
-
return ((this.roles as Role[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
1615
|
+
return ((this.roles as Role[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1786
1616
|
}
|
|
1787
1617
|
getRoleUniqueName(name = 'role1') {
|
|
1788
1618
|
return utils.unique(name, this.getRoleExistingNames(), undefined, true);
|
|
@@ -1936,7 +1766,7 @@ export class App extends BaseNode {
|
|
|
1936
1766
|
|
|
1937
1767
|
getModuleExistingNames(excludedList: Array<Module> = []) {
|
|
1938
1768
|
const excludedSet = new Set(excludedList);
|
|
1939
|
-
return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
1769
|
+
return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1940
1770
|
}
|
|
1941
1771
|
getModuleUniqueName(name = 'module1') {
|
|
1942
1772
|
return utils.unique(name, this.getModuleExistingNames(), undefined, false);
|
|
@@ -2089,1265 +1919,1276 @@ export class App extends BaseNode {
|
|
|
2089
1919
|
}
|
|
2090
1920
|
|
|
2091
1921
|
/**
|
|
2092
|
-
*
|
|
1922
|
+
* 插入模块
|
|
2093
1923
|
* @internal
|
|
2094
|
-
* @param name
|
|
1924
|
+
* @param name 模块名称,如果不填会自动生成一个唯一名称
|
|
2095
1925
|
*/
|
|
2096
|
-
|
|
1926
|
+
_insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
|
|
2097
1927
|
|
|
2098
1928
|
/**
|
|
2099
|
-
*
|
|
1929
|
+
* 插入模块
|
|
2100
1930
|
* @internal
|
|
2101
|
-
* @param
|
|
1931
|
+
* @param moduleOptions 模块参数
|
|
2102
1932
|
*/
|
|
2103
|
-
|
|
1933
|
+
_insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
|
|
2104
1934
|
|
|
2105
1935
|
/**
|
|
2106
|
-
*
|
|
1936
|
+
* 插入模块
|
|
2107
1937
|
* @internal
|
|
2108
|
-
* @param
|
|
1938
|
+
* @param module 已有的模块实例
|
|
2109
1939
|
*/
|
|
2110
|
-
|
|
1940
|
+
_insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
|
|
2111
1941
|
|
|
2112
|
-
|
|
2113
|
-
const
|
|
2114
|
-
const relationOptions = { parentNode: this, parentKey: '
|
|
2115
|
-
const
|
|
2116
|
-
let
|
|
1942
|
+
_insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
|
|
1943
|
+
const moduleOptions: any = {};
|
|
1944
|
+
const relationOptions = { parentNode: this, parentKey: 'interfaceDependencies' };
|
|
1945
|
+
const Module = getConceptConstructor('Module');
|
|
1946
|
+
let module: Module;
|
|
2117
1947
|
if (!options) {
|
|
2118
|
-
|
|
1948
|
+
module = Module.from(
|
|
2119
1949
|
{
|
|
2120
|
-
...
|
|
2121
|
-
name: this.
|
|
1950
|
+
...moduleOptions,
|
|
1951
|
+
name: this.getModuleUniqueName(),
|
|
2122
1952
|
},
|
|
2123
1953
|
this,
|
|
2124
|
-
'
|
|
1954
|
+
'interfaceDependencies',
|
|
2125
1955
|
);
|
|
2126
1956
|
} else if (typeof options === 'string') {
|
|
2127
|
-
|
|
1957
|
+
module = Module.from(
|
|
2128
1958
|
{
|
|
2129
|
-
...
|
|
1959
|
+
...moduleOptions,
|
|
2130
1960
|
name: options,
|
|
2131
1961
|
},
|
|
2132
1962
|
this,
|
|
2133
|
-
'
|
|
1963
|
+
'interfaceDependencies',
|
|
2134
1964
|
);
|
|
2135
|
-
} else if (asserts.
|
|
1965
|
+
} else if (asserts.isModule(options)) {
|
|
2136
1966
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
2137
|
-
|
|
2138
|
-
Object.assign(
|
|
1967
|
+
module = options;
|
|
1968
|
+
Object.assign(module, relationOptions);
|
|
2139
1969
|
} else {
|
|
2140
|
-
|
|
1970
|
+
module = Module.from(
|
|
2141
1971
|
{
|
|
2142
|
-
...
|
|
1972
|
+
...moduleOptions,
|
|
2143
1973
|
...options,
|
|
2144
1974
|
},
|
|
2145
1975
|
this,
|
|
2146
|
-
'
|
|
1976
|
+
'interfaceDependencies',
|
|
2147
1977
|
);
|
|
2148
1978
|
}
|
|
2149
|
-
this.
|
|
2150
|
-
return
|
|
1979
|
+
this.interfaceDependencies.splice(index, 0, module);
|
|
1980
|
+
return module;
|
|
2151
1981
|
}
|
|
2152
1982
|
|
|
2153
1983
|
/**
|
|
2154
|
-
*
|
|
2155
|
-
* @param name
|
|
2156
|
-
*/
|
|
2157
|
-
|
|
1984
|
+
* 插入模块
|
|
1985
|
+
* @param name 模块名称,如果不填会自动生成一个唯一名称
|
|
1986
|
+
*/
|
|
1987
|
+
insertModuleInInterfaceDependenciesAt(name: string, index: number): Module;
|
|
2158
1988
|
|
|
2159
1989
|
/**
|
|
2160
|
-
*
|
|
2161
|
-
* @param
|
|
1990
|
+
* 插入模块
|
|
1991
|
+
* @param moduleOptions 模块参数
|
|
2162
1992
|
*/
|
|
2163
|
-
|
|
1993
|
+
insertModuleInInterfaceDependenciesAt(moduleOptions: Partial<Module>, index: number): Module;
|
|
2164
1994
|
|
|
2165
1995
|
/**
|
|
2166
|
-
*
|
|
2167
|
-
* @param
|
|
1996
|
+
* 插入模块
|
|
1997
|
+
* @param module 已有的模块实例
|
|
2168
1998
|
*/
|
|
2169
|
-
|
|
1999
|
+
insertModuleInInterfaceDependenciesAt(module: Module, index: number): Module;
|
|
2170
2000
|
|
|
2171
|
-
|
|
2172
|
-
const node = this.
|
|
2001
|
+
insertModuleInInterfaceDependenciesAt(options: string | Partial<Module> | Module, index: number) {
|
|
2002
|
+
const node = this._insertModuleInInterfaceDependenciesAt(options as any, index);
|
|
2173
2003
|
node.create({
|
|
2174
2004
|
index,
|
|
2175
2005
|
parentNode: this,
|
|
2176
|
-
parentKey: '
|
|
2006
|
+
parentKey: 'interfaceDependencies',
|
|
2177
2007
|
});
|
|
2178
2008
|
return node;
|
|
2179
2009
|
}
|
|
2180
2010
|
|
|
2181
2011
|
/**
|
|
2182
|
-
*
|
|
2012
|
+
* 添加模块
|
|
2183
2013
|
* @internal
|
|
2184
|
-
* @param name
|
|
2014
|
+
* @param name 模块名称,如果不填会自动生成一个唯一名称
|
|
2185
2015
|
*/
|
|
2186
|
-
|
|
2016
|
+
_addModuleInInterfaceDependencies(name?: string): Module;
|
|
2187
2017
|
|
|
2188
2018
|
/**
|
|
2189
|
-
*
|
|
2019
|
+
* 添加模块
|
|
2190
2020
|
* @internal
|
|
2191
|
-
* @param
|
|
2021
|
+
* @param moduleOptions 模块参数
|
|
2192
2022
|
*/
|
|
2193
|
-
|
|
2023
|
+
_addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
|
|
2194
2024
|
|
|
2195
2025
|
/**
|
|
2196
|
-
*
|
|
2026
|
+
* 添加模块
|
|
2197
2027
|
* @internal
|
|
2198
|
-
* @param
|
|
2028
|
+
* @param module 已有的模块实例
|
|
2199
2029
|
*/
|
|
2200
|
-
|
|
2030
|
+
_addModuleInInterfaceDependencies(module: Module): Module;
|
|
2201
2031
|
|
|
2202
|
-
|
|
2203
|
-
const index = this.
|
|
2204
|
-
return this.
|
|
2032
|
+
_addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
|
|
2033
|
+
const index = this.interfaceDependencies.length;
|
|
2034
|
+
return this._insertModuleInInterfaceDependenciesAt(options as any, index);
|
|
2205
2035
|
}
|
|
2206
2036
|
|
|
2207
2037
|
/**
|
|
2208
|
-
*
|
|
2038
|
+
* 添加模块
|
|
2209
2039
|
* @internal
|
|
2210
|
-
* @param name
|
|
2040
|
+
* @param name 模块名称,如果不填会自动生成一个唯一名称
|
|
2211
2041
|
*/
|
|
2212
|
-
|
|
2042
|
+
addModuleInInterfaceDependencies(name?: string): Module;
|
|
2213
2043
|
|
|
2214
2044
|
/**
|
|
2215
|
-
*
|
|
2216
|
-
* @param
|
|
2045
|
+
* 添加模块
|
|
2046
|
+
* @param moduleOptions 模块参数
|
|
2217
2047
|
*/
|
|
2218
|
-
|
|
2048
|
+
addModuleInInterfaceDependencies(moduleOptions: Partial<Module>): Module;
|
|
2219
2049
|
|
|
2220
2050
|
/**
|
|
2221
|
-
*
|
|
2222
|
-
* @param
|
|
2051
|
+
* 添加模块
|
|
2052
|
+
* @param module 已有的模块实例
|
|
2223
2053
|
*/
|
|
2224
|
-
|
|
2054
|
+
addModuleInInterfaceDependencies(module: Module): Module;
|
|
2225
2055
|
|
|
2226
|
-
|
|
2227
|
-
const node = this.
|
|
2228
|
-
const index = this.
|
|
2056
|
+
addModuleInInterfaceDependencies(options?: string | Partial<Module> | Module) {
|
|
2057
|
+
const node = this._addModuleInInterfaceDependencies(options as any);
|
|
2058
|
+
const index = this.interfaceDependencies.indexOf(node);
|
|
2229
2059
|
node.create({
|
|
2230
2060
|
index,
|
|
2231
2061
|
parentNode: this,
|
|
2232
|
-
parentKey: '
|
|
2062
|
+
parentKey: 'interfaceDependencies',
|
|
2233
2063
|
});
|
|
2234
2064
|
return node;
|
|
2235
2065
|
}
|
|
2236
2066
|
|
|
2067
|
+
getConnectorExistingNames(excludedList: Array<Connector> = []) {
|
|
2068
|
+
const excludedSet = new Set(excludedList);
|
|
2069
|
+
return ((this.dependencies as Connector[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
2070
|
+
}
|
|
2071
|
+
getConnectorUniqueName(name = 'connector1') {
|
|
2072
|
+
return utils.unique(name, this.getConnectorExistingNames(), undefined, false);
|
|
2073
|
+
}
|
|
2074
|
+
|
|
2237
2075
|
/**
|
|
2238
|
-
*
|
|
2076
|
+
* 插入连接器
|
|
2239
2077
|
* @internal
|
|
2240
|
-
* @param name
|
|
2078
|
+
* @param name 连接器名称,如果不填会自动生成一个唯一名称
|
|
2241
2079
|
*/
|
|
2242
|
-
|
|
2080
|
+
_insertConnectorAt(name: string, index: number): Connector;
|
|
2243
2081
|
|
|
2244
2082
|
/**
|
|
2245
|
-
*
|
|
2083
|
+
* 插入连接器
|
|
2246
2084
|
* @internal
|
|
2247
|
-
* @param
|
|
2085
|
+
* @param connectorOptions 连接器参数
|
|
2248
2086
|
*/
|
|
2249
|
-
|
|
2087
|
+
_insertConnectorAt(connectorOptions: Partial<Connector>, index: number): Connector;
|
|
2250
2088
|
|
|
2251
2089
|
/**
|
|
2252
|
-
*
|
|
2090
|
+
* 插入连接器
|
|
2253
2091
|
* @internal
|
|
2254
|
-
* @param
|
|
2092
|
+
* @param connector 已有的连接器实例
|
|
2255
2093
|
*/
|
|
2256
|
-
|
|
2094
|
+
_insertConnectorAt(connector: Connector, index: number): Connector;
|
|
2257
2095
|
|
|
2258
|
-
|
|
2259
|
-
const
|
|
2260
|
-
const relationOptions = { parentNode: this, parentKey: '
|
|
2261
|
-
const
|
|
2262
|
-
let
|
|
2096
|
+
_insertConnectorAt(options: string | Partial<Connector> | Connector, index: number) {
|
|
2097
|
+
const connectorOptions: any = {};
|
|
2098
|
+
const relationOptions = { parentNode: this, parentKey: 'dependencies' };
|
|
2099
|
+
const Connector = getConceptConstructor('Connector');
|
|
2100
|
+
let connector: Connector;
|
|
2263
2101
|
if (!options) {
|
|
2264
|
-
|
|
2102
|
+
connector = Connector.from(
|
|
2265
2103
|
{
|
|
2266
|
-
...
|
|
2267
|
-
name: this.
|
|
2104
|
+
...connectorOptions,
|
|
2105
|
+
name: this.getConnectorUniqueName(),
|
|
2268
2106
|
},
|
|
2269
2107
|
this,
|
|
2270
|
-
'
|
|
2108
|
+
'dependencies',
|
|
2271
2109
|
);
|
|
2272
2110
|
} else if (typeof options === 'string') {
|
|
2273
|
-
|
|
2111
|
+
connector = Connector.from(
|
|
2274
2112
|
{
|
|
2275
|
-
...
|
|
2113
|
+
...connectorOptions,
|
|
2276
2114
|
name: options,
|
|
2277
2115
|
},
|
|
2278
2116
|
this,
|
|
2279
|
-
'
|
|
2117
|
+
'dependencies',
|
|
2280
2118
|
);
|
|
2281
|
-
} else if (asserts.
|
|
2119
|
+
} else if (asserts.isConnector(options)) {
|
|
2282
2120
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
2283
|
-
|
|
2284
|
-
Object.assign(
|
|
2121
|
+
connector = options;
|
|
2122
|
+
Object.assign(connector, relationOptions);
|
|
2285
2123
|
} else {
|
|
2286
|
-
|
|
2124
|
+
connector = Connector.from(
|
|
2287
2125
|
{
|
|
2288
|
-
...
|
|
2126
|
+
...connectorOptions,
|
|
2289
2127
|
...options,
|
|
2290
2128
|
},
|
|
2291
2129
|
this,
|
|
2292
|
-
'
|
|
2130
|
+
'dependencies',
|
|
2293
2131
|
);
|
|
2294
2132
|
}
|
|
2295
|
-
this.
|
|
2296
|
-
return
|
|
2133
|
+
this.dependencies.splice(index, 0, connector);
|
|
2134
|
+
return connector;
|
|
2297
2135
|
}
|
|
2298
2136
|
|
|
2299
2137
|
/**
|
|
2300
|
-
*
|
|
2301
|
-
* @param name
|
|
2138
|
+
* 插入连接器
|
|
2139
|
+
* @param name 连接器名称,如果不填会自动生成一个唯一名称
|
|
2302
2140
|
*/
|
|
2303
|
-
|
|
2141
|
+
insertConnectorAt(name: string, index: number): Connector;
|
|
2304
2142
|
|
|
2305
2143
|
/**
|
|
2306
|
-
*
|
|
2307
|
-
* @param
|
|
2144
|
+
* 插入连接器
|
|
2145
|
+
* @param connectorOptions 连接器参数
|
|
2308
2146
|
*/
|
|
2309
|
-
|
|
2147
|
+
insertConnectorAt(connectorOptions: Partial<Connector>, index: number): Connector;
|
|
2310
2148
|
|
|
2311
2149
|
/**
|
|
2312
|
-
*
|
|
2313
|
-
* @param
|
|
2150
|
+
* 插入连接器
|
|
2151
|
+
* @param connector 已有的连接器实例
|
|
2314
2152
|
*/
|
|
2315
|
-
|
|
2153
|
+
insertConnectorAt(connector: Connector, index: number): Connector;
|
|
2316
2154
|
|
|
2317
|
-
|
|
2318
|
-
const node = this.
|
|
2155
|
+
insertConnectorAt(options: string | Partial<Connector> | Connector, index: number) {
|
|
2156
|
+
const node = this._insertConnectorAt(options as any, index);
|
|
2319
2157
|
node.create({
|
|
2320
2158
|
index,
|
|
2321
2159
|
parentNode: this,
|
|
2322
|
-
parentKey: '
|
|
2160
|
+
parentKey: 'dependencies',
|
|
2323
2161
|
});
|
|
2324
2162
|
return node;
|
|
2325
2163
|
}
|
|
2326
2164
|
|
|
2327
2165
|
/**
|
|
2328
|
-
*
|
|
2166
|
+
* 添加连接器
|
|
2329
2167
|
* @internal
|
|
2330
|
-
* @param name
|
|
2168
|
+
* @param name 连接器名称,如果不填会自动生成一个唯一名称
|
|
2331
2169
|
*/
|
|
2332
|
-
|
|
2170
|
+
_addConnector(name?: string): Connector;
|
|
2333
2171
|
|
|
2334
2172
|
/**
|
|
2335
|
-
*
|
|
2173
|
+
* 添加连接器
|
|
2336
2174
|
* @internal
|
|
2337
|
-
* @param
|
|
2175
|
+
* @param connectorOptions 连接器参数
|
|
2338
2176
|
*/
|
|
2339
|
-
|
|
2177
|
+
_addConnector(connectorOptions: Partial<Connector>): Connector;
|
|
2340
2178
|
|
|
2341
2179
|
/**
|
|
2342
|
-
*
|
|
2180
|
+
* 添加连接器
|
|
2343
2181
|
* @internal
|
|
2344
|
-
* @param
|
|
2182
|
+
* @param connector 已有的连接器实例
|
|
2345
2183
|
*/
|
|
2346
|
-
|
|
2184
|
+
_addConnector(connector: Connector): Connector;
|
|
2347
2185
|
|
|
2348
|
-
|
|
2349
|
-
const index = this.
|
|
2350
|
-
return this.
|
|
2186
|
+
_addConnector(options?: string | Partial<Connector> | Connector) {
|
|
2187
|
+
const index = this.dependencies.length;
|
|
2188
|
+
return this._insertConnectorAt(options as any, index);
|
|
2351
2189
|
}
|
|
2352
2190
|
|
|
2353
2191
|
/**
|
|
2354
|
-
*
|
|
2192
|
+
* 添加连接器
|
|
2355
2193
|
* @internal
|
|
2356
|
-
* @param name
|
|
2194
|
+
* @param name 连接器名称,如果不填会自动生成一个唯一名称
|
|
2357
2195
|
*/
|
|
2358
|
-
|
|
2196
|
+
addConnector(name?: string): Connector;
|
|
2359
2197
|
|
|
2360
2198
|
/**
|
|
2361
|
-
*
|
|
2362
|
-
* @param
|
|
2199
|
+
* 添加连接器
|
|
2200
|
+
* @param connectorOptions 连接器参数
|
|
2363
2201
|
*/
|
|
2364
|
-
|
|
2202
|
+
addConnector(connectorOptions: Partial<Connector>): Connector;
|
|
2365
2203
|
|
|
2366
2204
|
/**
|
|
2367
|
-
*
|
|
2368
|
-
* @param
|
|
2205
|
+
* 添加连接器
|
|
2206
|
+
* @param connector 已有的连接器实例
|
|
2369
2207
|
*/
|
|
2370
|
-
|
|
2208
|
+
addConnector(connector: Connector): Connector;
|
|
2371
2209
|
|
|
2372
|
-
|
|
2373
|
-
const node = this.
|
|
2374
|
-
const index = this.
|
|
2210
|
+
addConnector(options?: string | Partial<Connector> | Connector) {
|
|
2211
|
+
const node = this._addConnector(options as any);
|
|
2212
|
+
const index = this.dependencies.indexOf(node);
|
|
2375
2213
|
node.create({
|
|
2376
2214
|
index,
|
|
2377
2215
|
parentNode: this,
|
|
2378
|
-
parentKey: '
|
|
2216
|
+
parentKey: 'dependencies',
|
|
2379
2217
|
});
|
|
2380
2218
|
return node;
|
|
2381
2219
|
}
|
|
2382
2220
|
|
|
2383
|
-
|
|
2221
|
+
getAuthLogicExistingNames(excludedList: Array<AuthLogic> = []) {
|
|
2384
2222
|
const excludedSet = new Set(excludedList);
|
|
2385
|
-
return ((this.
|
|
2386
|
-
.filter((item) => !excludedSet.has(item))
|
|
2387
|
-
.map((item) => item?.name);
|
|
2223
|
+
return ((this.authLogics as AuthLogic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
2388
2224
|
}
|
|
2389
|
-
|
|
2390
|
-
return utils.unique(name, this.
|
|
2225
|
+
getAuthLogicUniqueName(name = 'authentication1') {
|
|
2226
|
+
return utils.unique(name, this.getAuthLogicExistingNames(), undefined, false);
|
|
2391
2227
|
}
|
|
2392
2228
|
|
|
2393
2229
|
/**
|
|
2394
|
-
*
|
|
2230
|
+
* 插入鉴权逻辑
|
|
2395
2231
|
* @internal
|
|
2396
|
-
* @param name
|
|
2232
|
+
* @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
|
|
2397
2233
|
*/
|
|
2398
|
-
|
|
2234
|
+
_insertAuthLogicAt(name: string, index: number): AuthLogic;
|
|
2399
2235
|
|
|
2400
2236
|
/**
|
|
2401
|
-
*
|
|
2237
|
+
* 插入鉴权逻辑
|
|
2402
2238
|
* @internal
|
|
2403
|
-
* @param
|
|
2239
|
+
* @param authLogicOptions 鉴权逻辑参数
|
|
2404
2240
|
*/
|
|
2405
|
-
|
|
2241
|
+
_insertAuthLogicAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
|
|
2406
2242
|
|
|
2407
2243
|
/**
|
|
2408
|
-
*
|
|
2244
|
+
* 插入鉴权逻辑
|
|
2409
2245
|
* @internal
|
|
2410
|
-
* @param
|
|
2246
|
+
* @param authLogic 已有的鉴权逻辑实例
|
|
2411
2247
|
*/
|
|
2412
|
-
|
|
2248
|
+
_insertAuthLogicAt(authLogic: AuthLogic, index: number): AuthLogic;
|
|
2413
2249
|
|
|
2414
|
-
|
|
2415
|
-
const
|
|
2416
|
-
const relationOptions = { parentNode: this, parentKey: '
|
|
2417
|
-
const
|
|
2418
|
-
let
|
|
2250
|
+
_insertAuthLogicAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
|
|
2251
|
+
const authLogicOptions: any = {};
|
|
2252
|
+
const relationOptions = { parentNode: this, parentKey: 'authLogics' };
|
|
2253
|
+
const AuthLogic = getConceptConstructor('AuthLogic');
|
|
2254
|
+
let authLogic: AuthLogic;
|
|
2419
2255
|
if (!options) {
|
|
2420
|
-
|
|
2256
|
+
authLogic = AuthLogic.from(
|
|
2421
2257
|
{
|
|
2422
|
-
...
|
|
2423
|
-
name: this.
|
|
2258
|
+
...authLogicOptions,
|
|
2259
|
+
name: this.getAuthLogicUniqueName(),
|
|
2424
2260
|
},
|
|
2425
2261
|
this,
|
|
2426
|
-
'
|
|
2262
|
+
'authLogics',
|
|
2427
2263
|
);
|
|
2428
2264
|
} else if (typeof options === 'string') {
|
|
2429
|
-
|
|
2265
|
+
authLogic = AuthLogic.from(
|
|
2430
2266
|
{
|
|
2431
|
-
...
|
|
2267
|
+
...authLogicOptions,
|
|
2432
2268
|
name: options,
|
|
2433
2269
|
},
|
|
2434
2270
|
this,
|
|
2435
|
-
'
|
|
2271
|
+
'authLogics',
|
|
2436
2272
|
);
|
|
2437
|
-
} else if (asserts.
|
|
2273
|
+
} else if (asserts.isAuthLogic(options)) {
|
|
2438
2274
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
2439
|
-
|
|
2440
|
-
Object.assign(
|
|
2275
|
+
authLogic = options;
|
|
2276
|
+
Object.assign(authLogic, relationOptions);
|
|
2441
2277
|
} else {
|
|
2442
|
-
|
|
2278
|
+
authLogic = AuthLogic.from(
|
|
2443
2279
|
{
|
|
2444
|
-
...
|
|
2280
|
+
...authLogicOptions,
|
|
2445
2281
|
...options,
|
|
2446
2282
|
},
|
|
2447
2283
|
this,
|
|
2448
|
-
'
|
|
2284
|
+
'authLogics',
|
|
2449
2285
|
);
|
|
2450
2286
|
}
|
|
2451
|
-
this.
|
|
2452
|
-
return
|
|
2287
|
+
this.authLogics.splice(index, 0, authLogic);
|
|
2288
|
+
return authLogic;
|
|
2453
2289
|
}
|
|
2454
2290
|
|
|
2455
2291
|
/**
|
|
2456
|
-
*
|
|
2457
|
-
* @param name
|
|
2292
|
+
* 插入鉴权逻辑
|
|
2293
|
+
* @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
|
|
2458
2294
|
*/
|
|
2459
|
-
|
|
2295
|
+
insertAuthLogicAt(name: string, index: number): AuthLogic;
|
|
2460
2296
|
|
|
2461
2297
|
/**
|
|
2462
|
-
*
|
|
2463
|
-
* @param
|
|
2298
|
+
* 插入鉴权逻辑
|
|
2299
|
+
* @param authLogicOptions 鉴权逻辑参数
|
|
2464
2300
|
*/
|
|
2465
|
-
|
|
2301
|
+
insertAuthLogicAt(authLogicOptions: Partial<AuthLogic>, index: number): AuthLogic;
|
|
2466
2302
|
|
|
2467
2303
|
/**
|
|
2468
|
-
*
|
|
2469
|
-
* @param
|
|
2304
|
+
* 插入鉴权逻辑
|
|
2305
|
+
* @param authLogic 已有的鉴权逻辑实例
|
|
2470
2306
|
*/
|
|
2471
|
-
|
|
2307
|
+
insertAuthLogicAt(authLogic: AuthLogic, index: number): AuthLogic;
|
|
2472
2308
|
|
|
2473
|
-
|
|
2474
|
-
const node = this.
|
|
2309
|
+
insertAuthLogicAt(options: string | Partial<AuthLogic> | AuthLogic, index: number) {
|
|
2310
|
+
const node = this._insertAuthLogicAt(options as any, index);
|
|
2475
2311
|
node.create({
|
|
2476
2312
|
index,
|
|
2477
2313
|
parentNode: this,
|
|
2478
|
-
parentKey: '
|
|
2314
|
+
parentKey: 'authLogics',
|
|
2479
2315
|
});
|
|
2480
2316
|
return node;
|
|
2481
2317
|
}
|
|
2482
2318
|
|
|
2483
2319
|
/**
|
|
2484
|
-
*
|
|
2320
|
+
* 添加鉴权逻辑
|
|
2485
2321
|
* @internal
|
|
2486
|
-
* @param name
|
|
2322
|
+
* @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
|
|
2487
2323
|
*/
|
|
2488
|
-
|
|
2324
|
+
_addAuthLogic(name?: string): AuthLogic;
|
|
2489
2325
|
|
|
2490
2326
|
/**
|
|
2491
|
-
*
|
|
2327
|
+
* 添加鉴权逻辑
|
|
2492
2328
|
* @internal
|
|
2493
|
-
* @param
|
|
2329
|
+
* @param authLogicOptions 鉴权逻辑参数
|
|
2494
2330
|
*/
|
|
2495
|
-
|
|
2331
|
+
_addAuthLogic(authLogicOptions: Partial<AuthLogic>): AuthLogic;
|
|
2496
2332
|
|
|
2497
2333
|
/**
|
|
2498
|
-
*
|
|
2334
|
+
* 添加鉴权逻辑
|
|
2499
2335
|
* @internal
|
|
2500
|
-
* @param
|
|
2336
|
+
* @param authLogic 已有的鉴权逻辑实例
|
|
2501
2337
|
*/
|
|
2502
|
-
|
|
2338
|
+
_addAuthLogic(authLogic: AuthLogic): AuthLogic;
|
|
2503
2339
|
|
|
2504
|
-
|
|
2505
|
-
const index = this.
|
|
2506
|
-
return this.
|
|
2340
|
+
_addAuthLogic(options?: string | Partial<AuthLogic> | AuthLogic) {
|
|
2341
|
+
const index = this.authLogics.length;
|
|
2342
|
+
return this._insertAuthLogicAt(options as any, index);
|
|
2507
2343
|
}
|
|
2508
2344
|
|
|
2509
2345
|
/**
|
|
2510
|
-
*
|
|
2346
|
+
* 添加鉴权逻辑
|
|
2511
2347
|
* @internal
|
|
2512
|
-
* @param name
|
|
2348
|
+
* @param name 鉴权逻辑名称,如果不填会自动生成一个唯一名称
|
|
2513
2349
|
*/
|
|
2514
|
-
|
|
2350
|
+
addAuthLogic(name?: string): AuthLogic;
|
|
2515
2351
|
|
|
2516
2352
|
/**
|
|
2517
|
-
*
|
|
2518
|
-
* @param
|
|
2353
|
+
* 添加鉴权逻辑
|
|
2354
|
+
* @param authLogicOptions 鉴权逻辑参数
|
|
2519
2355
|
*/
|
|
2520
|
-
|
|
2356
|
+
addAuthLogic(authLogicOptions: Partial<AuthLogic>): AuthLogic;
|
|
2521
2357
|
|
|
2522
2358
|
/**
|
|
2523
|
-
*
|
|
2524
|
-
* @param
|
|
2359
|
+
* 添加鉴权逻辑
|
|
2360
|
+
* @param authLogic 已有的鉴权逻辑实例
|
|
2525
2361
|
*/
|
|
2526
|
-
|
|
2362
|
+
addAuthLogic(authLogic: AuthLogic): AuthLogic;
|
|
2527
2363
|
|
|
2528
|
-
|
|
2529
|
-
const node = this.
|
|
2530
|
-
const index = this.
|
|
2364
|
+
addAuthLogic(options?: string | Partial<AuthLogic> | AuthLogic) {
|
|
2365
|
+
const node = this._addAuthLogic(options as any);
|
|
2366
|
+
const index = this.authLogics.indexOf(node);
|
|
2531
2367
|
node.create({
|
|
2532
2368
|
index,
|
|
2533
2369
|
parentNode: this,
|
|
2534
|
-
parentKey: '
|
|
2370
|
+
parentKey: 'authLogics',
|
|
2535
2371
|
});
|
|
2536
2372
|
return node;
|
|
2537
2373
|
}
|
|
2538
2374
|
|
|
2539
|
-
|
|
2375
|
+
getAuthLogicForCallInterfaceExistingNames(excludedList: Array<AuthLogicForCallInterface> = []) {
|
|
2540
2376
|
const excludedSet = new Set(excludedList);
|
|
2541
|
-
return ((this.
|
|
2377
|
+
return ((this.authLogicsForCallInterface as AuthLogicForCallInterface[]) || [])
|
|
2542
2378
|
.filter((item) => !excludedSet.has(item))
|
|
2543
|
-
.map((item) => item
|
|
2379
|
+
.map((item) => item.name);
|
|
2544
2380
|
}
|
|
2545
|
-
|
|
2546
|
-
return utils.unique(name, this.
|
|
2381
|
+
getAuthLogicForCallInterfaceUniqueName(name = 'authLogicForCallInterface1') {
|
|
2382
|
+
return utils.unique(name, this.getAuthLogicForCallInterfaceExistingNames(), undefined, false);
|
|
2547
2383
|
}
|
|
2548
2384
|
|
|
2549
2385
|
/**
|
|
2550
|
-
*
|
|
2386
|
+
* 插入调用接口的鉴权逻辑
|
|
2551
2387
|
* @internal
|
|
2552
|
-
* @param name
|
|
2388
|
+
* @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
|
|
2553
2389
|
*/
|
|
2554
|
-
|
|
2390
|
+
_insertAuthLogicForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
|
|
2555
2391
|
|
|
2556
2392
|
/**
|
|
2557
|
-
*
|
|
2393
|
+
* 插入调用接口的鉴权逻辑
|
|
2558
2394
|
* @internal
|
|
2559
|
-
* @param
|
|
2395
|
+
* @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
|
|
2560
2396
|
*/
|
|
2561
|
-
|
|
2397
|
+
_insertAuthLogicForCallInterfaceAt(
|
|
2398
|
+
authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
|
|
2399
|
+
index: number,
|
|
2400
|
+
): AuthLogicForCallInterface;
|
|
2562
2401
|
|
|
2563
2402
|
/**
|
|
2564
|
-
*
|
|
2403
|
+
* 插入调用接口的鉴权逻辑
|
|
2565
2404
|
* @internal
|
|
2566
|
-
* @param
|
|
2405
|
+
* @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
|
|
2567
2406
|
*/
|
|
2568
|
-
|
|
2407
|
+
_insertAuthLogicForCallInterfaceAt(
|
|
2408
|
+
authLogicForCallInterface: AuthLogicForCallInterface,
|
|
2409
|
+
index: number,
|
|
2410
|
+
): AuthLogicForCallInterface;
|
|
2569
2411
|
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2412
|
+
_insertAuthLogicForCallInterfaceAt(
|
|
2413
|
+
options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
|
|
2414
|
+
index: number,
|
|
2415
|
+
) {
|
|
2416
|
+
const authLogicForCallInterfaceOptions: any = {};
|
|
2417
|
+
const relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
|
|
2418
|
+
const AuthLogicForCallInterface = getConceptConstructor('AuthLogicForCallInterface');
|
|
2419
|
+
let authLogicForCallInterface: AuthLogicForCallInterface;
|
|
2575
2420
|
if (!options) {
|
|
2576
|
-
|
|
2421
|
+
authLogicForCallInterface = AuthLogicForCallInterface.from(
|
|
2577
2422
|
{
|
|
2578
|
-
...
|
|
2579
|
-
name: this.
|
|
2423
|
+
...authLogicForCallInterfaceOptions,
|
|
2424
|
+
name: this.getAuthLogicForCallInterfaceUniqueName(),
|
|
2580
2425
|
},
|
|
2581
2426
|
this,
|
|
2582
|
-
'
|
|
2427
|
+
'authLogicsForCallInterface',
|
|
2583
2428
|
);
|
|
2584
2429
|
} else if (typeof options === 'string') {
|
|
2585
|
-
|
|
2430
|
+
authLogicForCallInterface = AuthLogicForCallInterface.from(
|
|
2586
2431
|
{
|
|
2587
|
-
...
|
|
2432
|
+
...authLogicForCallInterfaceOptions,
|
|
2588
2433
|
name: options,
|
|
2589
2434
|
},
|
|
2590
2435
|
this,
|
|
2591
|
-
'
|
|
2436
|
+
'authLogicsForCallInterface',
|
|
2592
2437
|
);
|
|
2593
|
-
} else if (asserts.
|
|
2438
|
+
} else if (asserts.isAuthLogicForCallInterface(options)) {
|
|
2594
2439
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
2595
|
-
|
|
2596
|
-
Object.assign(
|
|
2440
|
+
authLogicForCallInterface = options;
|
|
2441
|
+
Object.assign(authLogicForCallInterface, relationOptions);
|
|
2597
2442
|
} else {
|
|
2598
|
-
|
|
2443
|
+
authLogicForCallInterface = AuthLogicForCallInterface.from(
|
|
2599
2444
|
{
|
|
2600
|
-
...
|
|
2445
|
+
...authLogicForCallInterfaceOptions,
|
|
2601
2446
|
...options,
|
|
2602
2447
|
},
|
|
2603
2448
|
this,
|
|
2604
|
-
'
|
|
2449
|
+
'authLogicsForCallInterface',
|
|
2605
2450
|
);
|
|
2606
2451
|
}
|
|
2607
|
-
this.
|
|
2608
|
-
return
|
|
2452
|
+
this.authLogicsForCallInterface.splice(index, 0, authLogicForCallInterface);
|
|
2453
|
+
return authLogicForCallInterface;
|
|
2609
2454
|
}
|
|
2610
2455
|
|
|
2611
2456
|
/**
|
|
2612
|
-
*
|
|
2613
|
-
* @param name
|
|
2457
|
+
* 插入调用接口的鉴权逻辑
|
|
2458
|
+
* @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
|
|
2614
2459
|
*/
|
|
2615
|
-
|
|
2460
|
+
insertAuthLogicForCallInterfaceAt(name: string, index: number): AuthLogicForCallInterface;
|
|
2616
2461
|
|
|
2617
2462
|
/**
|
|
2618
|
-
*
|
|
2619
|
-
* @param
|
|
2463
|
+
* 插入调用接口的鉴权逻辑
|
|
2464
|
+
* @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
|
|
2620
2465
|
*/
|
|
2621
|
-
|
|
2466
|
+
insertAuthLogicForCallInterfaceAt(
|
|
2467
|
+
authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
|
|
2468
|
+
index: number,
|
|
2469
|
+
): AuthLogicForCallInterface;
|
|
2622
2470
|
|
|
2623
2471
|
/**
|
|
2624
|
-
*
|
|
2625
|
-
* @param
|
|
2472
|
+
* 插入调用接口的鉴权逻辑
|
|
2473
|
+
* @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
|
|
2626
2474
|
*/
|
|
2627
|
-
|
|
2475
|
+
insertAuthLogicForCallInterfaceAt(
|
|
2476
|
+
authLogicForCallInterface: AuthLogicForCallInterface,
|
|
2477
|
+
index: number,
|
|
2478
|
+
): AuthLogicForCallInterface;
|
|
2628
2479
|
|
|
2629
|
-
|
|
2630
|
-
|
|
2480
|
+
insertAuthLogicForCallInterfaceAt(
|
|
2481
|
+
options: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface,
|
|
2482
|
+
index: number,
|
|
2483
|
+
) {
|
|
2484
|
+
const node = this._insertAuthLogicForCallInterfaceAt(options as any, index);
|
|
2631
2485
|
node.create({
|
|
2632
2486
|
index,
|
|
2633
2487
|
parentNode: this,
|
|
2634
|
-
parentKey: '
|
|
2488
|
+
parentKey: 'authLogicsForCallInterface',
|
|
2635
2489
|
});
|
|
2636
2490
|
return node;
|
|
2637
2491
|
}
|
|
2638
2492
|
|
|
2639
2493
|
/**
|
|
2640
|
-
*
|
|
2494
|
+
* 添加调用接口的鉴权逻辑
|
|
2641
2495
|
* @internal
|
|
2642
|
-
* @param name
|
|
2496
|
+
* @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
|
|
2643
2497
|
*/
|
|
2644
|
-
|
|
2498
|
+
_addAuthLogicForCallInterface(name?: string): AuthLogicForCallInterface;
|
|
2645
2499
|
|
|
2646
2500
|
/**
|
|
2647
|
-
*
|
|
2501
|
+
* 添加调用接口的鉴权逻辑
|
|
2648
2502
|
* @internal
|
|
2649
|
-
* @param
|
|
2503
|
+
* @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
|
|
2650
2504
|
*/
|
|
2651
|
-
|
|
2505
|
+
_addAuthLogicForCallInterface(
|
|
2506
|
+
authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
|
|
2507
|
+
): AuthLogicForCallInterface;
|
|
2652
2508
|
|
|
2653
2509
|
/**
|
|
2654
|
-
*
|
|
2510
|
+
* 添加调用接口的鉴权逻辑
|
|
2655
2511
|
* @internal
|
|
2656
|
-
* @param
|
|
2512
|
+
* @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
|
|
2657
2513
|
*/
|
|
2658
|
-
|
|
2514
|
+
_addAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): AuthLogicForCallInterface;
|
|
2659
2515
|
|
|
2660
|
-
|
|
2661
|
-
const index = this.
|
|
2662
|
-
return this.
|
|
2516
|
+
_addAuthLogicForCallInterface(options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface) {
|
|
2517
|
+
const index = this.authLogicsForCallInterface.length;
|
|
2518
|
+
return this._insertAuthLogicForCallInterfaceAt(options as any, index);
|
|
2663
2519
|
}
|
|
2664
2520
|
|
|
2665
2521
|
/**
|
|
2666
|
-
*
|
|
2522
|
+
* 添加调用接口的鉴权逻辑
|
|
2667
2523
|
* @internal
|
|
2668
|
-
* @param name
|
|
2524
|
+
* @param name 调用接口的鉴权逻辑名称,如果不填会自动生成一个唯一名称
|
|
2669
2525
|
*/
|
|
2670
|
-
|
|
2526
|
+
addAuthLogicForCallInterface(name?: string): AuthLogicForCallInterface;
|
|
2671
2527
|
|
|
2672
2528
|
/**
|
|
2673
|
-
*
|
|
2674
|
-
* @param
|
|
2529
|
+
* 添加调用接口的鉴权逻辑
|
|
2530
|
+
* @param authLogicForCallInterfaceOptions 调用接口的鉴权逻辑参数
|
|
2675
2531
|
*/
|
|
2676
|
-
|
|
2532
|
+
addAuthLogicForCallInterface(
|
|
2533
|
+
authLogicForCallInterfaceOptions: Partial<AuthLogicForCallInterface>,
|
|
2534
|
+
): AuthLogicForCallInterface;
|
|
2677
2535
|
|
|
2678
2536
|
/**
|
|
2679
|
-
*
|
|
2680
|
-
* @param
|
|
2537
|
+
* 添加调用接口的鉴权逻辑
|
|
2538
|
+
* @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
|
|
2681
2539
|
*/
|
|
2682
|
-
|
|
2540
|
+
addAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): AuthLogicForCallInterface;
|
|
2683
2541
|
|
|
2684
|
-
|
|
2685
|
-
const node = this.
|
|
2686
|
-
const index = this.
|
|
2542
|
+
addAuthLogicForCallInterface(options?: string | Partial<AuthLogicForCallInterface> | AuthLogicForCallInterface) {
|
|
2543
|
+
const node = this._addAuthLogicForCallInterface(options as any);
|
|
2544
|
+
const index = this.authLogicsForCallInterface.indexOf(node);
|
|
2687
2545
|
node.create({
|
|
2688
2546
|
index,
|
|
2689
2547
|
parentNode: this,
|
|
2690
|
-
parentKey: '
|
|
2548
|
+
parentKey: 'authLogicsForCallInterface',
|
|
2691
2549
|
});
|
|
2692
2550
|
return node;
|
|
2693
2551
|
}
|
|
2694
2552
|
|
|
2695
|
-
|
|
2553
|
+
getConnectionExistingNames(excludedList: Array<Connection> = []) {
|
|
2696
2554
|
const excludedSet = new Set(excludedList);
|
|
2697
|
-
return ((this.
|
|
2698
|
-
.filter((item) => !excludedSet.has(item))
|
|
2699
|
-
.map((item) => item?.name);
|
|
2555
|
+
return ((this.connections as Connection[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
2700
2556
|
}
|
|
2701
|
-
|
|
2702
|
-
return utils.unique(name, this.
|
|
2557
|
+
getConnectionUniqueName(name = 'connection1') {
|
|
2558
|
+
return utils.unique(name, this.getConnectionExistingNames(), undefined, false);
|
|
2703
2559
|
}
|
|
2704
2560
|
|
|
2705
2561
|
/**
|
|
2706
|
-
*
|
|
2562
|
+
* 插入连接
|
|
2707
2563
|
* @internal
|
|
2708
|
-
* @param name
|
|
2564
|
+
* @param name 连接名称,如果不填会自动生成一个唯一名称
|
|
2709
2565
|
*/
|
|
2710
|
-
|
|
2566
|
+
_insertConnectionAt(name: string, index: number): Connection;
|
|
2711
2567
|
|
|
2712
2568
|
/**
|
|
2713
|
-
*
|
|
2569
|
+
* 插入连接
|
|
2714
2570
|
* @internal
|
|
2715
|
-
* @param
|
|
2571
|
+
* @param connectionOptions 连接参数
|
|
2716
2572
|
*/
|
|
2717
|
-
|
|
2573
|
+
_insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
|
|
2718
2574
|
|
|
2719
2575
|
/**
|
|
2720
|
-
*
|
|
2576
|
+
* 插入连接
|
|
2721
2577
|
* @internal
|
|
2722
|
-
* @param
|
|
2578
|
+
* @param connection 已有的连接实例
|
|
2723
2579
|
*/
|
|
2724
|
-
|
|
2580
|
+
_insertConnectionAt(connection: Connection, index: number): Connection;
|
|
2725
2581
|
|
|
2726
|
-
|
|
2727
|
-
const
|
|
2728
|
-
const relationOptions = { parentNode: this, parentKey: '
|
|
2729
|
-
const
|
|
2730
|
-
let
|
|
2582
|
+
_insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
|
|
2583
|
+
const connectionOptions: any = {};
|
|
2584
|
+
const relationOptions = { parentNode: this, parentKey: 'connections' };
|
|
2585
|
+
const Connection = getConceptConstructor('Connection');
|
|
2586
|
+
let connection: Connection;
|
|
2731
2587
|
if (!options) {
|
|
2732
|
-
|
|
2588
|
+
connection = Connection.from(
|
|
2733
2589
|
{
|
|
2734
|
-
...
|
|
2735
|
-
name: this.
|
|
2590
|
+
...connectionOptions,
|
|
2591
|
+
name: this.getConnectionUniqueName(),
|
|
2736
2592
|
},
|
|
2737
2593
|
this,
|
|
2738
|
-
'
|
|
2594
|
+
'connections',
|
|
2739
2595
|
);
|
|
2740
2596
|
} else if (typeof options === 'string') {
|
|
2741
|
-
|
|
2597
|
+
connection = Connection.from(
|
|
2742
2598
|
{
|
|
2743
|
-
...
|
|
2599
|
+
...connectionOptions,
|
|
2744
2600
|
name: options,
|
|
2745
2601
|
},
|
|
2746
2602
|
this,
|
|
2747
|
-
'
|
|
2603
|
+
'connections',
|
|
2748
2604
|
);
|
|
2749
|
-
} else if (asserts.
|
|
2605
|
+
} else if (asserts.isConnection(options)) {
|
|
2750
2606
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
2751
|
-
|
|
2752
|
-
Object.assign(
|
|
2607
|
+
connection = options;
|
|
2608
|
+
Object.assign(connection, relationOptions);
|
|
2753
2609
|
} else {
|
|
2754
|
-
|
|
2610
|
+
connection = Connection.from(
|
|
2755
2611
|
{
|
|
2756
|
-
...
|
|
2612
|
+
...connectionOptions,
|
|
2757
2613
|
...options,
|
|
2758
2614
|
},
|
|
2759
2615
|
this,
|
|
2760
|
-
'
|
|
2616
|
+
'connections',
|
|
2761
2617
|
);
|
|
2762
2618
|
}
|
|
2763
|
-
this.
|
|
2764
|
-
return
|
|
2619
|
+
this.connections.splice(index, 0, connection);
|
|
2620
|
+
return connection;
|
|
2765
2621
|
}
|
|
2766
2622
|
|
|
2767
2623
|
/**
|
|
2768
|
-
*
|
|
2769
|
-
* @param name
|
|
2624
|
+
* 插入连接
|
|
2625
|
+
* @param name 连接名称,如果不填会自动生成一个唯一名称
|
|
2770
2626
|
*/
|
|
2771
|
-
|
|
2627
|
+
insertConnectionAt(name: string, index: number): Connection;
|
|
2772
2628
|
|
|
2773
2629
|
/**
|
|
2774
|
-
*
|
|
2775
|
-
* @param
|
|
2630
|
+
* 插入连接
|
|
2631
|
+
* @param connectionOptions 连接参数
|
|
2776
2632
|
*/
|
|
2777
|
-
|
|
2633
|
+
insertConnectionAt(connectionOptions: Partial<Connection>, index: number): Connection;
|
|
2778
2634
|
|
|
2779
2635
|
/**
|
|
2780
|
-
*
|
|
2781
|
-
* @param
|
|
2636
|
+
* 插入连接
|
|
2637
|
+
* @param connection 已有的连接实例
|
|
2782
2638
|
*/
|
|
2783
|
-
|
|
2639
|
+
insertConnectionAt(connection: Connection, index: number): Connection;
|
|
2784
2640
|
|
|
2785
|
-
|
|
2786
|
-
const node = this.
|
|
2641
|
+
insertConnectionAt(options: string | Partial<Connection> | Connection, index: number) {
|
|
2642
|
+
const node = this._insertConnectionAt(options as any, index);
|
|
2787
2643
|
node.create({
|
|
2788
2644
|
index,
|
|
2789
2645
|
parentNode: this,
|
|
2790
|
-
parentKey: '
|
|
2646
|
+
parentKey: 'connections',
|
|
2791
2647
|
});
|
|
2792
2648
|
return node;
|
|
2793
2649
|
}
|
|
2794
2650
|
|
|
2795
2651
|
/**
|
|
2796
|
-
*
|
|
2652
|
+
* 添加连接
|
|
2797
2653
|
* @internal
|
|
2798
|
-
* @param name
|
|
2654
|
+
* @param name 连接名称,如果不填会自动生成一个唯一名称
|
|
2799
2655
|
*/
|
|
2800
|
-
|
|
2656
|
+
_addConnection(name?: string): Connection;
|
|
2801
2657
|
|
|
2802
2658
|
/**
|
|
2803
|
-
*
|
|
2659
|
+
* 添加连接
|
|
2804
2660
|
* @internal
|
|
2805
|
-
* @param
|
|
2661
|
+
* @param connectionOptions 连接参数
|
|
2806
2662
|
*/
|
|
2807
|
-
|
|
2663
|
+
_addConnection(connectionOptions: Partial<Connection>): Connection;
|
|
2808
2664
|
|
|
2809
2665
|
/**
|
|
2810
|
-
*
|
|
2666
|
+
* 添加连接
|
|
2811
2667
|
* @internal
|
|
2812
|
-
* @param
|
|
2668
|
+
* @param connection 已有的连接实例
|
|
2813
2669
|
*/
|
|
2814
|
-
|
|
2670
|
+
_addConnection(connection: Connection): Connection;
|
|
2815
2671
|
|
|
2816
|
-
|
|
2817
|
-
const index =
|
|
2818
|
-
return this.
|
|
2672
|
+
_addConnection(options?: string | Partial<Connection> | Connection) {
|
|
2673
|
+
const index = this.connections.length;
|
|
2674
|
+
return this._insertConnectionAt(options as any, index);
|
|
2819
2675
|
}
|
|
2820
2676
|
|
|
2821
2677
|
/**
|
|
2822
|
-
*
|
|
2678
|
+
* 添加连接
|
|
2823
2679
|
* @internal
|
|
2824
|
-
* @param name
|
|
2680
|
+
* @param name 连接名称,如果不填会自动生成一个唯一名称
|
|
2825
2681
|
*/
|
|
2826
|
-
|
|
2682
|
+
addConnection(name?: string): Connection;
|
|
2827
2683
|
|
|
2828
2684
|
/**
|
|
2829
|
-
*
|
|
2830
|
-
* @param
|
|
2685
|
+
* 添加连接
|
|
2686
|
+
* @param connectionOptions 连接参数
|
|
2831
2687
|
*/
|
|
2832
|
-
|
|
2688
|
+
addConnection(connectionOptions: Partial<Connection>): Connection;
|
|
2833
2689
|
|
|
2834
2690
|
/**
|
|
2835
|
-
*
|
|
2836
|
-
* @param
|
|
2691
|
+
* 添加连接
|
|
2692
|
+
* @param connection 已有的连接实例
|
|
2837
2693
|
*/
|
|
2838
|
-
|
|
2694
|
+
addConnection(connection: Connection): Connection;
|
|
2839
2695
|
|
|
2840
|
-
|
|
2841
|
-
const node = this.
|
|
2842
|
-
const index = this.
|
|
2696
|
+
addConnection(options?: string | Partial<Connection> | Connection) {
|
|
2697
|
+
const node = this._addConnection(options as any);
|
|
2698
|
+
const index = this.connections.indexOf(node);
|
|
2843
2699
|
node.create({
|
|
2844
2700
|
index,
|
|
2845
2701
|
parentNode: this,
|
|
2846
|
-
parentKey: '
|
|
2702
|
+
parentKey: 'connections',
|
|
2847
2703
|
});
|
|
2848
2704
|
return node;
|
|
2849
2705
|
}
|
|
2850
2706
|
|
|
2707
|
+
getTriggerLauncherExistingNames(excludedList: Array<TriggerLauncher> = []) {
|
|
2708
|
+
const excludedSet = new Set(excludedList);
|
|
2709
|
+
return ((this.triggerLaunchers as TriggerLauncher[]) || [])
|
|
2710
|
+
.filter((item) => !excludedSet.has(item))
|
|
2711
|
+
.map((item) => item.name);
|
|
2712
|
+
}
|
|
2713
|
+
getTriggerLauncherUniqueName(name = 'triggerLauncher1') {
|
|
2714
|
+
return utils.unique(name, this.getTriggerLauncherExistingNames(), undefined, false);
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2851
2717
|
/**
|
|
2852
|
-
*
|
|
2853
|
-
* @
|
|
2718
|
+
* 插入触发器启动器
|
|
2719
|
+
* @internal
|
|
2720
|
+
* @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
|
|
2854
2721
|
*/
|
|
2855
|
-
|
|
2722
|
+
_insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
|
|
2856
2723
|
|
|
2857
2724
|
/**
|
|
2858
|
-
*
|
|
2859
|
-
* @
|
|
2725
|
+
* 插入触发器启动器
|
|
2726
|
+
* @internal
|
|
2727
|
+
* @param triggerLauncherOptions 触发器启动器参数
|
|
2860
2728
|
*/
|
|
2861
|
-
|
|
2729
|
+
_insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
|
|
2862
2730
|
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
}
|
|
2870
|
-
} else {
|
|
2871
|
-
dataSource = options;
|
|
2872
|
-
}
|
|
2873
|
-
return dataSource.delete();
|
|
2874
|
-
}
|
|
2731
|
+
/**
|
|
2732
|
+
* 插入触发器启动器
|
|
2733
|
+
* @internal
|
|
2734
|
+
* @param triggerLauncher 已有的触发器启动器实例
|
|
2735
|
+
*/
|
|
2736
|
+
_insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
|
|
2875
2737
|
|
|
2876
|
-
|
|
2877
|
-
const
|
|
2878
|
-
const
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2738
|
+
_insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
|
|
2739
|
+
const triggerLauncherOptions: any = {};
|
|
2740
|
+
const relationOptions = { parentNode: this, parentKey: 'triggerLaunchers' };
|
|
2741
|
+
const TriggerLauncher = getConceptConstructor('TriggerLauncher');
|
|
2742
|
+
let triggerLauncher: TriggerLauncher;
|
|
2743
|
+
if (!options) {
|
|
2744
|
+
triggerLauncher = TriggerLauncher.from(
|
|
2745
|
+
{
|
|
2746
|
+
...triggerLauncherOptions,
|
|
2747
|
+
name: this.getTriggerLauncherUniqueName(),
|
|
2748
|
+
},
|
|
2749
|
+
this,
|
|
2750
|
+
'triggerLaunchers',
|
|
2751
|
+
);
|
|
2752
|
+
} else if (typeof options === 'string') {
|
|
2753
|
+
triggerLauncher = TriggerLauncher.from(
|
|
2754
|
+
{
|
|
2755
|
+
...triggerLauncherOptions,
|
|
2756
|
+
name: options,
|
|
2757
|
+
},
|
|
2758
|
+
this,
|
|
2759
|
+
'triggerLaunchers',
|
|
2760
|
+
);
|
|
2761
|
+
} else if (asserts.isTriggerLauncher(options)) {
|
|
2762
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
2763
|
+
triggerLauncher = options;
|
|
2764
|
+
Object.assign(triggerLauncher, relationOptions);
|
|
2765
|
+
} else {
|
|
2766
|
+
triggerLauncher = TriggerLauncher.from(
|
|
2767
|
+
{
|
|
2768
|
+
...triggerLauncherOptions,
|
|
2769
|
+
...options,
|
|
2770
|
+
},
|
|
2771
|
+
this,
|
|
2772
|
+
'triggerLaunchers',
|
|
2773
|
+
);
|
|
2903
2774
|
}
|
|
2904
|
-
|
|
2775
|
+
this.triggerLaunchers.splice(index, 0, triggerLauncher);
|
|
2776
|
+
return triggerLauncher;
|
|
2905
2777
|
}
|
|
2906
2778
|
|
|
2907
2779
|
/**
|
|
2908
|
-
*
|
|
2909
|
-
* @param name
|
|
2780
|
+
* 插入触发器启动器
|
|
2781
|
+
* @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
|
|
2910
2782
|
*/
|
|
2911
|
-
|
|
2783
|
+
insertTriggerLauncherAt(name: string, index: number): TriggerLauncher;
|
|
2912
2784
|
|
|
2913
2785
|
/**
|
|
2914
|
-
*
|
|
2915
|
-
* @param
|
|
2786
|
+
* 插入触发器启动器
|
|
2787
|
+
* @param triggerLauncherOptions 触发器启动器参数
|
|
2916
2788
|
*/
|
|
2917
|
-
|
|
2789
|
+
insertTriggerLauncherAt(triggerLauncherOptions: Partial<TriggerLauncher>, index: number): TriggerLauncher;
|
|
2918
2790
|
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
throw new Error('找不到数据结构 ' + options);
|
|
2925
|
-
}
|
|
2926
|
-
} else {
|
|
2927
|
-
structure = options;
|
|
2928
|
-
}
|
|
2929
|
-
return structure.delete();
|
|
2930
|
-
}
|
|
2791
|
+
/**
|
|
2792
|
+
* 插入触发器启动器
|
|
2793
|
+
* @param triggerLauncher 已有的触发器启动器实例
|
|
2794
|
+
*/
|
|
2795
|
+
insertTriggerLauncherAt(triggerLauncher: TriggerLauncher, index: number): TriggerLauncher;
|
|
2931
2796
|
|
|
2932
|
-
|
|
2933
|
-
const
|
|
2934
|
-
|
|
2797
|
+
insertTriggerLauncherAt(options: string | Partial<TriggerLauncher> | TriggerLauncher, index: number) {
|
|
2798
|
+
const node = this._insertTriggerLauncherAt(options as any, index);
|
|
2799
|
+
node.create({
|
|
2800
|
+
index,
|
|
2935
2801
|
parentNode: this,
|
|
2936
|
-
parentKey,
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
oldObject: structure,
|
|
2940
|
-
};
|
|
2941
|
-
if (parentKey) {
|
|
2942
|
-
params.parentKey = parentKey;
|
|
2943
|
-
// @ts-ignore
|
|
2944
|
-
const t = this.__v_raw || this;
|
|
2945
|
-
// @ts-ignore
|
|
2946
|
-
const n = structure.__v_raw || structure;
|
|
2947
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
2948
|
-
// @ts-ignore
|
|
2949
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
2950
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
2951
|
-
params.index = index;
|
|
2952
|
-
} else {
|
|
2953
|
-
const q = (t as any)[parentKey];
|
|
2954
|
-
if ((q.__v_raw || q) === n) {
|
|
2955
|
-
params.index = 0;
|
|
2956
|
-
(this as any)[parentKey] = undefined;
|
|
2957
|
-
}
|
|
2958
|
-
}
|
|
2959
|
-
}
|
|
2960
|
-
return params;
|
|
2802
|
+
parentKey: 'triggerLaunchers',
|
|
2803
|
+
});
|
|
2804
|
+
return node;
|
|
2961
2805
|
}
|
|
2962
2806
|
|
|
2963
2807
|
/**
|
|
2964
|
-
*
|
|
2965
|
-
* @
|
|
2808
|
+
* 添加触发器启动器
|
|
2809
|
+
* @internal
|
|
2810
|
+
* @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
|
|
2966
2811
|
*/
|
|
2967
|
-
|
|
2812
|
+
_addTriggerLauncher(name?: string): TriggerLauncher;
|
|
2968
2813
|
|
|
2969
2814
|
/**
|
|
2970
|
-
*
|
|
2971
|
-
* @
|
|
2815
|
+
* 添加触发器启动器
|
|
2816
|
+
* @internal
|
|
2817
|
+
* @param triggerLauncherOptions 触发器启动器参数
|
|
2972
2818
|
*/
|
|
2973
|
-
|
|
2819
|
+
_addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
|
|
2974
2820
|
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
}
|
|
2982
|
-
} else {
|
|
2983
|
-
enumeration = options;
|
|
2984
|
-
}
|
|
2985
|
-
return enumeration.delete();
|
|
2986
|
-
}
|
|
2821
|
+
/**
|
|
2822
|
+
* 添加触发器启动器
|
|
2823
|
+
* @internal
|
|
2824
|
+
* @param triggerLauncher 已有的触发器启动器实例
|
|
2825
|
+
*/
|
|
2826
|
+
_addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
|
|
2987
2827
|
|
|
2988
|
-
|
|
2989
|
-
const
|
|
2990
|
-
|
|
2991
|
-
parentNode: this,
|
|
2992
|
-
parentKey,
|
|
2993
|
-
index: -1,
|
|
2994
|
-
object: null,
|
|
2995
|
-
oldObject: enumeration,
|
|
2996
|
-
};
|
|
2997
|
-
if (parentKey) {
|
|
2998
|
-
params.parentKey = parentKey;
|
|
2999
|
-
// @ts-ignore
|
|
3000
|
-
const t = this.__v_raw || this;
|
|
3001
|
-
// @ts-ignore
|
|
3002
|
-
const n = enumeration.__v_raw || enumeration;
|
|
3003
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3004
|
-
// @ts-ignore
|
|
3005
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3006
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3007
|
-
params.index = index;
|
|
3008
|
-
} else {
|
|
3009
|
-
const q = (t as any)[parentKey];
|
|
3010
|
-
if ((q.__v_raw || q) === n) {
|
|
3011
|
-
params.index = 0;
|
|
3012
|
-
(this as any)[parentKey] = undefined;
|
|
3013
|
-
}
|
|
3014
|
-
}
|
|
3015
|
-
}
|
|
3016
|
-
return params;
|
|
2828
|
+
_addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
|
|
2829
|
+
const index = this.triggerLaunchers.length;
|
|
2830
|
+
return this._insertTriggerLauncherAt(options as any, index);
|
|
3017
2831
|
}
|
|
3018
2832
|
|
|
3019
2833
|
/**
|
|
3020
|
-
*
|
|
3021
|
-
* @
|
|
2834
|
+
* 添加触发器启动器
|
|
2835
|
+
* @internal
|
|
2836
|
+
* @param name 触发器启动器名称,如果不填会自动生成一个唯一名称
|
|
3022
2837
|
*/
|
|
3023
|
-
|
|
2838
|
+
addTriggerLauncher(name?: string): TriggerLauncher;
|
|
3024
2839
|
|
|
3025
2840
|
/**
|
|
3026
|
-
*
|
|
3027
|
-
* @param
|
|
2841
|
+
* 添加触发器启动器
|
|
2842
|
+
* @param triggerLauncherOptions 触发器启动器参数
|
|
3028
2843
|
*/
|
|
3029
|
-
|
|
2844
|
+
addTriggerLauncher(triggerLauncherOptions: Partial<TriggerLauncher>): TriggerLauncher;
|
|
3030
2845
|
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
2846
|
+
/**
|
|
2847
|
+
* 添加触发器启动器
|
|
2848
|
+
* @param triggerLauncher 已有的触发器启动器实例
|
|
2849
|
+
*/
|
|
2850
|
+
addTriggerLauncher(triggerLauncher: TriggerLauncher): TriggerLauncher;
|
|
2851
|
+
|
|
2852
|
+
addTriggerLauncher(options?: string | Partial<TriggerLauncher> | TriggerLauncher) {
|
|
2853
|
+
const node = this._addTriggerLauncher(options as any);
|
|
2854
|
+
const index = this.triggerLaunchers.indexOf(node);
|
|
2855
|
+
node.create({
|
|
2856
|
+
index,
|
|
2857
|
+
parentNode: this,
|
|
2858
|
+
parentKey: 'triggerLaunchers',
|
|
2859
|
+
});
|
|
2860
|
+
return node;
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
getMetadataTypeExistingNames(excludedList: Array<MetadataType> = []) {
|
|
2864
|
+
const excludedSet = new Set(excludedList);
|
|
2865
|
+
return ((this.metadataTypes as MetadataType[]) || [])
|
|
2866
|
+
.filter((item) => !excludedSet.has(item))
|
|
2867
|
+
.map((item) => item.name);
|
|
2868
|
+
}
|
|
2869
|
+
getMetadataTypeUniqueName(name = 'MetadataType1') {
|
|
2870
|
+
return utils.unique(name, this.getMetadataTypeExistingNames(), undefined, true);
|
|
3042
2871
|
}
|
|
3043
2872
|
|
|
3044
2873
|
/**
|
|
3045
|
-
*
|
|
3046
|
-
* @
|
|
2874
|
+
* 插入元数据类型
|
|
2875
|
+
* @internal
|
|
2876
|
+
* @param name 元数据类型名称,如果不填会自动生成一个唯一名称
|
|
3047
2877
|
*/
|
|
3048
|
-
|
|
2878
|
+
_insertMetadataTypeAt(name: string, index: number): MetadataType;
|
|
3049
2879
|
|
|
3050
2880
|
/**
|
|
3051
|
-
*
|
|
3052
|
-
* @
|
|
2881
|
+
* 插入元数据类型
|
|
2882
|
+
* @internal
|
|
2883
|
+
* @param metadataTypeOptions 元数据类型参数
|
|
3053
2884
|
*/
|
|
3054
|
-
|
|
2885
|
+
_insertMetadataTypeAt(metadataTypeOptions: Partial<MetadataType>, index: number): MetadataType;
|
|
3055
2886
|
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
2887
|
+
/**
|
|
2888
|
+
* 插入元数据类型
|
|
2889
|
+
* @internal
|
|
2890
|
+
* @param metadataType 已有的元数据类型实例
|
|
2891
|
+
*/
|
|
2892
|
+
_insertMetadataTypeAt(metadataType: MetadataType, index: number): MetadataType;
|
|
2893
|
+
|
|
2894
|
+
_insertMetadataTypeAt(options: string | Partial<MetadataType> | MetadataType, index: number) {
|
|
2895
|
+
const metadataTypeOptions: any = {};
|
|
2896
|
+
const relationOptions = { parentNode: this, parentKey: 'metadataTypes' };
|
|
2897
|
+
const MetadataType = getConceptConstructor('MetadataType');
|
|
2898
|
+
let metadataType: MetadataType;
|
|
2899
|
+
if (!options) {
|
|
2900
|
+
metadataType = MetadataType.from(
|
|
2901
|
+
{
|
|
2902
|
+
...metadataTypeOptions,
|
|
2903
|
+
name: this.getMetadataTypeUniqueName(),
|
|
2904
|
+
},
|
|
2905
|
+
this,
|
|
2906
|
+
'metadataTypes',
|
|
2907
|
+
);
|
|
2908
|
+
} else if (typeof options === 'string') {
|
|
2909
|
+
metadataType = MetadataType.from(
|
|
2910
|
+
{
|
|
2911
|
+
...metadataTypeOptions,
|
|
2912
|
+
name: options,
|
|
2913
|
+
},
|
|
2914
|
+
this,
|
|
2915
|
+
'metadataTypes',
|
|
2916
|
+
);
|
|
2917
|
+
} else if (asserts.isMetadataType(options)) {
|
|
2918
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
2919
|
+
metadataType = options;
|
|
2920
|
+
Object.assign(metadataType, relationOptions);
|
|
3063
2921
|
} else {
|
|
3064
|
-
|
|
2922
|
+
metadataType = MetadataType.from(
|
|
2923
|
+
{
|
|
2924
|
+
...metadataTypeOptions,
|
|
2925
|
+
...options,
|
|
2926
|
+
},
|
|
2927
|
+
this,
|
|
2928
|
+
'metadataTypes',
|
|
2929
|
+
);
|
|
3065
2930
|
}
|
|
3066
|
-
|
|
2931
|
+
this.metadataTypes.splice(index, 0, metadataType);
|
|
2932
|
+
return metadataType;
|
|
3067
2933
|
}
|
|
3068
2934
|
|
|
3069
2935
|
/**
|
|
3070
|
-
*
|
|
3071
|
-
* @param name
|
|
2936
|
+
* 插入元数据类型
|
|
2937
|
+
* @param name 元数据类型名称,如果不填会自动生成一个唯一名称
|
|
3072
2938
|
*/
|
|
3073
|
-
|
|
2939
|
+
insertMetadataTypeAt(name: string, index: number): MetadataType;
|
|
3074
2940
|
|
|
3075
2941
|
/**
|
|
3076
|
-
*
|
|
3077
|
-
* @param
|
|
2942
|
+
* 插入元数据类型
|
|
2943
|
+
* @param metadataTypeOptions 元数据类型参数
|
|
3078
2944
|
*/
|
|
3079
|
-
|
|
3080
|
-
authLogicForCallInterface: AuthLogicForCallInterface,
|
|
3081
|
-
): void;
|
|
2945
|
+
insertMetadataTypeAt(metadataTypeOptions: Partial<MetadataType>, index: number): MetadataType;
|
|
3082
2946
|
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
);
|
|
3089
|
-
if (!authLogicForCallInterface) {
|
|
3090
|
-
throw new Error('找不到调用接口的鉴权逻辑 ' + options);
|
|
3091
|
-
}
|
|
3092
|
-
} else {
|
|
3093
|
-
authLogicForCallInterface = options;
|
|
3094
|
-
}
|
|
3095
|
-
return authLogicForCallInterface.delete();
|
|
3096
|
-
}
|
|
2947
|
+
/**
|
|
2948
|
+
* 插入元数据类型
|
|
2949
|
+
* @param metadataType 已有的元数据类型实例
|
|
2950
|
+
*/
|
|
2951
|
+
insertMetadataTypeAt(metadataType: MetadataType, index: number): MetadataType;
|
|
3097
2952
|
|
|
3098
|
-
|
|
3099
|
-
const
|
|
3100
|
-
|
|
2953
|
+
insertMetadataTypeAt(options: string | Partial<MetadataType> | MetadataType, index: number) {
|
|
2954
|
+
const node = this._insertMetadataTypeAt(options as any, index);
|
|
2955
|
+
node.create({
|
|
2956
|
+
index,
|
|
3101
2957
|
parentNode: this,
|
|
3102
|
-
parentKey,
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
oldObject: logic,
|
|
3106
|
-
};
|
|
3107
|
-
if (parentKey) {
|
|
3108
|
-
params.parentKey = parentKey;
|
|
3109
|
-
// @ts-ignore
|
|
3110
|
-
const t = this.__v_raw || this;
|
|
3111
|
-
// @ts-ignore
|
|
3112
|
-
const n = logic.__v_raw || logic;
|
|
3113
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3114
|
-
// @ts-ignore
|
|
3115
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3116
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3117
|
-
params.index = index;
|
|
3118
|
-
} else {
|
|
3119
|
-
const q = (t as any)[parentKey];
|
|
3120
|
-
if ((q.__v_raw || q) === n) {
|
|
3121
|
-
params.index = 0;
|
|
3122
|
-
(this as any)[parentKey] = undefined;
|
|
3123
|
-
}
|
|
3124
|
-
}
|
|
3125
|
-
}
|
|
3126
|
-
return params;
|
|
2958
|
+
parentKey: 'metadataTypes',
|
|
2959
|
+
});
|
|
2960
|
+
return node;
|
|
3127
2961
|
}
|
|
3128
2962
|
|
|
3129
2963
|
/**
|
|
3130
|
-
*
|
|
3131
|
-
* @
|
|
2964
|
+
* 添加元数据类型
|
|
2965
|
+
* @internal
|
|
2966
|
+
* @param name 元数据类型名称,如果不填会自动生成一个唯一名称
|
|
3132
2967
|
*/
|
|
3133
|
-
|
|
2968
|
+
_addMetadataType(name?: string): MetadataType;
|
|
3134
2969
|
|
|
3135
2970
|
/**
|
|
3136
|
-
*
|
|
3137
|
-
* @
|
|
2971
|
+
* 添加元数据类型
|
|
2972
|
+
* @internal
|
|
2973
|
+
* @param metadataTypeOptions 元数据类型参数
|
|
3138
2974
|
*/
|
|
3139
|
-
|
|
2975
|
+
_addMetadataType(metadataTypeOptions: Partial<MetadataType>): MetadataType;
|
|
3140
2976
|
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
}
|
|
3148
|
-
} else {
|
|
3149
|
-
overriddenLogic = options;
|
|
3150
|
-
}
|
|
3151
|
-
return overriddenLogic.delete();
|
|
3152
|
-
}
|
|
2977
|
+
/**
|
|
2978
|
+
* 添加元数据类型
|
|
2979
|
+
* @internal
|
|
2980
|
+
* @param metadataType 已有的元数据类型实例
|
|
2981
|
+
*/
|
|
2982
|
+
_addMetadataType(metadataType: MetadataType): MetadataType;
|
|
3153
2983
|
|
|
3154
|
-
|
|
3155
|
-
const
|
|
3156
|
-
|
|
3157
|
-
parentNode: this,
|
|
3158
|
-
parentKey,
|
|
3159
|
-
index: -1,
|
|
3160
|
-
object: null,
|
|
3161
|
-
oldObject: overriddenLogic,
|
|
3162
|
-
};
|
|
3163
|
-
if (parentKey) {
|
|
3164
|
-
params.parentKey = parentKey;
|
|
3165
|
-
// @ts-ignore
|
|
3166
|
-
const t = this.__v_raw || this;
|
|
3167
|
-
// @ts-ignore
|
|
3168
|
-
const n = overriddenLogic.__v_raw || overriddenLogic;
|
|
3169
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3170
|
-
// @ts-ignore
|
|
3171
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3172
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3173
|
-
params.index = index;
|
|
3174
|
-
} else {
|
|
3175
|
-
const q = (t as any)[parentKey];
|
|
3176
|
-
if ((q.__v_raw || q) === n) {
|
|
3177
|
-
params.index = 0;
|
|
3178
|
-
(this as any)[parentKey] = undefined;
|
|
3179
|
-
}
|
|
3180
|
-
}
|
|
3181
|
-
}
|
|
3182
|
-
return params;
|
|
2984
|
+
_addMetadataType(options?: string | Partial<MetadataType> | MetadataType) {
|
|
2985
|
+
const index = 0;
|
|
2986
|
+
return this._insertMetadataTypeAt(options as any, index);
|
|
3183
2987
|
}
|
|
3184
2988
|
|
|
3185
2989
|
/**
|
|
3186
|
-
*
|
|
3187
|
-
* @
|
|
2990
|
+
* 添加元数据类型
|
|
2991
|
+
* @internal
|
|
2992
|
+
* @param name 元数据类型名称,如果不填会自动生成一个唯一名称
|
|
3188
2993
|
*/
|
|
3189
|
-
|
|
2994
|
+
addMetadataType(name?: string): MetadataType;
|
|
3190
2995
|
|
|
3191
2996
|
/**
|
|
3192
|
-
*
|
|
3193
|
-
* @param
|
|
2997
|
+
* 添加元数据类型
|
|
2998
|
+
* @param metadataTypeOptions 元数据类型参数
|
|
3194
2999
|
*/
|
|
3195
|
-
|
|
3000
|
+
addMetadataType(metadataTypeOptions: Partial<MetadataType>): MetadataType;
|
|
3196
3001
|
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
throw new Error('找不到接口 ' + options);
|
|
3203
|
-
}
|
|
3204
|
-
} else {
|
|
3205
|
-
itface = options;
|
|
3206
|
-
}
|
|
3207
|
-
return itface.delete();
|
|
3208
|
-
}
|
|
3002
|
+
/**
|
|
3003
|
+
* 添加元数据类型
|
|
3004
|
+
* @param metadataType 已有的元数据类型实例
|
|
3005
|
+
*/
|
|
3006
|
+
addMetadataType(metadataType: MetadataType): MetadataType;
|
|
3209
3007
|
|
|
3210
|
-
|
|
3211
|
-
const
|
|
3212
|
-
const
|
|
3008
|
+
addMetadataType(options?: string | Partial<MetadataType> | MetadataType) {
|
|
3009
|
+
const node = this._addMetadataType(options as any);
|
|
3010
|
+
const index = this.metadataTypes.indexOf(node);
|
|
3011
|
+
node.create({
|
|
3012
|
+
index,
|
|
3213
3013
|
parentNode: this,
|
|
3214
|
-
parentKey,
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
oldObject: itface,
|
|
3218
|
-
};
|
|
3219
|
-
if (parentKey) {
|
|
3220
|
-
params.parentKey = parentKey;
|
|
3221
|
-
// @ts-ignore
|
|
3222
|
-
const t = this.__v_raw || this;
|
|
3223
|
-
// @ts-ignore
|
|
3224
|
-
const n = itface.__v_raw || itface;
|
|
3225
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3226
|
-
// @ts-ignore
|
|
3227
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3228
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3229
|
-
params.index = index;
|
|
3230
|
-
} else {
|
|
3231
|
-
const q = (t as any)[parentKey];
|
|
3232
|
-
if ((q.__v_raw || q) === n) {
|
|
3233
|
-
params.index = 0;
|
|
3234
|
-
(this as any)[parentKey] = undefined;
|
|
3235
|
-
}
|
|
3236
|
-
}
|
|
3237
|
-
}
|
|
3238
|
-
return params;
|
|
3014
|
+
parentKey: 'metadataTypes',
|
|
3015
|
+
});
|
|
3016
|
+
return node;
|
|
3239
3017
|
}
|
|
3240
3018
|
|
|
3241
3019
|
/**
|
|
3242
|
-
*
|
|
3243
|
-
* @param name
|
|
3020
|
+
* 删除数据源
|
|
3021
|
+
* @param name 数据源名称
|
|
3244
3022
|
*/
|
|
3245
|
-
|
|
3023
|
+
removeDataSource(name: string): void;
|
|
3246
3024
|
|
|
3247
3025
|
/**
|
|
3248
|
-
*
|
|
3249
|
-
* @param
|
|
3026
|
+
* 删除数据源
|
|
3027
|
+
* @param dataSource 已有的数据源实例
|
|
3250
3028
|
*/
|
|
3251
|
-
|
|
3029
|
+
removeDataSource(dataSource: DataSource): void;
|
|
3252
3030
|
|
|
3253
|
-
|
|
3254
|
-
let
|
|
3031
|
+
removeDataSource(options: string | DataSource) {
|
|
3032
|
+
let dataSource: DataSource;
|
|
3255
3033
|
if (typeof options === 'string') {
|
|
3256
|
-
|
|
3257
|
-
if (!
|
|
3258
|
-
throw new Error('
|
|
3034
|
+
dataSource = (this.dataSources as DataSource[]).find((item) => item.name === options);
|
|
3035
|
+
if (!dataSource) {
|
|
3036
|
+
throw new Error('找不到数据源 ' + options);
|
|
3259
3037
|
}
|
|
3260
3038
|
} else {
|
|
3261
|
-
|
|
3262
|
-
}
|
|
3263
|
-
return frontendType.delete();
|
|
3264
|
-
}
|
|
3265
|
-
|
|
3266
|
-
__removeFrontendType(frontendType: FrontendType) {
|
|
3267
|
-
const parentKey = frontendType.parentKey;
|
|
3268
|
-
const params: Params = {
|
|
3269
|
-
parentNode: this,
|
|
3270
|
-
parentKey,
|
|
3271
|
-
index: -1,
|
|
3272
|
-
object: null,
|
|
3273
|
-
oldObject: frontendType,
|
|
3274
|
-
};
|
|
3275
|
-
if (parentKey) {
|
|
3276
|
-
params.parentKey = parentKey;
|
|
3277
|
-
// @ts-ignore
|
|
3278
|
-
const t = this.__v_raw || this;
|
|
3279
|
-
// @ts-ignore
|
|
3280
|
-
const n = frontendType.__v_raw || frontendType;
|
|
3281
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3282
|
-
// @ts-ignore
|
|
3283
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3284
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3285
|
-
params.index = index;
|
|
3286
|
-
} else {
|
|
3287
|
-
const q = (t as any)[parentKey];
|
|
3288
|
-
if ((q.__v_raw || q) === n) {
|
|
3289
|
-
params.index = 0;
|
|
3290
|
-
(this as any)[parentKey] = undefined;
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3039
|
+
dataSource = options;
|
|
3293
3040
|
}
|
|
3294
|
-
return
|
|
3041
|
+
return dataSource.delete();
|
|
3295
3042
|
}
|
|
3296
3043
|
|
|
3297
3044
|
/**
|
|
3298
|
-
*
|
|
3299
|
-
* @param name
|
|
3045
|
+
* 删除数据结构
|
|
3046
|
+
* @param name 数据结构名称
|
|
3300
3047
|
*/
|
|
3301
|
-
|
|
3048
|
+
removeStructure(name: string): void;
|
|
3302
3049
|
|
|
3303
3050
|
/**
|
|
3304
|
-
*
|
|
3305
|
-
* @param
|
|
3051
|
+
* 删除数据结构
|
|
3052
|
+
* @param structure 已有的数据结构实例
|
|
3306
3053
|
*/
|
|
3307
|
-
|
|
3054
|
+
removeStructure(structure: Structure): void;
|
|
3308
3055
|
|
|
3309
|
-
|
|
3310
|
-
let
|
|
3311
|
-
if (typeof options === 'string') {
|
|
3312
|
-
|
|
3313
|
-
if (!
|
|
3314
|
-
throw new Error('
|
|
3056
|
+
removeStructure(options: string | Structure) {
|
|
3057
|
+
let structure: Structure;
|
|
3058
|
+
if (typeof options === 'string') {
|
|
3059
|
+
structure = (this.structures as Structure[]).find((item) => item.name === options);
|
|
3060
|
+
if (!structure) {
|
|
3061
|
+
throw new Error('找不到数据结构 ' + options);
|
|
3315
3062
|
}
|
|
3316
3063
|
} else {
|
|
3317
|
-
|
|
3064
|
+
structure = options;
|
|
3318
3065
|
}
|
|
3319
|
-
return
|
|
3066
|
+
return structure.delete();
|
|
3320
3067
|
}
|
|
3321
3068
|
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3069
|
+
/**
|
|
3070
|
+
* 删除枚举
|
|
3071
|
+
* @param name 枚举名称
|
|
3072
|
+
*/
|
|
3073
|
+
removeEnum(name: string): void;
|
|
3074
|
+
|
|
3075
|
+
/**
|
|
3076
|
+
* 删除枚举
|
|
3077
|
+
* @param enumeration 已有的枚举实例
|
|
3078
|
+
*/
|
|
3079
|
+
removeEnum(enumeration: Enum): void;
|
|
3080
|
+
|
|
3081
|
+
removeEnum(options: string | Enum) {
|
|
3082
|
+
let enumeration: Enum;
|
|
3083
|
+
if (typeof options === 'string') {
|
|
3084
|
+
enumeration = (this.enums as Enum[]).find((item) => item.name === options);
|
|
3085
|
+
if (!enumeration) {
|
|
3086
|
+
throw new Error('找不到枚举 ' + options);
|
|
3087
|
+
}
|
|
3088
|
+
} else {
|
|
3089
|
+
enumeration = options;
|
|
3090
|
+
}
|
|
3091
|
+
return enumeration.delete();
|
|
3092
|
+
}
|
|
3093
|
+
|
|
3094
|
+
/**
|
|
3095
|
+
* 删除逻辑
|
|
3096
|
+
* @param name 逻辑名称
|
|
3097
|
+
*/
|
|
3098
|
+
removeLogic(name: string): void;
|
|
3099
|
+
|
|
3100
|
+
/**
|
|
3101
|
+
* 删除逻辑
|
|
3102
|
+
* @param logic 已有的逻辑实例
|
|
3103
|
+
*/
|
|
3104
|
+
removeLogic(logic: Logic): void;
|
|
3105
|
+
|
|
3106
|
+
removeLogic(options: string | Logic) {
|
|
3107
|
+
let logic: Logic;
|
|
3108
|
+
if (typeof options === 'string') {
|
|
3109
|
+
logic = (this.logics as Logic[]).find((item) => item.name === options);
|
|
3110
|
+
if (!logic) {
|
|
3111
|
+
throw new Error('找不到逻辑 ' + options);
|
|
3112
|
+
}
|
|
3113
|
+
} else {
|
|
3114
|
+
logic = options;
|
|
3115
|
+
}
|
|
3116
|
+
return logic.delete();
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
/**
|
|
3120
|
+
* 删除覆写逻辑
|
|
3121
|
+
* @param name 覆写逻辑名称
|
|
3122
|
+
*/
|
|
3123
|
+
removeOverriddenLogic(name: string): void;
|
|
3124
|
+
|
|
3125
|
+
/**
|
|
3126
|
+
* 删除覆写逻辑
|
|
3127
|
+
* @param overriddenLogic 已有的覆写逻辑实例
|
|
3128
|
+
*/
|
|
3129
|
+
removeOverriddenLogic(overriddenLogic: OverriddenLogic): void;
|
|
3130
|
+
|
|
3131
|
+
removeOverriddenLogic(options: string | OverriddenLogic) {
|
|
3132
|
+
let overriddenLogic: OverriddenLogic;
|
|
3133
|
+
if (typeof options === 'string') {
|
|
3134
|
+
overriddenLogic = (this.overriddenLogics as OverriddenLogic[]).find((item) => item.name === options);
|
|
3135
|
+
if (!overriddenLogic) {
|
|
3136
|
+
throw new Error('找不到覆写逻辑 ' + options);
|
|
3137
|
+
}
|
|
3138
|
+
} else {
|
|
3139
|
+
overriddenLogic = options;
|
|
3140
|
+
}
|
|
3141
|
+
return overriddenLogic.delete();
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
/**
|
|
3145
|
+
* 删除接口
|
|
3146
|
+
* @param name 接口名称
|
|
3147
|
+
*/
|
|
3148
|
+
removeInterface(name: string): void;
|
|
3149
|
+
|
|
3150
|
+
/**
|
|
3151
|
+
* 删除接口
|
|
3152
|
+
* @param itface 已有的接口实例
|
|
3153
|
+
*/
|
|
3154
|
+
removeInterface(itface: AbstractInterface): void;
|
|
3155
|
+
|
|
3156
|
+
removeInterface(options: string | AbstractInterface) {
|
|
3157
|
+
let itface: AbstractInterface;
|
|
3158
|
+
if (typeof options === 'string') {
|
|
3159
|
+
itface = (this.interfaces as AbstractInterface[]).find((item) => item.name === options);
|
|
3160
|
+
if (!itface) {
|
|
3161
|
+
throw new Error('找不到接口 ' + options);
|
|
3162
|
+
}
|
|
3163
|
+
} else {
|
|
3164
|
+
itface = options;
|
|
3165
|
+
}
|
|
3166
|
+
return itface.delete();
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
/**
|
|
3170
|
+
* 删除端类型
|
|
3171
|
+
* @param name 端类型名称
|
|
3172
|
+
*/
|
|
3173
|
+
removeFrontendType(name: string): void;
|
|
3174
|
+
|
|
3175
|
+
/**
|
|
3176
|
+
* 删除端类型
|
|
3177
|
+
* @param frontendType 已有的端类型实例
|
|
3178
|
+
*/
|
|
3179
|
+
removeFrontendType(frontendType: FrontendType): void;
|
|
3180
|
+
|
|
3181
|
+
removeFrontendType(options: string | FrontendType) {
|
|
3182
|
+
let frontendType: FrontendType;
|
|
3183
|
+
if (typeof options === 'string') {
|
|
3184
|
+
frontendType = (this.frontendTypes as FrontendType[]).find((item) => item.name === options);
|
|
3185
|
+
if (!frontendType) {
|
|
3186
|
+
throw new Error('找不到端类型 ' + options);
|
|
3348
3187
|
}
|
|
3188
|
+
} else {
|
|
3189
|
+
frontendType = options;
|
|
3349
3190
|
}
|
|
3350
|
-
return
|
|
3191
|
+
return frontendType.delete();
|
|
3351
3192
|
}
|
|
3352
3193
|
|
|
3353
3194
|
/**
|
|
@@ -3375,37 +3216,6 @@ export class App extends BaseNode {
|
|
|
3375
3216
|
return process.delete();
|
|
3376
3217
|
}
|
|
3377
3218
|
|
|
3378
|
-
__removeProcess(process: Process) {
|
|
3379
|
-
const parentKey = process.parentKey;
|
|
3380
|
-
const params: Params = {
|
|
3381
|
-
parentNode: this,
|
|
3382
|
-
parentKey,
|
|
3383
|
-
index: -1,
|
|
3384
|
-
object: null,
|
|
3385
|
-
oldObject: process,
|
|
3386
|
-
};
|
|
3387
|
-
if (parentKey) {
|
|
3388
|
-
params.parentKey = parentKey;
|
|
3389
|
-
// @ts-ignore
|
|
3390
|
-
const t = this.__v_raw || this;
|
|
3391
|
-
// @ts-ignore
|
|
3392
|
-
const n = process.__v_raw || process;
|
|
3393
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3394
|
-
// @ts-ignore
|
|
3395
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3396
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3397
|
-
params.index = index;
|
|
3398
|
-
} else {
|
|
3399
|
-
const q = (t as any)[parentKey];
|
|
3400
|
-
if ((q.__v_raw || q) === n) {
|
|
3401
|
-
params.index = 0;
|
|
3402
|
-
(this as any)[parentKey] = undefined;
|
|
3403
|
-
}
|
|
3404
|
-
}
|
|
3405
|
-
}
|
|
3406
|
-
return params;
|
|
3407
|
-
}
|
|
3408
|
-
|
|
3409
3219
|
/**
|
|
3410
3220
|
* 删除角色
|
|
3411
3221
|
* @param name 角色名称
|
|
@@ -3431,109 +3241,47 @@ export class App extends BaseNode {
|
|
|
3431
3241
|
return role.delete();
|
|
3432
3242
|
}
|
|
3433
3243
|
|
|
3434
|
-
__removeRole(role: Role) {
|
|
3435
|
-
const parentKey = role.parentKey;
|
|
3436
|
-
const params: Params = {
|
|
3437
|
-
parentNode: this,
|
|
3438
|
-
parentKey,
|
|
3439
|
-
index: -1,
|
|
3440
|
-
object: null,
|
|
3441
|
-
oldObject: role,
|
|
3442
|
-
};
|
|
3443
|
-
if (parentKey) {
|
|
3444
|
-
params.parentKey = parentKey;
|
|
3445
|
-
// @ts-ignore
|
|
3446
|
-
const t = this.__v_raw || this;
|
|
3447
|
-
// @ts-ignore
|
|
3448
|
-
const n = role.__v_raw || role;
|
|
3449
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3450
|
-
// @ts-ignore
|
|
3451
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3452
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3453
|
-
params.index = index;
|
|
3454
|
-
} else {
|
|
3455
|
-
const q = (t as any)[parentKey];
|
|
3456
|
-
if ((q.__v_raw || q) === n) {
|
|
3457
|
-
params.index = 0;
|
|
3458
|
-
(this as any)[parentKey] = undefined;
|
|
3459
|
-
}
|
|
3460
|
-
}
|
|
3461
|
-
}
|
|
3462
|
-
return params;
|
|
3463
|
-
}
|
|
3464
|
-
|
|
3465
3244
|
/**
|
|
3466
|
-
*
|
|
3467
|
-
* @param name
|
|
3245
|
+
* 删除模块
|
|
3246
|
+
* @param name 模块名称
|
|
3468
3247
|
*/
|
|
3469
|
-
|
|
3248
|
+
removeModuleInDependencies(name: string): void;
|
|
3470
3249
|
|
|
3471
3250
|
/**
|
|
3472
|
-
*
|
|
3473
|
-
* @param
|
|
3251
|
+
* 删除模块
|
|
3252
|
+
* @param module 已有的模块实例
|
|
3474
3253
|
*/
|
|
3475
|
-
|
|
3254
|
+
removeModuleInDependencies(module: Module): void;
|
|
3476
3255
|
|
|
3477
|
-
|
|
3478
|
-
let
|
|
3256
|
+
removeModuleInDependencies(options: string | Module) {
|
|
3257
|
+
let module: Module;
|
|
3479
3258
|
if (typeof options === 'string') {
|
|
3480
|
-
|
|
3481
|
-
if (!
|
|
3482
|
-
throw new Error('
|
|
3259
|
+
module = (this.dependencies as Module[]).find((item) => item.name === options);
|
|
3260
|
+
if (!module) {
|
|
3261
|
+
throw new Error('找不到模块 ' + options);
|
|
3483
3262
|
}
|
|
3484
3263
|
} else {
|
|
3485
|
-
|
|
3486
|
-
}
|
|
3487
|
-
return configuration.delete();
|
|
3488
|
-
}
|
|
3489
|
-
|
|
3490
|
-
__removeConfiguration(configuration: Configuration) {
|
|
3491
|
-
const parentKey = configuration.parentKey;
|
|
3492
|
-
const params: Params = {
|
|
3493
|
-
parentNode: this,
|
|
3494
|
-
parentKey,
|
|
3495
|
-
index: -1,
|
|
3496
|
-
object: null,
|
|
3497
|
-
oldObject: configuration,
|
|
3498
|
-
};
|
|
3499
|
-
if (parentKey) {
|
|
3500
|
-
params.parentKey = parentKey;
|
|
3501
|
-
// @ts-ignore
|
|
3502
|
-
const t = this.__v_raw || this;
|
|
3503
|
-
// @ts-ignore
|
|
3504
|
-
const n = configuration.__v_raw || configuration;
|
|
3505
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3506
|
-
// @ts-ignore
|
|
3507
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3508
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3509
|
-
params.index = index;
|
|
3510
|
-
} else {
|
|
3511
|
-
const q = (t as any)[parentKey];
|
|
3512
|
-
if ((q.__v_raw || q) === n) {
|
|
3513
|
-
params.index = 0;
|
|
3514
|
-
(this as any)[parentKey] = undefined;
|
|
3515
|
-
}
|
|
3516
|
-
}
|
|
3264
|
+
module = options;
|
|
3517
3265
|
}
|
|
3518
|
-
return
|
|
3266
|
+
return module.delete();
|
|
3519
3267
|
}
|
|
3520
3268
|
|
|
3521
3269
|
/**
|
|
3522
3270
|
* 删除模块
|
|
3523
3271
|
* @param name 模块名称
|
|
3524
3272
|
*/
|
|
3525
|
-
|
|
3273
|
+
removeModuleInInterfaceDependencies(name: string): void;
|
|
3526
3274
|
|
|
3527
3275
|
/**
|
|
3528
3276
|
* 删除模块
|
|
3529
3277
|
* @param module 已有的模块实例
|
|
3530
3278
|
*/
|
|
3531
|
-
|
|
3279
|
+
removeModuleInInterfaceDependencies(module: Module): void;
|
|
3532
3280
|
|
|
3533
|
-
|
|
3281
|
+
removeModuleInInterfaceDependencies(options: string | Module) {
|
|
3534
3282
|
let module: Module;
|
|
3535
3283
|
if (typeof options === 'string') {
|
|
3536
|
-
module = (this.
|
|
3284
|
+
module = (this.interfaceDependencies as Module[]).find((item) => item.name === options);
|
|
3537
3285
|
if (!module) {
|
|
3538
3286
|
throw new Error('找不到模块 ' + options);
|
|
3539
3287
|
}
|
|
@@ -3547,15 +3295,15 @@ export class App extends BaseNode {
|
|
|
3547
3295
|
* 删除连接器
|
|
3548
3296
|
* @param name 连接器名称
|
|
3549
3297
|
*/
|
|
3550
|
-
|
|
3298
|
+
removeConnector(name: string): void;
|
|
3551
3299
|
|
|
3552
3300
|
/**
|
|
3553
3301
|
* 删除连接器
|
|
3554
3302
|
* @param connector 已有的连接器实例
|
|
3555
3303
|
*/
|
|
3556
|
-
|
|
3304
|
+
removeConnector(connector: Connector): void;
|
|
3557
3305
|
|
|
3558
|
-
|
|
3306
|
+
removeConnector(options: string | Connector) {
|
|
3559
3307
|
let connector: Connector;
|
|
3560
3308
|
if (typeof options === 'string') {
|
|
3561
3309
|
connector = (this.dependencies as Connector[]).find((item) => item.name === options);
|
|
@@ -3569,115 +3317,55 @@ export class App extends BaseNode {
|
|
|
3569
3317
|
}
|
|
3570
3318
|
|
|
3571
3319
|
/**
|
|
3572
|
-
*
|
|
3573
|
-
* @param name
|
|
3320
|
+
* 删除鉴权逻辑
|
|
3321
|
+
* @param name 鉴权逻辑名称
|
|
3574
3322
|
*/
|
|
3575
|
-
|
|
3323
|
+
removeAuthLogic(name: string): void;
|
|
3576
3324
|
|
|
3577
3325
|
/**
|
|
3578
|
-
*
|
|
3579
|
-
* @param
|
|
3326
|
+
* 删除鉴权逻辑
|
|
3327
|
+
* @param authLogic 已有的鉴权逻辑实例
|
|
3580
3328
|
*/
|
|
3581
|
-
|
|
3329
|
+
removeAuthLogic(authLogic: AuthLogic): void;
|
|
3582
3330
|
|
|
3583
|
-
|
|
3584
|
-
let
|
|
3331
|
+
removeAuthLogic(options: string | AuthLogic) {
|
|
3332
|
+
let authLogic: AuthLogic;
|
|
3585
3333
|
if (typeof options === 'string') {
|
|
3586
|
-
|
|
3587
|
-
if (!
|
|
3588
|
-
throw new Error('
|
|
3334
|
+
authLogic = (this.authLogics as AuthLogic[]).find((item) => item.name === options);
|
|
3335
|
+
if (!authLogic) {
|
|
3336
|
+
throw new Error('找不到鉴权逻辑 ' + options);
|
|
3589
3337
|
}
|
|
3590
3338
|
} else {
|
|
3591
|
-
|
|
3592
|
-
}
|
|
3593
|
-
return module.delete();
|
|
3594
|
-
}
|
|
3595
|
-
|
|
3596
|
-
__removeModule(module: Module) {
|
|
3597
|
-
const parentKey = module.parentKey;
|
|
3598
|
-
const params: Params = {
|
|
3599
|
-
parentNode: this,
|
|
3600
|
-
parentKey,
|
|
3601
|
-
index: -1,
|
|
3602
|
-
object: null,
|
|
3603
|
-
oldObject: module,
|
|
3604
|
-
};
|
|
3605
|
-
if (parentKey) {
|
|
3606
|
-
params.parentKey = parentKey;
|
|
3607
|
-
// @ts-ignore
|
|
3608
|
-
const t = this.__v_raw || this;
|
|
3609
|
-
// @ts-ignore
|
|
3610
|
-
const n = module.__v_raw || module;
|
|
3611
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3612
|
-
// @ts-ignore
|
|
3613
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3614
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3615
|
-
params.index = index;
|
|
3616
|
-
} else {
|
|
3617
|
-
const q = (t as any)[parentKey];
|
|
3618
|
-
if ((q.__v_raw || q) === n) {
|
|
3619
|
-
params.index = 0;
|
|
3620
|
-
(this as any)[parentKey] = undefined;
|
|
3621
|
-
}
|
|
3622
|
-
}
|
|
3339
|
+
authLogic = options;
|
|
3623
3340
|
}
|
|
3624
|
-
return
|
|
3341
|
+
return authLogic.delete();
|
|
3625
3342
|
}
|
|
3626
3343
|
|
|
3627
3344
|
/**
|
|
3628
|
-
*
|
|
3629
|
-
* @param name
|
|
3345
|
+
* 删除调用接口的鉴权逻辑
|
|
3346
|
+
* @param name 调用接口的鉴权逻辑名称
|
|
3630
3347
|
*/
|
|
3631
|
-
|
|
3348
|
+
removeAuthLogicForCallInterface(name: string): void;
|
|
3632
3349
|
|
|
3633
3350
|
/**
|
|
3634
|
-
*
|
|
3635
|
-
* @param
|
|
3351
|
+
* 删除调用接口的鉴权逻辑
|
|
3352
|
+
* @param authLogicForCallInterface 已有的调用接口的鉴权逻辑实例
|
|
3636
3353
|
*/
|
|
3637
|
-
|
|
3354
|
+
removeAuthLogicForCallInterface(authLogicForCallInterface: AuthLogicForCallInterface): void;
|
|
3638
3355
|
|
|
3639
|
-
|
|
3640
|
-
let
|
|
3356
|
+
removeAuthLogicForCallInterface(options: string | AuthLogicForCallInterface) {
|
|
3357
|
+
let authLogicForCallInterface: AuthLogicForCallInterface;
|
|
3641
3358
|
if (typeof options === 'string') {
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3359
|
+
authLogicForCallInterface = (this.authLogicsForCallInterface as AuthLogicForCallInterface[]).find(
|
|
3360
|
+
(item) => item.name === options,
|
|
3361
|
+
);
|
|
3362
|
+
if (!authLogicForCallInterface) {
|
|
3363
|
+
throw new Error('找不到调用接口的鉴权逻辑 ' + options);
|
|
3645
3364
|
}
|
|
3646
3365
|
} else {
|
|
3647
|
-
|
|
3648
|
-
}
|
|
3649
|
-
return integration.delete();
|
|
3650
|
-
}
|
|
3651
|
-
|
|
3652
|
-
__removeIntegration(integration: Integration) {
|
|
3653
|
-
const parentKey = integration.parentKey;
|
|
3654
|
-
const params: Params = {
|
|
3655
|
-
parentNode: this,
|
|
3656
|
-
parentKey,
|
|
3657
|
-
index: -1,
|
|
3658
|
-
object: null,
|
|
3659
|
-
oldObject: integration,
|
|
3660
|
-
};
|
|
3661
|
-
if (parentKey) {
|
|
3662
|
-
params.parentKey = parentKey;
|
|
3663
|
-
// @ts-ignore
|
|
3664
|
-
const t = this.__v_raw || this;
|
|
3665
|
-
// @ts-ignore
|
|
3666
|
-
const n = integration.__v_raw || integration;
|
|
3667
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3668
|
-
// @ts-ignore
|
|
3669
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3670
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3671
|
-
params.index = index;
|
|
3672
|
-
} else {
|
|
3673
|
-
const q = (t as any)[parentKey];
|
|
3674
|
-
if ((q.__v_raw || q) === n) {
|
|
3675
|
-
params.index = 0;
|
|
3676
|
-
(this as any)[parentKey] = undefined;
|
|
3677
|
-
}
|
|
3678
|
-
}
|
|
3366
|
+
authLogicForCallInterface = options;
|
|
3679
3367
|
}
|
|
3680
|
-
return
|
|
3368
|
+
return authLogicForCallInterface.delete();
|
|
3681
3369
|
}
|
|
3682
3370
|
|
|
3683
3371
|
/**
|
|
@@ -3705,37 +3393,6 @@ export class App extends BaseNode {
|
|
|
3705
3393
|
return connection.delete();
|
|
3706
3394
|
}
|
|
3707
3395
|
|
|
3708
|
-
__removeConnection(connection: Connection) {
|
|
3709
|
-
const parentKey = connection.parentKey;
|
|
3710
|
-
const params: Params = {
|
|
3711
|
-
parentNode: this,
|
|
3712
|
-
parentKey,
|
|
3713
|
-
index: -1,
|
|
3714
|
-
object: null,
|
|
3715
|
-
oldObject: connection,
|
|
3716
|
-
};
|
|
3717
|
-
if (parentKey) {
|
|
3718
|
-
params.parentKey = parentKey;
|
|
3719
|
-
// @ts-ignore
|
|
3720
|
-
const t = this.__v_raw || this;
|
|
3721
|
-
// @ts-ignore
|
|
3722
|
-
const n = connection.__v_raw || connection;
|
|
3723
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3724
|
-
// @ts-ignore
|
|
3725
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3726
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3727
|
-
params.index = index;
|
|
3728
|
-
} else {
|
|
3729
|
-
const q = (t as any)[parentKey];
|
|
3730
|
-
if ((q.__v_raw || q) === n) {
|
|
3731
|
-
params.index = 0;
|
|
3732
|
-
(this as any)[parentKey] = undefined;
|
|
3733
|
-
}
|
|
3734
|
-
}
|
|
3735
|
-
}
|
|
3736
|
-
return params;
|
|
3737
|
-
}
|
|
3738
|
-
|
|
3739
3396
|
/**
|
|
3740
3397
|
* 删除触发器启动器
|
|
3741
3398
|
* @param name 触发器启动器名称
|
|
@@ -3761,37 +3418,6 @@ export class App extends BaseNode {
|
|
|
3761
3418
|
return triggerLauncher.delete();
|
|
3762
3419
|
}
|
|
3763
3420
|
|
|
3764
|
-
__removeTriggerLauncher(triggerLauncher: TriggerLauncher) {
|
|
3765
|
-
const parentKey = triggerLauncher.parentKey;
|
|
3766
|
-
const params: Params = {
|
|
3767
|
-
parentNode: this,
|
|
3768
|
-
parentKey,
|
|
3769
|
-
index: -1,
|
|
3770
|
-
object: null,
|
|
3771
|
-
oldObject: triggerLauncher,
|
|
3772
|
-
};
|
|
3773
|
-
if (parentKey) {
|
|
3774
|
-
params.parentKey = parentKey;
|
|
3775
|
-
// @ts-ignore
|
|
3776
|
-
const t = this.__v_raw || this;
|
|
3777
|
-
// @ts-ignore
|
|
3778
|
-
const n = triggerLauncher.__v_raw || triggerLauncher;
|
|
3779
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3780
|
-
// @ts-ignore
|
|
3781
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3782
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3783
|
-
params.index = index;
|
|
3784
|
-
} else {
|
|
3785
|
-
const q = (t as any)[parentKey];
|
|
3786
|
-
if ((q.__v_raw || q) === n) {
|
|
3787
|
-
params.index = 0;
|
|
3788
|
-
(this as any)[parentKey] = undefined;
|
|
3789
|
-
}
|
|
3790
|
-
}
|
|
3791
|
-
}
|
|
3792
|
-
return params;
|
|
3793
|
-
}
|
|
3794
|
-
|
|
3795
3421
|
/**
|
|
3796
3422
|
* 删除元数据类型
|
|
3797
3423
|
* @param name 元数据类型名称
|
|
@@ -3817,37 +3443,6 @@ export class App extends BaseNode {
|
|
|
3817
3443
|
return metadataType.delete();
|
|
3818
3444
|
}
|
|
3819
3445
|
|
|
3820
|
-
__removeMetadataType(metadataType: MetadataType) {
|
|
3821
|
-
const parentKey = metadataType.parentKey;
|
|
3822
|
-
const params: Params = {
|
|
3823
|
-
parentNode: this,
|
|
3824
|
-
parentKey,
|
|
3825
|
-
index: -1,
|
|
3826
|
-
object: null,
|
|
3827
|
-
oldObject: metadataType,
|
|
3828
|
-
};
|
|
3829
|
-
if (parentKey) {
|
|
3830
|
-
params.parentKey = parentKey;
|
|
3831
|
-
// @ts-ignore
|
|
3832
|
-
const t = this.__v_raw || this;
|
|
3833
|
-
// @ts-ignore
|
|
3834
|
-
const n = metadataType.__v_raw || metadataType;
|
|
3835
|
-
if (Array.isArray((t as any)[parentKey])) {
|
|
3836
|
-
// @ts-ignore
|
|
3837
|
-
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
3838
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
3839
|
-
params.index = index;
|
|
3840
|
-
} else {
|
|
3841
|
-
const q = (t as any)[parentKey];
|
|
3842
|
-
if ((q.__v_raw || q) === n) {
|
|
3843
|
-
params.index = 0;
|
|
3844
|
-
(this as any)[parentKey] = undefined;
|
|
3845
|
-
}
|
|
3846
|
-
}
|
|
3847
|
-
}
|
|
3848
|
-
return params;
|
|
3849
|
-
}
|
|
3850
|
-
|
|
3851
3446
|
//================================================================================
|
|
3852
3447
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
3853
3448
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
@@ -3938,14 +3533,30 @@ export class App extends BaseNode {
|
|
|
3938
3533
|
*/
|
|
3939
3534
|
composeCache: composeCacheType = {};
|
|
3940
3535
|
|
|
3941
|
-
|
|
3942
3536
|
/**
|
|
3943
|
-
*
|
|
3537
|
+
* 判断缓存是否为空
|
|
3944
3538
|
*/
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3539
|
+
isComposeCacheEmpty() {
|
|
3540
|
+
const isEmpty = (composeCache: composeCacheType): boolean => {
|
|
3541
|
+
let result = true;
|
|
3542
|
+
for (const key in composeCache) {
|
|
3543
|
+
if (key !== 'nodes') {
|
|
3544
|
+
result = result && isEmpty(composeCache[key]);
|
|
3545
|
+
}
|
|
3546
|
+
}
|
|
3547
|
+
return result && !composeCache?.nodes?.length;
|
|
3548
|
+
};
|
|
3549
|
+
|
|
3550
|
+
return isEmpty(this.composeCache);
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
/**
|
|
3554
|
+
* 获取组合节点
|
|
3555
|
+
*/
|
|
3556
|
+
getCompose(path: string[]) {
|
|
3557
|
+
let compose = this.composeCache;
|
|
3558
|
+
path.forEach((key) => {
|
|
3559
|
+
compose = compose?.[key];
|
|
3949
3560
|
});
|
|
3950
3561
|
return compose || null;
|
|
3951
3562
|
}
|
|
@@ -3969,11 +3580,20 @@ export class App extends BaseNode {
|
|
|
3969
3580
|
path.forEach((key, index) => {
|
|
3970
3581
|
if (index === path.length - 1) {
|
|
3971
3582
|
if (compose?.[key]?.nodes) {
|
|
3583
|
+
// 需要判断下nodes里面是否已经存在
|
|
3972
3584
|
if (Array.isArray(node)) {
|
|
3973
|
-
|
|
3585
|
+
node.forEach((item) => {
|
|
3586
|
+
if (!compose[key].nodes.find((it) => it === item)) {
|
|
3587
|
+
compose[key].nodes.push(item);
|
|
3588
|
+
}
|
|
3589
|
+
});
|
|
3974
3590
|
} else {
|
|
3975
|
-
compose[key].nodes.
|
|
3591
|
+
if (!compose[key].nodes.find((it) => it === node)) {
|
|
3592
|
+
compose[key].nodes.push(node);
|
|
3593
|
+
}
|
|
3976
3594
|
}
|
|
3595
|
+
// 去重
|
|
3596
|
+
compose[key].nodes = Array.from(new Set(compose[key].nodes));
|
|
3977
3597
|
} else {
|
|
3978
3598
|
if (!compose?.[key]) {
|
|
3979
3599
|
compose[key] = {};
|
|
@@ -3998,17 +3618,28 @@ export class App extends BaseNode {
|
|
|
3998
3618
|
|
|
3999
3619
|
const delNodes = (_compose: composeCacheType) => {
|
|
4000
3620
|
if (_compose?.nodes) {
|
|
4001
|
-
for(
|
|
3621
|
+
for (const key in _compose) {
|
|
4002
3622
|
if (key !== 'nodes') {
|
|
4003
3623
|
delNodes(_compose[key]);
|
|
4004
3624
|
}
|
|
4005
3625
|
}
|
|
4006
|
-
_compose.nodes
|
|
4007
|
-
|
|
4008
|
-
|
|
3626
|
+
const arr = [..._compose.nodes] || [];
|
|
3627
|
+
const triggerNode: BaseNode[] = []; // 触点放在最后删
|
|
3628
|
+
arr.forEach((node) => {
|
|
3629
|
+
if (node.name === path?.[0]) {
|
|
3630
|
+
triggerNode.push(node);
|
|
3631
|
+
} else {
|
|
3632
|
+
node && node.delete();
|
|
3633
|
+
}
|
|
3634
|
+
});
|
|
3635
|
+
|
|
3636
|
+
triggerNode.forEach((node) => {
|
|
3637
|
+
node && node.delete();
|
|
3638
|
+
});
|
|
3639
|
+
|
|
4009
3640
|
_compose.nodes = [];
|
|
4010
3641
|
}
|
|
4011
|
-
}
|
|
3642
|
+
};
|
|
4012
3643
|
|
|
4013
3644
|
this.emit('collect:start', {
|
|
4014
3645
|
actionMsg: '删除同一分组节点',
|
|
@@ -4024,19 +3655,78 @@ export class App extends BaseNode {
|
|
|
4024
3655
|
}
|
|
4025
3656
|
|
|
4026
3657
|
/**
|
|
4027
|
-
*
|
|
3658
|
+
* 释放分组内所有节点, 包括子分组
|
|
4028
3659
|
*/
|
|
4029
3660
|
releaseComposeNode(path: string[]) {
|
|
4030
3661
|
if (!Array.isArray(path)) return;
|
|
4031
3662
|
let compose = this.composeCache;
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
3663
|
+
|
|
3664
|
+
const releaseNodes = (_compose: composeCacheType) => {
|
|
3665
|
+
if (_compose?.nodes) {
|
|
3666
|
+
for (const key in _compose) {
|
|
3667
|
+
if (key !== 'nodes') {
|
|
3668
|
+
releaseNodes(_compose[key]);
|
|
3669
|
+
}
|
|
3670
|
+
}
|
|
3671
|
+
_compose.nodes.forEach((node) => {
|
|
4036
3672
|
node.update({
|
|
4037
|
-
composedBy:
|
|
3673
|
+
composedBy: undefined,
|
|
4038
3674
|
});
|
|
4039
|
-
|
|
3675
|
+
// 临时兼容性代码,后续抽离成插件化
|
|
3676
|
+
if (node.tag === 'u-linear-layout') {
|
|
3677
|
+
const attr = node.bindAttrs.find((it: any) => it.name === 'TableDesignerLocked');
|
|
3678
|
+
if (attr) {
|
|
3679
|
+
attr.delete();
|
|
3680
|
+
}
|
|
3681
|
+
}
|
|
3682
|
+
});
|
|
3683
|
+
_compose.nodes = [];
|
|
3684
|
+
}
|
|
3685
|
+
};
|
|
3686
|
+
|
|
3687
|
+
this.emit('collect:start', {
|
|
3688
|
+
actionMsg: '释放节点',
|
|
3689
|
+
});
|
|
3690
|
+
path.forEach((key, index) => {
|
|
3691
|
+
if (index === path.length - 1) {
|
|
3692
|
+
releaseNodes(compose?.[key]);
|
|
3693
|
+
} else {
|
|
3694
|
+
compose = compose[key];
|
|
3695
|
+
}
|
|
3696
|
+
});
|
|
3697
|
+
this.emit('collect:end');
|
|
3698
|
+
}
|
|
3699
|
+
|
|
3700
|
+
/**
|
|
3701
|
+
* 删除分组内的某一个
|
|
3702
|
+
*/
|
|
3703
|
+
deleteComposeNode(path: string[], node: BaseNode) {
|
|
3704
|
+
if (!node) return;
|
|
3705
|
+
let compose = this.composeCache;
|
|
3706
|
+
path.forEach((key, index) => {
|
|
3707
|
+
if (index === path.length - 1) {
|
|
3708
|
+
if (compose?.[key]?.nodes) {
|
|
3709
|
+
const index = compose[key].nodes.findIndex((it) => it === node);
|
|
3710
|
+
if (index > -1) {
|
|
3711
|
+
compose[key].nodes.splice(index, 1);
|
|
3712
|
+
}
|
|
3713
|
+
}
|
|
3714
|
+
} else {
|
|
3715
|
+
compose = compose[key];
|
|
3716
|
+
}
|
|
3717
|
+
});
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
/**
|
|
3721
|
+
* 清空某一分组
|
|
3722
|
+
*/
|
|
3723
|
+
clearComposeNodes(path: string[]) {
|
|
3724
|
+
let compose = this.composeCache;
|
|
3725
|
+
path.forEach((key, index) => {
|
|
3726
|
+
if (index === path.length - 1) {
|
|
3727
|
+
if (compose?.[key]) {
|
|
3728
|
+
delete compose[key];
|
|
3729
|
+
}
|
|
4040
3730
|
} else {
|
|
4041
3731
|
compose = compose[key];
|
|
4042
3732
|
}
|
|
@@ -4061,7 +3751,7 @@ export class App extends BaseNode {
|
|
|
4061
3751
|
findNodeByCompleteName(originCompleteName: string) {
|
|
4062
3752
|
let completeName = originCompleteName;
|
|
4063
3753
|
// 是否是来自编辑态的自定义连接器
|
|
4064
|
-
const isFromEditableConnector = completeName
|
|
3754
|
+
const isFromEditableConnector = completeName?.endsWith(CUSTOM_CONNECTOR_EDITABLE_SUFFIX);
|
|
4065
3755
|
if (isFromEditableConnector) {
|
|
4066
3756
|
// 为了查找到真实的结构,需要去掉编辑态的后缀
|
|
4067
3757
|
completeName = completeName.replace(CUSTOM_CONNECTOR_EDITABLE_SUFFIX, '');
|
|
@@ -4077,15 +3767,17 @@ export class App extends BaseNode {
|
|
|
4077
3767
|
const mod = 0;
|
|
4078
3768
|
const modulesMap: any = {
|
|
4079
3769
|
// v3.3 版本引入自定义连接器,在配置自定义连接器时需要同步支持内部数据结构使用,所以这里做扩展
|
|
4080
|
-
extensions: [...node
|
|
3770
|
+
extensions: [...(node?.dependencies || []), ...(node?.integration?.connectors || [])],
|
|
4081
3771
|
apis: node.interfaceDependencies,
|
|
4082
3772
|
components: node.componentDependencies,
|
|
4083
3773
|
};
|
|
4084
3774
|
const modules = modulesMap[start];
|
|
4085
3775
|
if (Array.isArray(modules)) {
|
|
4086
3776
|
const moduleName = nameArr.shift();
|
|
4087
|
-
if(isFromEditableConnector) {
|
|
4088
|
-
node = modules.find(
|
|
3777
|
+
if (isFromEditableConnector) {
|
|
3778
|
+
node = modules.find(
|
|
3779
|
+
(moduleItem) => moduleItem.name === moduleName && moduleItem?.parentNode?.concept === 'Integration',
|
|
3780
|
+
);
|
|
4089
3781
|
} else {
|
|
4090
3782
|
node = modules.find((moduleItem) => moduleItem.name === moduleName);
|
|
4091
3783
|
}
|
|
@@ -4128,9 +3820,7 @@ export class App extends BaseNode {
|
|
|
4128
3820
|
packageInfo.template.version = framework.version;
|
|
4129
3821
|
|
|
4130
3822
|
packageInfo.ui.name = scope === 'h5' ? ui.h5.name : ui.pc.name;
|
|
4131
|
-
packageInfo.ui.version = scope === 'h5'
|
|
4132
|
-
? ui.h5.version
|
|
4133
|
-
: ui.pc.version;
|
|
3823
|
+
packageInfo.ui.version = scope === 'h5' ? ui.h5.version : ui.pc.version;
|
|
4134
3824
|
|
|
4135
3825
|
return packageInfo;
|
|
4136
3826
|
}
|
|
@@ -4204,7 +3894,7 @@ export class App extends BaseNode {
|
|
|
4204
3894
|
(frontends || []).forEach((frontend) => {
|
|
4205
3895
|
if (frontend.type === scope) {
|
|
4206
3896
|
const jsName = `${prefix}/packages/${
|
|
4207
|
-
prefixPath ? prefixPath
|
|
3897
|
+
prefixPath ? `${prefixPath}/` : ''
|
|
4208
3898
|
}${name}@${version}/dist-theme/index.js`;
|
|
4209
3899
|
if (!existingSet.has(jsName)) {
|
|
4210
3900
|
existingSet.add(jsName);
|
|
@@ -4534,15 +4224,6 @@ export class App extends BaseNode {
|
|
|
4534
4224
|
|
|
4535
4225
|
__databaseTypeMap: any = {};
|
|
4536
4226
|
|
|
4537
|
-
getAuthLogicExistingNames(excludedList: Array<AuthLogic> = []) {
|
|
4538
|
-
const excludedSet = new Set(excludedList);
|
|
4539
|
-
return ((this.authLogics as AuthLogic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
4540
|
-
}
|
|
4541
|
-
|
|
4542
|
-
getAuthLogicUniqueName(name = 'authentication1') {
|
|
4543
|
-
return utils.unique(name, this.getAuthLogicExistingNames(), undefined, true);
|
|
4544
|
-
}
|
|
4545
|
-
|
|
4546
4227
|
getAuthInterfaceUniqueName(name = 'authInterface1') {
|
|
4547
4228
|
// never used
|
|
4548
4229
|
}
|
|
@@ -4554,16 +4235,6 @@ export class App extends BaseNode {
|
|
|
4554
4235
|
?.values.find((item) => item.env === this.curDeployEnv)?.value;
|
|
4555
4236
|
}
|
|
4556
4237
|
|
|
4557
|
-
// FIXME: 没有设置 dontGenGetUniqueName 为什么 不会生成 唯一标识逻辑???
|
|
4558
|
-
getConnectorExistingNames(excludedList: Array<Module> = []) {
|
|
4559
|
-
const excludedSet = new Set(excludedList);
|
|
4560
|
-
return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
4561
|
-
}
|
|
4562
|
-
|
|
4563
|
-
getConnectorUniqueName(name = 'connector1') {
|
|
4564
|
-
return utils.unique(name, this.getConnectorExistingNames(), undefined, false);
|
|
4565
|
-
}
|
|
4566
|
-
|
|
4567
4238
|
/** 根据名称获取 triggerLauncher */
|
|
4568
4239
|
getTriggerLauncherByName(name: string) {
|
|
4569
4240
|
return this.triggerLaunchers.find((item) => item.name === name);
|
|
@@ -4580,363 +4251,6 @@ export class App extends BaseNode {
|
|
|
4580
4251
|
return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.title);
|
|
4581
4252
|
}
|
|
4582
4253
|
|
|
4583
|
-
getAuthLogicForCallInterfaceExistingNames(excludedList: Array<AuthLogicForCallInterface> = []) {
|
|
4584
|
-
const excludedSet = new Set(excludedList);
|
|
4585
|
-
return ((this.authLogicsForCallInterface as AuthLogicForCallInterface[]) || [])
|
|
4586
|
-
.filter((item) => !excludedSet.has(item))
|
|
4587
|
-
.map((item) => item.name);
|
|
4588
|
-
}
|
|
4589
|
-
getAuthLogicForCallInterfaceUniqueName(name = 'authLogicForCallInterface1') {
|
|
4590
|
-
return utils.unique(name, this.getAuthLogicForCallInterfaceExistingNames(), undefined, false);
|
|
4591
|
-
}
|
|
4592
|
-
//todo 替换生成
|
|
4593
|
-
getInterfaceExistingNames(excludedList: Array<Interface> = []) {
|
|
4594
|
-
const excludedSet = new Set(excludedList);
|
|
4595
|
-
return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
4596
|
-
}
|
|
4597
|
-
getInterfaceUniqueName(name = 'Interface1') {
|
|
4598
|
-
return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
|
|
4599
|
-
}
|
|
4600
|
-
|
|
4601
|
-
/**
|
|
4602
|
-
* 插入接口
|
|
4603
|
-
* @internal
|
|
4604
|
-
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
4605
|
-
*/
|
|
4606
|
-
_insertInterfaceInInterfacesAt(name: string, index: number): Interface;
|
|
4607
|
-
|
|
4608
|
-
/**
|
|
4609
|
-
* 插入接口
|
|
4610
|
-
* @internal
|
|
4611
|
-
* @param itfaceOptions 接口参数
|
|
4612
|
-
*/
|
|
4613
|
-
_insertInterfaceInInterfacesAt(itfaceOptions: Partial<Interface>, index: number): Interface;
|
|
4614
|
-
|
|
4615
|
-
/**
|
|
4616
|
-
* 插入接口
|
|
4617
|
-
* @internal
|
|
4618
|
-
* @param itface 已有的接口实例
|
|
4619
|
-
*/
|
|
4620
|
-
_insertInterfaceInInterfacesAt(itface: Interface, index: number): Interface;
|
|
4621
|
-
|
|
4622
|
-
_insertInterfaceInInterfacesAt(options: string | Partial<Interface> | Interface, index: number) {
|
|
4623
|
-
const itfaceOptions: any = {};
|
|
4624
|
-
const relationOptions = { parentNode: this, parentKey: 'interfaces' };
|
|
4625
|
-
const Interface = getConceptConstructor('Interface');
|
|
4626
|
-
let itface: Interface;
|
|
4627
|
-
if (!options) {
|
|
4628
|
-
itface = Interface.from(
|
|
4629
|
-
{
|
|
4630
|
-
...itfaceOptions,
|
|
4631
|
-
name: this.getInterfaceUniqueName(),
|
|
4632
|
-
},
|
|
4633
|
-
this,
|
|
4634
|
-
'interfaces',
|
|
4635
|
-
);
|
|
4636
|
-
} else if (typeof options === 'string') {
|
|
4637
|
-
itface = Interface.from(
|
|
4638
|
-
{
|
|
4639
|
-
...itfaceOptions,
|
|
4640
|
-
name: options,
|
|
4641
|
-
},
|
|
4642
|
-
this,
|
|
4643
|
-
'interfaces',
|
|
4644
|
-
);
|
|
4645
|
-
} else if (asserts.isInterface(options)) {
|
|
4646
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
4647
|
-
itface = options;
|
|
4648
|
-
Object.assign(itface, relationOptions);
|
|
4649
|
-
} else {
|
|
4650
|
-
itface = Interface.from(
|
|
4651
|
-
{
|
|
4652
|
-
...itfaceOptions,
|
|
4653
|
-
...options,
|
|
4654
|
-
},
|
|
4655
|
-
this,
|
|
4656
|
-
'interfaces',
|
|
4657
|
-
);
|
|
4658
|
-
}
|
|
4659
|
-
this.interfaces.splice(index, 0, itface);
|
|
4660
|
-
return itface;
|
|
4661
|
-
}
|
|
4662
|
-
|
|
4663
|
-
/**
|
|
4664
|
-
* 插入接口
|
|
4665
|
-
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
4666
|
-
*/
|
|
4667
|
-
insertInterfaceInInterfacesAt(name: string, index: number): Interface;
|
|
4668
|
-
|
|
4669
|
-
/**
|
|
4670
|
-
* 插入接口
|
|
4671
|
-
* @param itfaceOptions 接口参数
|
|
4672
|
-
*/
|
|
4673
|
-
insertInterfaceInInterfacesAt(itfaceOptions: Partial<Interface>, index: number): Interface;
|
|
4674
|
-
|
|
4675
|
-
/**
|
|
4676
|
-
* 插入接口
|
|
4677
|
-
* @param itface 已有的接口实例
|
|
4678
|
-
*/
|
|
4679
|
-
insertInterfaceInInterfacesAt(itface: Interface, index: number): Interface;
|
|
4680
|
-
|
|
4681
|
-
insertInterfaceInInterfacesAt(options: string | Partial<Interface> | Interface, index: number) {
|
|
4682
|
-
const node = this._insertInterfaceInInterfacesAt(options as any, index);
|
|
4683
|
-
node.create({
|
|
4684
|
-
index,
|
|
4685
|
-
parentNode: this,
|
|
4686
|
-
parentKey: 'interfaces',
|
|
4687
|
-
});
|
|
4688
|
-
return node;
|
|
4689
|
-
}
|
|
4690
|
-
|
|
4691
|
-
/**
|
|
4692
|
-
* 添加接口
|
|
4693
|
-
* @internal
|
|
4694
|
-
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
4695
|
-
*/
|
|
4696
|
-
_addInterfaceInInterfaces(name?: string): Interface;
|
|
4697
|
-
|
|
4698
|
-
/**
|
|
4699
|
-
* 添加接口
|
|
4700
|
-
* @internal
|
|
4701
|
-
* @param itfaceOptions 接口参数
|
|
4702
|
-
*/
|
|
4703
|
-
_addInterfaceInInterfaces(itfaceOptions: Partial<Interface>): Interface;
|
|
4704
|
-
|
|
4705
|
-
/**
|
|
4706
|
-
* 添加接口
|
|
4707
|
-
* @internal
|
|
4708
|
-
* @param itface 已有的接口实例
|
|
4709
|
-
*/
|
|
4710
|
-
_addInterfaceInInterfaces(itface: Interface): Interface;
|
|
4711
|
-
|
|
4712
|
-
_addInterfaceInInterfaces(options?: string | Partial<Interface> | Interface) {
|
|
4713
|
-
const index = 0;
|
|
4714
|
-
return this._insertInterfaceInInterfacesAt(options as any, index);
|
|
4715
|
-
}
|
|
4716
|
-
|
|
4717
|
-
/**
|
|
4718
|
-
* 添加接口
|
|
4719
|
-
* @internal
|
|
4720
|
-
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
4721
|
-
*/
|
|
4722
|
-
addInterfaceInInterfaces(name?: string): Interface;
|
|
4723
|
-
|
|
4724
|
-
/**
|
|
4725
|
-
* 添加接口
|
|
4726
|
-
* @param itfaceOptions 接口参数
|
|
4727
|
-
*/
|
|
4728
|
-
addInterfaceInInterfaces(itfaceOptions: Partial<Interface>): Interface;
|
|
4729
|
-
|
|
4730
|
-
/**
|
|
4731
|
-
* 添加接口
|
|
4732
|
-
* @param itface 已有的接口实例
|
|
4733
|
-
*/
|
|
4734
|
-
addInterfaceInInterfaces(itface: Interface): Interface;
|
|
4735
|
-
|
|
4736
|
-
addInterfaceInInterfaces(options?: string | Partial<Interface> | Interface) {
|
|
4737
|
-
const node = this._addInterfaceInInterfaces(options as any);
|
|
4738
|
-
const index = this.interfaces.indexOf(node);
|
|
4739
|
-
node.create({
|
|
4740
|
-
index,
|
|
4741
|
-
parentNode: this,
|
|
4742
|
-
parentKey: 'interfaces',
|
|
4743
|
-
});
|
|
4744
|
-
return node;
|
|
4745
|
-
}
|
|
4746
|
-
|
|
4747
|
-
/**
|
|
4748
|
-
* 插入鉴权接口
|
|
4749
|
-
* @internal
|
|
4750
|
-
* @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
|
|
4751
|
-
*/
|
|
4752
|
-
_insertAuthInterfaceInInterfacesAt(name: string, index: number): AuthInterface;
|
|
4753
|
-
|
|
4754
|
-
/**
|
|
4755
|
-
* 插入鉴权接口
|
|
4756
|
-
* @internal
|
|
4757
|
-
* @param itfaceOptions 鉴权接口参数
|
|
4758
|
-
*/
|
|
4759
|
-
_insertAuthInterfaceInInterfacesAt(itfaceOptions: Partial<AuthInterface>, index: number): AuthInterface;
|
|
4760
|
-
|
|
4761
|
-
/**
|
|
4762
|
-
* 插入鉴权接口
|
|
4763
|
-
* @internal
|
|
4764
|
-
* @param itface 已有的鉴权接口实例
|
|
4765
|
-
*/
|
|
4766
|
-
_insertAuthInterfaceInInterfacesAt(itface: AuthInterface, index: number): AuthInterface;
|
|
4767
|
-
|
|
4768
|
-
_insertAuthInterfaceInInterfacesAt(options: string | Partial<AuthInterface> | AuthInterface, index: number) {
|
|
4769
|
-
const itfaceOptions: any = {};
|
|
4770
|
-
const relationOptions = { parentNode: this, parentKey: 'interfaces' };
|
|
4771
|
-
const AuthInterface = getConceptConstructor('AuthInterface');
|
|
4772
|
-
let itface: AuthInterface;
|
|
4773
|
-
if (!options) {
|
|
4774
|
-
itface = AuthInterface.from(
|
|
4775
|
-
{
|
|
4776
|
-
...itfaceOptions,
|
|
4777
|
-
name: this.getAuthInterfaceUniqueName(),
|
|
4778
|
-
},
|
|
4779
|
-
this,
|
|
4780
|
-
'interfaces',
|
|
4781
|
-
);
|
|
4782
|
-
} else if (typeof options === 'string') {
|
|
4783
|
-
itface = AuthInterface.from(
|
|
4784
|
-
{
|
|
4785
|
-
...itfaceOptions,
|
|
4786
|
-
name: options,
|
|
4787
|
-
},
|
|
4788
|
-
this,
|
|
4789
|
-
'interfaces',
|
|
4790
|
-
);
|
|
4791
|
-
} else if (asserts.isAuthInterface(options)) {
|
|
4792
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
4793
|
-
itface = options;
|
|
4794
|
-
Object.assign(itface, relationOptions);
|
|
4795
|
-
} else {
|
|
4796
|
-
itface = AuthInterface.from(
|
|
4797
|
-
{
|
|
4798
|
-
...itfaceOptions,
|
|
4799
|
-
...options,
|
|
4800
|
-
},
|
|
4801
|
-
this,
|
|
4802
|
-
'interfaces',
|
|
4803
|
-
);
|
|
4804
|
-
}
|
|
4805
|
-
this.interfaces.splice(index, 0, itface);
|
|
4806
|
-
return itface;
|
|
4807
|
-
}
|
|
4808
|
-
|
|
4809
|
-
/**
|
|
4810
|
-
* 插入鉴权接口
|
|
4811
|
-
* @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
|
|
4812
|
-
*/
|
|
4813
|
-
insertAuthInterfaceInInterfacesAt(name: string, index: number): AuthInterface;
|
|
4814
|
-
|
|
4815
|
-
/**
|
|
4816
|
-
* 插入鉴权接口
|
|
4817
|
-
* @param itfaceOptions 鉴权接口参数
|
|
4818
|
-
*/
|
|
4819
|
-
insertAuthInterfaceInInterfacesAt(itfaceOptions: Partial<AuthInterface>, index: number): AuthInterface;
|
|
4820
|
-
|
|
4821
|
-
/**
|
|
4822
|
-
* 插入鉴权接口
|
|
4823
|
-
* @param itface 已有的鉴权接口实例
|
|
4824
|
-
*/
|
|
4825
|
-
insertAuthInterfaceInInterfacesAt(itface: AuthInterface, index: number): AuthInterface;
|
|
4826
|
-
|
|
4827
|
-
insertAuthInterfaceInInterfacesAt(options: string | Partial<AuthInterface> | AuthInterface, index: number) {
|
|
4828
|
-
const node = this._insertAuthInterfaceInInterfacesAt(options as any, index);
|
|
4829
|
-
node.create({
|
|
4830
|
-
index,
|
|
4831
|
-
parentNode: this,
|
|
4832
|
-
parentKey: 'interfaces',
|
|
4833
|
-
});
|
|
4834
|
-
return node;
|
|
4835
|
-
}
|
|
4836
|
-
|
|
4837
|
-
/**
|
|
4838
|
-
* 添加鉴权接口
|
|
4839
|
-
* @internal
|
|
4840
|
-
* @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
|
|
4841
|
-
*/
|
|
4842
|
-
_addAuthInterfaceInInterfaces(name?: string): AuthInterface;
|
|
4843
|
-
|
|
4844
|
-
/**
|
|
4845
|
-
* 添加鉴权接口
|
|
4846
|
-
* @internal
|
|
4847
|
-
* @param itfaceOptions 鉴权接口参数
|
|
4848
|
-
*/
|
|
4849
|
-
_addAuthInterfaceInInterfaces(itfaceOptions: Partial<AuthInterface>): AuthInterface;
|
|
4850
|
-
|
|
4851
|
-
/**
|
|
4852
|
-
* 添加鉴权接口
|
|
4853
|
-
* @internal
|
|
4854
|
-
* @param itface 已有的鉴权接口实例
|
|
4855
|
-
*/
|
|
4856
|
-
_addAuthInterfaceInInterfaces(itface: AuthInterface): AuthInterface;
|
|
4857
|
-
|
|
4858
|
-
_addAuthInterfaceInInterfaces(options?: string | Partial<AuthInterface> | AuthInterface) {
|
|
4859
|
-
const index = 0;
|
|
4860
|
-
return this._insertAuthInterfaceInInterfacesAt(options as any, index);
|
|
4861
|
-
}
|
|
4862
|
-
|
|
4863
|
-
/**
|
|
4864
|
-
* 添加鉴权接口
|
|
4865
|
-
* @internal
|
|
4866
|
-
* @param name 鉴权接口名称,如果不填会自动生成一个唯一名称
|
|
4867
|
-
*/
|
|
4868
|
-
addAuthInterfaceInInterfaces(name?: string): AuthInterface;
|
|
4869
|
-
|
|
4870
|
-
/**
|
|
4871
|
-
* 添加鉴权接口
|
|
4872
|
-
* @param itfaceOptions 鉴权接口参数
|
|
4873
|
-
*/
|
|
4874
|
-
addAuthInterfaceInInterfaces(itfaceOptions: Partial<AuthInterface>): AuthInterface;
|
|
4875
|
-
|
|
4876
|
-
/**
|
|
4877
|
-
* 添加鉴权接口
|
|
4878
|
-
* @param itface 已有的鉴权接口实例
|
|
4879
|
-
*/
|
|
4880
|
-
addAuthInterfaceInInterfaces(itface: AuthInterface): AuthInterface;
|
|
4881
|
-
|
|
4882
|
-
addAuthInterfaceInInterfaces(options?: string | Partial<AuthInterface> | AuthInterface) {
|
|
4883
|
-
const node = this._addAuthInterfaceInInterfaces(options as any);
|
|
4884
|
-
const index = this.interfaces.indexOf(node);
|
|
4885
|
-
node.create({
|
|
4886
|
-
index,
|
|
4887
|
-
parentNode: this,
|
|
4888
|
-
parentKey: 'interfaces',
|
|
4889
|
-
});
|
|
4890
|
-
return node;
|
|
4891
|
-
}
|
|
4892
|
-
|
|
4893
|
-
/**
|
|
4894
|
-
* 删除鉴权接口
|
|
4895
|
-
* @param name 鉴权接口名称
|
|
4896
|
-
*/
|
|
4897
|
-
removeAuthInterfaceInInterfaces(name: string): void;
|
|
4898
|
-
|
|
4899
|
-
/**
|
|
4900
|
-
* 删除鉴权接口
|
|
4901
|
-
* @param itface 已有的鉴权接口实例
|
|
4902
|
-
*/
|
|
4903
|
-
removeAuthInterfaceInInterfaces(itface: AuthInterface): void;
|
|
4904
|
-
|
|
4905
|
-
removeAuthInterfaceInInterfaces(options: string | AuthInterface) {
|
|
4906
|
-
let itface: AuthInterface;
|
|
4907
|
-
if (typeof options === 'string') {
|
|
4908
|
-
itface = (this.interfaces as AuthInterface[]).find((item) => item.name === options);
|
|
4909
|
-
if (!itface) {
|
|
4910
|
-
throw new Error('找不到鉴权接口 ' + options);
|
|
4911
|
-
}
|
|
4912
|
-
} else {
|
|
4913
|
-
itface = options;
|
|
4914
|
-
}
|
|
4915
|
-
return itface.delete();
|
|
4916
|
-
}
|
|
4917
|
-
|
|
4918
|
-
__removeInterface(itface: Interface) {
|
|
4919
|
-
const parentKey = itface.parentKey;
|
|
4920
|
-
const params: Params = {
|
|
4921
|
-
parentNode: this,
|
|
4922
|
-
parentKey,
|
|
4923
|
-
index: -1,
|
|
4924
|
-
object: null,
|
|
4925
|
-
oldObject: itface,
|
|
4926
|
-
};
|
|
4927
|
-
if (parentKey) {
|
|
4928
|
-
params.parentKey = parentKey;
|
|
4929
|
-
if (Array.isArray((this as any)[parentKey])) {
|
|
4930
|
-
const index = (this as any)[parentKey].indexOf(itface);
|
|
4931
|
-
~index && (this as any)[parentKey].splice(index, 1);
|
|
4932
|
-
params.index = index;
|
|
4933
|
-
} else if ((this as any)[parentKey] === itface) {
|
|
4934
|
-
params.index = 0;
|
|
4935
|
-
(this as any)[parentKey] = undefined;
|
|
4936
|
-
}
|
|
4937
|
-
}
|
|
4938
|
-
return params;
|
|
4939
|
-
}
|
|
4940
4254
|
/** hank */
|
|
4941
4255
|
// setConnector() {
|
|
4942
4256
|
// const [a, b, c, d, e, f] = this.connections;
|