@lcap/nasl 1.0.0-alpha.2 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/docs/assets/search.js +1 -1
- package/docs/classes/Entity.html +2832 -204
- package/docs/classes/View.html +4567 -365
- package/out/common/BaseNode.js +23 -16
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +77 -15
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +2 -1
- package/out/concepts/Argument__.js +2 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +2 -1
- package/out/concepts/Assignment__.js +3 -8
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +2 -1
- package/out/concepts/BinaryExpression__.js +5 -5
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +2 -1
- package/out/concepts/BindAttribute__.js +9 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +2 -1
- package/out/concepts/BindDirective__.js +2 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +2 -1
- package/out/concepts/BindEvent__.js +4 -3
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +2 -1
- package/out/concepts/BooleanLiteral__.js +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +57 -1
- package/out/concepts/CallFunction__.js +119 -11
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -1
- package/out/concepts/CallInterface__.js +2 -2
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +57 -1
- package/out/concepts/CallLogic__.js +117 -10
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +1 -1
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +120 -0
- package/out/concepts/ConfigGroup__.js +214 -0
- package/out/concepts/ConfigGroup__.js.map +1 -0
- package/out/concepts/ConfigPropertyValue__.d.ts +43 -0
- package/out/concepts/ConfigPropertyValue__.js +103 -0
- package/out/concepts/ConfigPropertyValue__.js.map +1 -0
- package/out/concepts/ConfigProperty__.d.ts +128 -0
- package/out/concepts/ConfigProperty__.js +236 -0
- package/out/concepts/ConfigProperty__.js.map +1 -0
- package/out/concepts/Configuration__.d.ts +120 -0
- package/out/concepts/Configuration__.js +210 -0
- package/out/concepts/Configuration__.js.map +1 -0
- package/out/concepts/Constant__.d.ts +2 -1
- package/out/concepts/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +2 -1
- package/out/concepts/Destination__.js +4 -3
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +8 -0
- package/out/concepts/EntityIndex__.js +18 -0
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +5 -5
- package/out/concepts/EntityProperty__.js +10 -9
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +30 -26
- package/out/concepts/Entity__.js +44 -36
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +8 -8
- package/out/concepts/Enum__.js +10 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +35 -33
- package/out/concepts/ForEachStatement__.js +103 -36
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -1
- package/out/concepts/Identifier__.js +15 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +1 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +5 -1
- package/out/concepts/Interface__.js +19 -5
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -1
- package/out/concepts/LogicItem__.js +2 -2
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +9 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +2 -5
- package/out/concepts/MemberExpression__.js +12 -18
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +121 -126
- package/out/concepts/Module__.js +10 -17
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +12 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +2 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +2 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -1
- package/out/concepts/Param__.js +2 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +2 -2
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +82 -81
- package/out/concepts/ProcessElement__.js +19 -6
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.d.ts +1 -0
- package/out/concepts/Process__.js +10 -4
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +2 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +5 -0
- package/out/concepts/Role__.js +19 -2
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +2 -0
- package/out/concepts/SqlQueryComponent__.js +16 -0
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +2 -1
- package/out/concepts/StringLiteral__.js +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +1 -1
- package/out/concepts/StructureProperty__.js +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -1
- package/out/concepts/Structure__.js +4 -4
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +3 -0
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +2 -1
- package/out/concepts/UnaryExpression__.js +3 -3
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +2 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +2 -1
- package/out/concepts/ValidationRule__.js +2 -2
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +6 -5
- package/out/concepts/Variable__.js +3 -3
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +5 -5
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +5 -4
- package/out/concepts/ViewElement__.js +109 -65
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +97 -90
- package/out/concepts/View__.js +153 -118
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +2 -2
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +3 -137
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +21 -5
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.validation.js +527 -0
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
- package/out/concepts/index__.d.ts +4 -0
- package/out/concepts/index__.js +4 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/data/Module.d.ts +34 -0
- package/out/data/Module.js +53 -0
- package/out/data/Module.js.map +1 -0
- package/out/generator/compileComponent.d.ts +1 -1
- package/out/generator/genBundleFiles.d.ts +0 -1
- package/out/generator/genBundleFiles.js +1 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +35 -0
- package/out/generator/genMetaData.js +78 -0
- package/out/generator/genMetaData.js.map +1 -0
- package/out/generator/index.d.ts +1 -0
- package/out/generator/index.js +1 -0
- package/out/generator/index.js.map +1 -1
- package/out/index.d.ts +2 -2
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/server/createUiTs.d.ts +7 -0
- package/out/server/createUiTs.js +157 -0
- package/out/server/createUiTs.js.map +1 -0
- package/out/server/entity2LogicNamespace.d.ts +9 -1
- package/out/server/entity2LogicNamespace.js +11 -1
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/getExtensionModules.d.ts +3 -0
- package/out/server/getExtensionModules.js +18 -0
- package/out/server/getExtensionModules.js.map +1 -0
- package/out/server/getLogics.js +18 -15
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +3 -2
- package/out/server/getMemberIdentifier.js +47 -15
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +4 -1
- package/out/server/getProcesses.js +16 -7
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getValidates.js +1 -1
- package/out/server/getValidates.js.map +1 -1
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +23 -5
- package/out/server/naslServer.js +199 -25
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.d.ts +15 -1
- package/out/server/process2LogicNamespace.js +30 -3
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.js +28 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +5 -0
- package/out/service/storage/init.js +60 -52
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCallComponentLogic.js +2 -2
- package/out/templator/genCallComponentLogic.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -8
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +3 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -4
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -3
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +2 -2
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +1 -1
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +8 -12
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +20 -20
- package/out/templator/utils.js +22 -22
- package/out/templator/utils.js.map +1 -1
- package/package.json +2 -1
- package/src/automate/engine/index.js +37 -3
- package/src/automate/engine/utils.js +68 -64
- package/src/common/BaseNode.ts +24 -17
- package/src/concepts/App__.ts +93 -17
- package/src/concepts/Argument__.ts +4 -2
- package/src/concepts/Assignment__.ts +5 -7
- package/src/concepts/Attribute__.ts +1 -0
- package/src/concepts/BinaryExpression__.ts +7 -5
- package/src/concepts/BindAttribute__.ts +9 -4
- package/src/concepts/BindDirective__.ts +4 -2
- package/src/concepts/BindEvent__.ts +6 -4
- package/src/concepts/BooleanLiteral__.ts +3 -1
- package/src/concepts/CallFunction__.ts +195 -11
- package/src/concepts/CallInterface__.ts +4 -2
- package/src/concepts/CallLogic__.ts +211 -12
- package/src/concepts/CallQueryComponent__.ts +2 -1
- package/src/concepts/Comment__.ts +1 -0
- package/src/concepts/CompletionProperty__.ts +1 -0
- package/src/concepts/ConfigGroup__.ts +290 -0
- package/src/concepts/ConfigPropertyValue__.ts +112 -0
- package/src/concepts/ConfigProperty__.ts +306 -0
- package/src/concepts/Configuration__.ts +286 -0
- package/src/concepts/Constant__.ts +3 -1
- package/src/concepts/DataElement__.ts +1 -0
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/EntityIndex__.ts +19 -0
- package/src/concepts/EntityProperty__.ts +9 -8
- package/src/concepts/Entity__.ts +66 -59
- package/src/concepts/EnumItem__.ts +1 -0
- package/src/concepts/Enum__.ts +32 -12
- package/src/concepts/Event__.ts +2 -1
- package/src/concepts/ForEachStatement__.ts +115 -69
- package/src/concepts/Function__.ts +2 -1
- package/src/concepts/Identifier__.ts +18 -1
- package/src/concepts/IfStatement__.ts +1 -0
- package/src/concepts/InterfaceParam__.ts +2 -1
- package/src/concepts/Interface__.ts +21 -5
- package/src/concepts/JSBlock__.ts +1 -0
- package/src/concepts/LogicItem__.ts +9 -40
- package/src/concepts/Logic__.ts +48 -9
- package/src/concepts/MemberExpression__.ts +14 -17
- package/src/concepts/Module__.ts +158 -139
- package/src/concepts/Namespace__.ts +13 -12
- package/src/concepts/NullLiteral__.ts +3 -1
- package/src/concepts/NumericLiteral__.ts +3 -1
- package/src/concepts/Param__.ts +3 -2
- package/src/concepts/Point__.ts +1 -0
- package/src/concepts/ProcessComponent__.ts +3 -2
- package/src/concepts/ProcessElement__.ts +102 -107
- package/src/concepts/ProcessOutcome__.ts +1 -0
- package/src/concepts/Process__.ts +12 -4
- package/src/concepts/QueryAggregateExpression__.ts +1 -0
- package/src/concepts/QueryFieldExpression__.ts +2 -1
- package/src/concepts/QueryFromExpression__.ts +1 -0
- package/src/concepts/QueryGroupByExpression__.ts +1 -0
- package/src/concepts/QueryJoinExpression__.ts +2 -1
- package/src/concepts/QueryLimitExpression__.ts +1 -0
- package/src/concepts/QueryOrderByExpression__.ts +1 -0
- package/src/concepts/QuerySelectExpression__.ts +2 -1
- package/src/concepts/Rect__.ts +1 -0
- package/src/concepts/Return__.ts +3 -2
- package/src/concepts/Role__.ts +19 -2
- package/src/concepts/Slot__.ts +1 -0
- package/src/concepts/SqlQueryComponent__.ts +11 -1
- package/src/concepts/Start__.ts +1 -0
- package/src/concepts/StringLiteral__.ts +3 -1
- package/src/concepts/StructureProperty__.ts +2 -1
- package/src/concepts/Structure__.ts +5 -4
- package/src/concepts/SwitchCase__.ts +1 -0
- package/src/concepts/SwitchStatement__.ts +1 -0
- package/src/concepts/Theme__.ts +1 -0
- package/src/concepts/Transactional__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +4 -0
- package/src/concepts/TypeParam__.ts +1 -0
- package/src/concepts/UnaryExpression__.ts +6 -3
- package/src/concepts/Unparsed__.ts +3 -1
- package/src/concepts/UseComponent__.ts +1 -0
- package/src/concepts/ValidationRule__.ts +5 -2
- package/src/concepts/Variable__.ts +12 -6
- package/src/concepts/ViewComponent__.ts +6 -5
- package/src/concepts/ViewElement__.ts +109 -80
- package/src/concepts/View__.ts +245 -206
- package/src/concepts/WhileStatement__.ts +1 -0
- package/src/concepts/basics/stdlib/index.ts +2 -2
- package/src/concepts/basics/stdlib/nasl.ui.ts +3 -137
- package/src/concepts/basics/stdlib/nasl.util.ts +21 -5
- package/src/concepts/basics/stdlib/{nasl.validate.ts → nasl.validation.ts} +28 -28
- package/src/concepts/index__.ts +4 -0
- package/src/generator/compileComponent.ts +1 -1
- package/src/generator/genBundleFiles.ts +1 -2
- package/src/generator/genMetaData.ts +111 -0
- package/src/generator/index.ts +1 -0
- package/src/index.ts +2 -2
- package/src/server/createUiTs.ts +153 -0
- package/src/server/entity2LogicNamespace.ts +17 -1
- package/src/server/getExtensionModules.ts +13 -0
- package/src/server/getLogics.ts +19 -18
- package/src/server/getMemberIdentifier.ts +60 -19
- package/src/server/getProcesses.ts +15 -8
- package/src/server/getValidates.ts +1 -1
- package/src/server/index.ts +2 -1
- package/src/server/naslServer.ts +204 -24
- package/src/server/process2LogicNamespace.ts +44 -3
- package/src/server/translator.ts +121 -97
- package/src/service/config/api.js +32 -0
- package/src/service/config/index.js +6 -0
- package/src/service/creator/index.js +2 -2
- package/src/service/logic/checktypeSocket.js +49 -0
- package/src/service/modules/api.js +20 -0
- package/src/service/modules/index.js +6 -0
- package/src/service/storage/init.ts +62 -54
- package/src/templator/genCallComponentLogic.ts +2 -2
- package/src/templator/genCreateBlock.ts +19 -25
- package/src/templator/genCurdEditMultipleKeyBlock.ts +3 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -4
- package/src/templator/genEditTableBlock.ts +3 -3
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genListViewBlock.ts +2 -2
- package/src/templator/genSelectBlock.ts +1 -1
- package/src/templator/genUpdateBlock.ts +19 -25
- package/src/templator/utils.ts +25 -153
|
@@ -7,6 +7,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
7
7
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
8
8
|
|
|
9
9
|
import * as utils from '../utils';
|
|
10
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
11
|
import BaseNode from '../common/BaseNode';
|
|
11
12
|
import classMap from '../common/classMap';
|
|
12
13
|
import LogicItem from './LogicItem__';
|
|
@@ -8,13 +8,13 @@ import naslUi from './nasl.ui';
|
|
|
8
8
|
import naslInterface from './nasl.interface';
|
|
9
9
|
import naslUtil from './nasl.util';
|
|
10
10
|
import naslProcess from './nasl.process';
|
|
11
|
-
import
|
|
11
|
+
import naslValidation from './nasl.validation';
|
|
12
12
|
|
|
13
13
|
export { reference2TypeAnnotationList } from './reference2TypeAnnotationList';
|
|
14
14
|
export const stdlibNamespace = new Namespace({
|
|
15
15
|
name: 'nasl',
|
|
16
16
|
path: 'nasl',
|
|
17
|
-
children: [naslCore, naslCollection, naslInterface, naslUi, naslUtil, naslProcess,
|
|
17
|
+
children: [naslCore, naslCollection, naslInterface, naslUi, naslUtil, naslProcess, naslValidation],
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
export default stdlibNamespace;
|
|
@@ -65,31 +65,11 @@ export const uiStructures = [
|
|
|
65
65
|
}),
|
|
66
66
|
new Structure({
|
|
67
67
|
name: 'EventTarget',
|
|
68
|
-
properties: [
|
|
69
|
-
new StructureProperty({
|
|
70
|
-
name: 'preventDefault',
|
|
71
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
72
|
-
}),
|
|
73
|
-
],
|
|
68
|
+
properties: [],
|
|
74
69
|
}),
|
|
75
70
|
new Structure({
|
|
76
71
|
name: 'MouseEvent',
|
|
77
72
|
properties: [
|
|
78
|
-
new StructureProperty({
|
|
79
|
-
name: 'target',
|
|
80
|
-
description: '事件对象',
|
|
81
|
-
typeAnnotation: TypeAnnotation.createReference('EventTarget'),
|
|
82
|
-
}),
|
|
83
|
-
new StructureProperty({
|
|
84
|
-
name: 'currentTarget',
|
|
85
|
-
description: '事件对象',
|
|
86
|
-
typeAnnotation: TypeAnnotation.createReference('EventTarget'),
|
|
87
|
-
}),
|
|
88
|
-
new StructureProperty({
|
|
89
|
-
name: 'relatedTarget',
|
|
90
|
-
description: '事件对象',
|
|
91
|
-
typeAnnotation: TypeAnnotation.createReference('EventTarget'),
|
|
92
|
-
}),
|
|
93
73
|
new StructureProperty({
|
|
94
74
|
name: 'altKey',
|
|
95
75
|
description: '如果alt 键被按下,返回true',
|
|
@@ -161,7 +141,7 @@ export const uiStructures = [
|
|
|
161
141
|
typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
|
|
162
142
|
}),
|
|
163
143
|
new StructureProperty({
|
|
164
|
-
name: '
|
|
144
|
+
name: 'which',
|
|
165
145
|
description: '对应(键盘)按下的数字类型的 keyCode',
|
|
166
146
|
typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
|
|
167
147
|
}),
|
|
@@ -201,7 +181,7 @@ export const uiStructures = [
|
|
|
201
181
|
typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
|
|
202
182
|
}),
|
|
203
183
|
new StructureProperty({
|
|
204
|
-
name: '
|
|
184
|
+
name: 'which',
|
|
205
185
|
description: '对应(键盘)按下的数字类型的 keyCode',
|
|
206
186
|
typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
|
|
207
187
|
}),
|
|
@@ -249,11 +229,6 @@ export const uiStructures = [
|
|
|
249
229
|
description: '改变后的值是否合法',
|
|
250
230
|
typeAnnotation: TypeAnnotation.createPrimitive('Boolean'),
|
|
251
231
|
}),
|
|
252
|
-
new StructureProperty({
|
|
253
|
-
name: 'preventDefault',
|
|
254
|
-
description: '阻止改变流程',
|
|
255
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
256
|
-
}),
|
|
257
232
|
],
|
|
258
233
|
}),
|
|
259
234
|
new Structure({
|
|
@@ -274,11 +249,6 @@ export const uiStructures = [
|
|
|
274
249
|
description: '',
|
|
275
250
|
typeAnnotation: TypeAnnotation.createPrimitive('Boolean'),
|
|
276
251
|
}),
|
|
277
|
-
new StructureProperty({
|
|
278
|
-
name: 'preventDefault',
|
|
279
|
-
description: '阻止改变流程',
|
|
280
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
281
|
-
}),
|
|
282
252
|
],
|
|
283
253
|
}),
|
|
284
254
|
new Structure({
|
|
@@ -309,26 +279,11 @@ export const uiStructures = [
|
|
|
309
279
|
description: '旧的选择项相关对象',
|
|
310
280
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
311
281
|
}),
|
|
312
|
-
new StructureProperty({
|
|
313
|
-
name: 'itemVM',
|
|
314
|
-
description: '选择项子组件',
|
|
315
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
316
|
-
}),
|
|
317
|
-
new StructureProperty({
|
|
318
|
-
name: 'oldVM',
|
|
319
|
-
description: '旧的选择项子组件',
|
|
320
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
321
|
-
}),
|
|
322
282
|
new StructureProperty({
|
|
323
283
|
name: 'label',
|
|
324
284
|
description: '此选框的标签',
|
|
325
285
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
326
286
|
}),
|
|
327
|
-
new StructureProperty({
|
|
328
|
-
name: 'preventDefault',
|
|
329
|
-
description: '阻止改变流程',
|
|
330
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
331
|
-
}),
|
|
332
287
|
],
|
|
333
288
|
}),
|
|
334
289
|
new Structure({
|
|
@@ -344,11 +299,6 @@ export const uiStructures = [
|
|
|
344
299
|
description: '该选中项相关对象',
|
|
345
300
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
346
301
|
}),
|
|
347
|
-
new StructureProperty({
|
|
348
|
-
name: 'itemVM',
|
|
349
|
-
description: '该选中项子组件',
|
|
350
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
351
|
-
}),
|
|
352
302
|
new StructureProperty({
|
|
353
303
|
name: 'value',
|
|
354
304
|
description: '所有选中项的值',
|
|
@@ -377,20 +327,6 @@ export const uiStructures = [
|
|
|
377
327
|
typeArguments: [TypeAnnotation.createTypeParam('T')],
|
|
378
328
|
}),
|
|
379
329
|
}),
|
|
380
|
-
new StructureProperty({
|
|
381
|
-
name: 'itemVMs',
|
|
382
|
-
description: '所有选中项子组件的数组',
|
|
383
|
-
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
384
|
-
typeArguments: [TypeAnnotation.createTypeParam('T')],
|
|
385
|
-
}),
|
|
386
|
-
}),
|
|
387
|
-
new StructureProperty({
|
|
388
|
-
name: 'oldVMs',
|
|
389
|
-
description: '旧的所有选中项子组件的数组',
|
|
390
|
-
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
391
|
-
typeArguments: [TypeAnnotation.createTypeParam('T')],
|
|
392
|
-
}),
|
|
393
|
-
}),
|
|
394
330
|
],
|
|
395
331
|
}),
|
|
396
332
|
new Structure({
|
|
@@ -430,11 +366,6 @@ export const uiStructures = [
|
|
|
430
366
|
description: '选择项相关对象',
|
|
431
367
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
432
368
|
}),
|
|
433
|
-
new StructureProperty({
|
|
434
|
-
name: 'itemVM',
|
|
435
|
-
description: '选择项子组件',
|
|
436
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
437
|
-
}),
|
|
438
369
|
],
|
|
439
370
|
}),
|
|
440
371
|
new Structure({
|
|
@@ -465,26 +396,6 @@ export const uiStructures = [
|
|
|
465
396
|
description: '节点相关对象',
|
|
466
397
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
467
398
|
}),
|
|
468
|
-
new StructureProperty({
|
|
469
|
-
name: 'nodeVM',
|
|
470
|
-
description: '节点组件',
|
|
471
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
472
|
-
}),
|
|
473
|
-
new StructureProperty({
|
|
474
|
-
name: 'itemVM',
|
|
475
|
-
description: '面板组件',
|
|
476
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
477
|
-
}),
|
|
478
|
-
new StructureProperty({
|
|
479
|
-
name: 'groupVM',
|
|
480
|
-
description: '分组组件',
|
|
481
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
482
|
-
}),
|
|
483
|
-
new StructureProperty({
|
|
484
|
-
name: 'preventDefault',
|
|
485
|
-
description: '阻止改变流程',
|
|
486
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
487
|
-
}),
|
|
488
399
|
],
|
|
489
400
|
}),
|
|
490
401
|
new Structure({
|
|
@@ -540,11 +451,6 @@ export const uiStructures = [
|
|
|
540
451
|
description: '当前数据',
|
|
541
452
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
542
453
|
}),
|
|
543
|
-
new StructureProperty({
|
|
544
|
-
name: 'preventDefault',
|
|
545
|
-
description: '阻止改变流程',
|
|
546
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
547
|
-
}),
|
|
548
454
|
],
|
|
549
455
|
}),
|
|
550
456
|
new Structure({
|
|
@@ -635,11 +541,6 @@ export const uiStructures = [
|
|
|
635
541
|
description: '旧的页数',
|
|
636
542
|
typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
|
|
637
543
|
}),
|
|
638
|
-
new StructureProperty({
|
|
639
|
-
name: 'preventDefault',
|
|
640
|
-
description: '阻止改变流程',
|
|
641
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
642
|
-
}),
|
|
643
544
|
],
|
|
644
545
|
}),
|
|
645
546
|
new Structure({
|
|
@@ -660,11 +561,6 @@ export const uiStructures = [
|
|
|
660
561
|
description: '提示停留的时间',
|
|
661
562
|
typeAnnotation: TypeAnnotation.createPrimitive('Integer'),
|
|
662
563
|
}),
|
|
663
|
-
new StructureProperty({
|
|
664
|
-
name: 'preventDefault',
|
|
665
|
-
description: '阻止改变流程',
|
|
666
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
667
|
-
}),
|
|
668
564
|
],
|
|
669
565
|
}),
|
|
670
566
|
new Structure({
|
|
@@ -733,21 +629,6 @@ export const uiStructures = [
|
|
|
733
629
|
description: '旧的选择项相关对象',
|
|
734
630
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
735
631
|
}),
|
|
736
|
-
new StructureProperty({
|
|
737
|
-
name: 'nodeVM',
|
|
738
|
-
description: '选择项子组件',
|
|
739
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
740
|
-
}),
|
|
741
|
-
new StructureProperty({
|
|
742
|
-
name: 'oldVM',
|
|
743
|
-
description: '旧的选择项子组件',
|
|
744
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
745
|
-
}),
|
|
746
|
-
new StructureProperty({
|
|
747
|
-
name: 'preventDefault',
|
|
748
|
-
description: '阻止改变流程',
|
|
749
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
750
|
-
}),
|
|
751
632
|
],
|
|
752
633
|
}),
|
|
753
634
|
new Structure({
|
|
@@ -782,11 +663,6 @@ export const uiStructures = [
|
|
|
782
663
|
description: '选择项相关对象',
|
|
783
664
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
784
665
|
}),
|
|
785
|
-
new StructureProperty({
|
|
786
|
-
name: 'nodeVM',
|
|
787
|
-
description: '选择项子组件',
|
|
788
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
789
|
-
}),
|
|
790
666
|
new StructureProperty({
|
|
791
667
|
name: 'item',
|
|
792
668
|
description: '选择项相关对象',
|
|
@@ -822,11 +698,6 @@ export const uiStructures = [
|
|
|
822
698
|
description: '服务器回传信息',
|
|
823
699
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
824
700
|
}),
|
|
825
|
-
new StructureProperty({
|
|
826
|
-
name: 'preventDefault',
|
|
827
|
-
description: '阻止改变流程',
|
|
828
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
829
|
-
}),
|
|
830
701
|
],
|
|
831
702
|
}),
|
|
832
703
|
new Structure({
|
|
@@ -887,11 +758,6 @@ export const uiStructures = [
|
|
|
887
758
|
description: '排序比较函数',
|
|
888
759
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
889
760
|
}),
|
|
890
|
-
new StructureProperty({
|
|
891
|
-
name: 'preventDefault',
|
|
892
|
-
description: '阻止改变流程',
|
|
893
|
-
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
894
|
-
}),
|
|
895
761
|
],
|
|
896
762
|
}),
|
|
897
763
|
new Structure({
|
|
@@ -64,20 +64,22 @@ export default new Namespace({
|
|
|
64
64
|
functions: [
|
|
65
65
|
new Function({
|
|
66
66
|
name: 'Convert',
|
|
67
|
+
typeParams: [
|
|
68
|
+
new TypeParam({
|
|
69
|
+
name: 'T',
|
|
70
|
+
}),
|
|
71
|
+
],
|
|
67
72
|
params: [
|
|
68
73
|
new Param({
|
|
69
74
|
name: 'value',
|
|
70
75
|
// typeAnnotation: new TypeAnnotation()
|
|
71
76
|
defaultExpression: new Identifier(),
|
|
72
77
|
}),
|
|
73
|
-
new Param({
|
|
74
|
-
name: 'to',
|
|
75
|
-
// typeAnnotation: new TypeAnnotation()
|
|
76
|
-
}),
|
|
77
78
|
],
|
|
78
79
|
returns: [
|
|
79
80
|
new Return({
|
|
80
|
-
typeAnnotation: TypeAnnotation.
|
|
81
|
+
typeAnnotation: TypeAnnotation.createTypeParam('T'),
|
|
82
|
+
// typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
81
83
|
}),
|
|
82
84
|
],
|
|
83
85
|
}),
|
|
@@ -581,5 +583,19 @@ export default new Namespace({
|
|
|
581
583
|
}),
|
|
582
584
|
],
|
|
583
585
|
}),
|
|
586
|
+
new Function({
|
|
587
|
+
name: 'GetProperties',
|
|
588
|
+
params: [
|
|
589
|
+
new Param({
|
|
590
|
+
name: 'name',
|
|
591
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
592
|
+
}),
|
|
593
|
+
],
|
|
594
|
+
returns: [
|
|
595
|
+
new Return({
|
|
596
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
597
|
+
}),
|
|
598
|
+
],
|
|
599
|
+
}),
|
|
584
600
|
],
|
|
585
601
|
});
|
|
@@ -4,7 +4,7 @@ import Return from '../../Return__';
|
|
|
4
4
|
import Function from '../../Function__';
|
|
5
5
|
import TypeAnnotation from '../../TypeAnnotation__';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const genEmptyParamFunction = function (name: string) {
|
|
8
8
|
return new Function({
|
|
9
9
|
name,
|
|
10
10
|
params: [],
|
|
@@ -17,12 +17,12 @@ const genEmptyParamFuncion = function (name: string) {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export default new Namespace({
|
|
20
|
-
name: '
|
|
20
|
+
name: 'validation',
|
|
21
21
|
functions: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
genEmptyParamFunction('required'),
|
|
23
|
+
genEmptyParamFunction('filled'),
|
|
24
|
+
genEmptyParamFunction('notEmpty'),
|
|
25
|
+
genEmptyParamFunction('empty'),
|
|
26
26
|
new Function({
|
|
27
27
|
name: 'minLength',
|
|
28
28
|
params: [
|
|
@@ -280,8 +280,8 @@ export default new Namespace({
|
|
|
280
280
|
}),
|
|
281
281
|
],
|
|
282
282
|
})*/
|
|
283
|
-
|
|
284
|
-
|
|
283
|
+
genEmptyParamFunction('string'),
|
|
284
|
+
genEmptyParamFunction('number'),
|
|
285
285
|
new Function({
|
|
286
286
|
name: 'numeric',
|
|
287
287
|
params: [
|
|
@@ -297,7 +297,7 @@ export default new Namespace({
|
|
|
297
297
|
}),
|
|
298
298
|
],
|
|
299
299
|
}),
|
|
300
|
-
|
|
300
|
+
genEmptyParamFunction('integer'),
|
|
301
301
|
new Function({
|
|
302
302
|
name: 'decimal',
|
|
303
303
|
params: [
|
|
@@ -347,7 +347,7 @@ export default new Namespace({
|
|
|
347
347
|
'without--',
|
|
348
348
|
'without__',
|
|
349
349
|
'email',
|
|
350
|
-
].map(
|
|
350
|
+
].map(genEmptyParamFunction),
|
|
351
351
|
new Function({
|
|
352
352
|
name: 'ip',
|
|
353
353
|
params: [
|
|
@@ -376,7 +376,7 @@ export default new Namespace({
|
|
|
376
376
|
}),
|
|
377
377
|
],
|
|
378
378
|
}),
|
|
379
|
-
...['port', 'url', 'macAddress', 'md5', 'ascii', 'base64'].map(
|
|
379
|
+
...['port', 'url', 'macAddress', 'md5', 'ascii', 'base64'].map(genEmptyParamFunction),
|
|
380
380
|
new Function({
|
|
381
381
|
name: 'byteLength',
|
|
382
382
|
params: [
|
|
@@ -395,7 +395,7 @@ export default new Namespace({
|
|
|
395
395
|
}),
|
|
396
396
|
],
|
|
397
397
|
}),
|
|
398
|
-
|
|
398
|
+
genEmptyParamFunction('dataURI'),
|
|
399
399
|
new Function({
|
|
400
400
|
name: 'divisibleBy',
|
|
401
401
|
params: [
|
|
@@ -410,8 +410,8 @@ export default new Namespace({
|
|
|
410
410
|
}),
|
|
411
411
|
],
|
|
412
412
|
}),
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
genEmptyParamFunction('halfWidth'),
|
|
414
|
+
genEmptyParamFunction('fullWidth'),
|
|
415
415
|
/* hash ?
|
|
416
416
|
new Function({
|
|
417
417
|
name: 'hash',
|
|
@@ -428,11 +428,11 @@ export default new Namespace({
|
|
|
428
428
|
],
|
|
429
429
|
}),
|
|
430
430
|
*/
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
431
|
+
genEmptyParamFunction('hexColor'),
|
|
432
|
+
genEmptyParamFunction('hex'),
|
|
433
|
+
genEmptyParamFunction('creditCard'),
|
|
434
|
+
genEmptyParamFunction('fqdn'),
|
|
435
|
+
genEmptyParamFunction('ipOrFQDN'),
|
|
436
436
|
new Function({
|
|
437
437
|
name: 'isbn',
|
|
438
438
|
params: [
|
|
@@ -447,8 +447,8 @@ export default new Namespace({
|
|
|
447
447
|
}),
|
|
448
448
|
],
|
|
449
449
|
}),
|
|
450
|
-
|
|
451
|
-
|
|
450
|
+
genEmptyParamFunction('issn'),
|
|
451
|
+
genEmptyParamFunction('isin'),
|
|
452
452
|
new Function({
|
|
453
453
|
name: 'iso8601',
|
|
454
454
|
params: [
|
|
@@ -463,11 +463,11 @@ export default new Namespace({
|
|
|
463
463
|
}),
|
|
464
464
|
],
|
|
465
465
|
}),
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
466
|
+
genEmptyParamFunction('iso31661Alpha2'),
|
|
467
|
+
genEmptyParamFunction('iso31661Alpha3'),
|
|
468
|
+
genEmptyParamFunction('json'),
|
|
469
|
+
genEmptyParamFunction('jwt'),
|
|
470
|
+
genEmptyParamFunction('latLong'),
|
|
471
471
|
new Function({
|
|
472
472
|
name: 'mobile',
|
|
473
473
|
params: [
|
|
@@ -488,7 +488,7 @@ export default new Namespace({
|
|
|
488
488
|
}),
|
|
489
489
|
],
|
|
490
490
|
}),
|
|
491
|
-
|
|
491
|
+
genEmptyParamFunction('mongoId'),
|
|
492
492
|
new Function({
|
|
493
493
|
name: 'postalCode',
|
|
494
494
|
params: [
|
|
@@ -518,6 +518,6 @@ export default new Namespace({
|
|
|
518
518
|
}),
|
|
519
519
|
],
|
|
520
520
|
}),
|
|
521
|
-
|
|
521
|
+
genEmptyParamFunction('chinese'),
|
|
522
522
|
],
|
|
523
523
|
});
|
package/src/concepts/index__.ts
CHANGED
|
@@ -71,6 +71,10 @@ export * from './ProcessElement__';
|
|
|
71
71
|
export * from './ProcessComponent__';
|
|
72
72
|
export * from './ProcessOutcome__';
|
|
73
73
|
export * from './Role__';
|
|
74
|
+
export * from './Configuration__';
|
|
75
|
+
export * from './ConfigGroup__';
|
|
76
|
+
export * from './ConfigProperty__';
|
|
77
|
+
export * from './ConfigPropertyValue__';
|
|
74
78
|
export * from './CompletionProperty__';
|
|
75
79
|
export * from './UseComponent__';
|
|
76
80
|
export * from './Point__';
|
|
@@ -8,7 +8,6 @@ import * as JSON5 from 'json5';
|
|
|
8
8
|
export interface Route {
|
|
9
9
|
// id?: string;
|
|
10
10
|
path?: string;
|
|
11
|
-
tempPath?: string;
|
|
12
11
|
routePath?: string;
|
|
13
12
|
component?: RawOptions; // ExtendedVue<Vue, unknown, unknown, unknown, Record<never, any>>;
|
|
14
13
|
children?: Array<Route>;
|
|
@@ -213,7 +212,7 @@ export async function genBundleFiles(app: App, config: {
|
|
|
213
212
|
indexName,
|
|
214
213
|
// extendedConfig: app.extendedConfig,
|
|
215
214
|
}, null, 4);
|
|
216
|
-
const assetsInfo =
|
|
215
|
+
const assetsInfo = app.genAllAssetsInfo(config.STATIC_URL);
|
|
217
216
|
const customNames = JSON5.stringify(assetsInfo.custom.names);
|
|
218
217
|
let content = `(function(){
|
|
219
218
|
`;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { App, View, BaseNode, Entity, Structure, Enum, uiStructures, collectionStructures, Logic } from '../concepts';
|
|
2
|
+
|
|
3
|
+
export function genMetaData(app: App,
|
|
4
|
+
config: {
|
|
5
|
+
tenant: string;
|
|
6
|
+
env: string;
|
|
7
|
+
nuimsDomain: string;
|
|
8
|
+
STATIC_URL: string;
|
|
9
|
+
USER_STATIC_URL: string;
|
|
10
|
+
}) {
|
|
11
|
+
const dataTypesMap: {
|
|
12
|
+
[id: string]: BaseNode;
|
|
13
|
+
} = {};
|
|
14
|
+
const { entities = [], structures = [], enums = [], logics = [], interfaceDependencies = [] } = app || {};
|
|
15
|
+
const dataTypes: (Entity | Structure | Enum)[] = [];
|
|
16
|
+
const allLogics: Logic[] = [];
|
|
17
|
+
const enumsMap: {
|
|
18
|
+
[name: string]: {
|
|
19
|
+
[label: string]: string;
|
|
20
|
+
};
|
|
21
|
+
} = {};
|
|
22
|
+
const logicsMap: {
|
|
23
|
+
[id: string]: {
|
|
24
|
+
config: {
|
|
25
|
+
serviceType: string;
|
|
26
|
+
};
|
|
27
|
+
url: {
|
|
28
|
+
method: string;
|
|
29
|
+
path: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
} = {};
|
|
33
|
+
|
|
34
|
+
const _custom: {
|
|
35
|
+
[id: string]: BaseNode;
|
|
36
|
+
} = {};
|
|
37
|
+
|
|
38
|
+
if (Array.isArray(enums)) {
|
|
39
|
+
dataTypes.push(...enums);
|
|
40
|
+
enums.forEach((node) => {
|
|
41
|
+
const { name, enumItems } = node || {};
|
|
42
|
+
const enumObj: {
|
|
43
|
+
[value: string]: string;
|
|
44
|
+
} = {};
|
|
45
|
+
enumItems.forEach(({ label, value }) => {
|
|
46
|
+
enumObj[value] = label;
|
|
47
|
+
});
|
|
48
|
+
enumsMap[name] = enumObj;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (Array.isArray(entities)) {
|
|
53
|
+
dataTypes.push(...entities);
|
|
54
|
+
entities.forEach((entity) => {
|
|
55
|
+
const ns = entity.ns;
|
|
56
|
+
if (Array.isArray(ns?.logics)) {
|
|
57
|
+
allLogics.push(...ns.logics);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (Array.isArray(structures)) {
|
|
62
|
+
dataTypes.push(...structures);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
dataTypes.forEach((node) => {
|
|
66
|
+
const namespace = node.getNamespace();
|
|
67
|
+
const id = `${namespace}.${node.name}`;
|
|
68
|
+
dataTypesMap[id] = node;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (Array.isArray(uiStructures)) {
|
|
72
|
+
const namespace = 'nasl.ui';
|
|
73
|
+
uiStructures.forEach((node) => {
|
|
74
|
+
const id = `${namespace}.${node.name}`;
|
|
75
|
+
dataTypesMap[id] = node;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (Array.isArray(collectionStructures)) {
|
|
80
|
+
const namespace = 'nasl.collection';
|
|
81
|
+
collectionStructures.forEach((node) => {
|
|
82
|
+
const id = `${namespace}.${node.name}`;
|
|
83
|
+
dataTypesMap[id] = node;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (Array.isArray(logics)) {
|
|
88
|
+
allLogics.push(...logics);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
allLogics.forEach((node) => {
|
|
92
|
+
logicsMap[node.name] = node.toService();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
interfaceDependencies.forEach((node) => {
|
|
96
|
+
const namespace = node.getNamespace();
|
|
97
|
+
const id = `${namespace}.${node.name}`;
|
|
98
|
+
_custom[id] = node;
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
metaData: {
|
|
103
|
+
dataTypesMap,
|
|
104
|
+
enumsMap,
|
|
105
|
+
logicsMap,
|
|
106
|
+
servicesMap: {
|
|
107
|
+
_custom,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
}
|
package/src/generator/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { EventEmitter, EventPayload, BaseNode } from './common';
|
|
2
2
|
export * from './concepts';
|
|
3
|
-
export { genBundleFiles } from './generator';
|
|
3
|
+
export { genBundleFiles, genMetaData } from './generator';
|
|
4
4
|
export * from './translator';
|
|
5
5
|
export { default as diagnosticManager } from './manager/diagnostic';
|
|
6
6
|
// export { default as server } from './server';
|
|
7
7
|
export * as genBlock from './templator';
|
|
8
8
|
export * as utils from './utils';
|
|
9
9
|
export * from './config';
|
|
10
|
-
export { loadApp } from './service/storage/init';
|
|
10
|
+
export { loadApp, loadAppSync } from './service/storage/init';
|