@lcap/nasl 3.8.0-beta.3 → 3.8.0-beta.5
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.js +1 -2
- package/out/automate/engine/utils.js.map +1 -1
- package/out/bak/translator.js +1 -1
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.js +7 -2
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.js +6 -1
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +11 -5
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +3 -0
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +49 -2
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +4 -3
- package/out/concepts/BindAttribute__.js +121 -42
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindEvent__.js +5 -42
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BusinessComponent__.d.ts +1 -0
- package/out/concepts/BusinessComponent__.js +16 -0
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.js +3 -0
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallConnector__.js +1 -1
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.js +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +6 -1
- package/out/concepts/CallLogic__.js +58 -17
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +4 -0
- package/out/concepts/Connection__.js +15 -0
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.d.ts +2 -0
- package/out/concepts/DatabaseTypeAnnotation__.js +20 -0
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/End__.js +5 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +2 -0
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +1 -0
- package/out/concepts/Entity__.js +24 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +12 -0
- package/out/concepts/EnumItem__.js +49 -5
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +4 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +46 -46
- package/out/concepts/FrontendLibrary__.js +34 -36
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/I18nInfo__.d.ts +1 -0
- package/out/concepts/I18nInfo__.js +7 -0
- package/out/concepts/I18nInfo__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Interface__.js +4 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +2 -3
- package/out/concepts/Logic__.js +33 -8
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +2 -2
- package/out/concepts/MatchCase__.js +7 -7
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/NewComposite__.js +2 -1
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js +2 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js +2 -1
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +3 -11
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +7 -0
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +2 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElementV2__.d.ts +4 -5
- package/out/concepts/ProcessElementV2__.js +12 -17
- package/out/concepts/ProcessElementV2__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +3 -4
- package/out/concepts/ProcessElement__.js +44 -46
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessV2__.d.ts +5 -0
- package/out/concepts/ProcessV2__.js +30 -2
- package/out/concepts/ProcessV2__.js.map +1 -1
- package/out/concepts/Process__.d.ts +5 -0
- package/out/concepts/Process__.js +28 -0
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +2 -2
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +2 -2
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +2 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/StaticString__.d.ts +4 -0
- package/out/concepts/StaticString__.js +11 -0
- package/out/concepts/StaticString__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +5 -2
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +9 -3
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SubLogic__.d.ts +1 -3
- package/out/concepts/SubLogic__.js +14 -8
- package/out/concepts/SubLogic__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +1 -0
- package/out/concepts/Transactional__.js +7 -0
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +4 -0
- package/out/concepts/TypeParam__.js +3 -0
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +1 -6
- package/out/concepts/ValidationRule__.js +9 -6
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -1
- package/out/concepts/Variable__.js +7 -2
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +2 -0
- package/out/concepts/ViewElement__.js +130 -47
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +8 -0
- package/out/concepts/View__.js +123 -7
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.processV2.js +2 -2
- package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.js +110 -4
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +2 -0
- package/out/generator/genBundleFiles.js +51 -37
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.js +20 -26
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/release-body/body.js +8 -6
- package/out/generator/release-body/body.js.map +1 -1
- package/out/generator/release-body/index.d.ts +1 -0
- package/out/generator/release-body/index.js +1 -0
- package/out/generator/release-body/index.js.map +1 -1
- package/out/generator/release-body/utils.js +1 -1
- package/out/generator/release-body/utils.js.map +1 -1
- package/out/natural/genNaturalTS.d.ts +56 -24
- package/out/natural/genNaturalTS.js +182 -112
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/getContext/getUILib.js +4 -2
- package/out/natural/getContext/getUILib.js.map +1 -1
- package/out/natural/getContext/index.d.ts +34 -25
- package/out/natural/getContext/index.js +304 -157
- package/out/natural/getContext/index.js.map +1 -1
- package/out/natural/index.d.ts +1 -0
- package/out/natural/index.js +1 -0
- package/out/natural/index.js.map +1 -1
- package/out/natural/tools.d.ts +11 -0
- package/out/natural/tools.js +155 -0
- package/out/natural/tools.js.map +1 -0
- package/out/natural/transformTS2UI.js +84 -22
- package/out/natural/transformTS2UI.js.map +1 -1
- package/out/natural/transformTSCode.js +83 -22
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/formatTsUtils.js +17 -1
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.js +1 -4
- package/out/server/getLogics.js.map +1 -1
- package/out/server/naslServer.js +285 -32
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +5 -1
- package/out/server/translator.js.map +1 -1
- package/out/templator/genCreateBlock.js +5 -18
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +11 -32
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -2
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +6 -4
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +82 -59
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +4 -4
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -15
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +1 -1
- package/out/templator/utils.js +1 -1
- package/out/templator/utils.js.map +1 -1
- package/out/translator/types.d.ts +4 -0
- package/out/translator/utils.d.ts +1 -0
- package/out/translator/utils.js +6 -1
- package/out/translator/utils.js.map +1 -1
- package/out/utils/env.d.ts +4 -0
- package/out/utils/env.js +6 -3
- package/out/utils/env.js.map +1 -1
- package/out/utils/index.d.ts +19 -0
- package/out/utils/index.js +61 -1
- package/out/utils/index.js.map +1 -1
- package/out/utils/language-cache/constant.d.ts +18 -0
- package/out/utils/language-cache/constant.js +35 -0
- package/out/utils/language-cache/constant.js.map +1 -0
- package/out/utils/language-cache/index.d.ts +2 -0
- package/out/utils/language-cache/index.js +19 -0
- package/out/utils/language-cache/index.js.map +1 -0
- package/out/utils/language-cache/nasl.d.ts +10 -0
- package/out/utils/language-cache/nasl.js +98 -0
- package/out/utils/language-cache/nasl.js.map +1 -0
- package/out/utils/language-cache/types.d.ts +44 -0
- package/out/utils/language-cache/types.js +4 -0
- package/out/utils/language-cache/types.js.map +1 -0
- package/out/utils/time-slicing/controller.js.map +1 -1
- package/out/utils/types.d.ts +17 -0
- package/package.json +3 -2
- package/sandbox/stdlib/nasl.core.ts +15 -11
- package/sandbox/stdlib/nasl.oql.ts +5 -1
- package/sandbox/stdlib/nasl.processV2.ts +5 -4
- package/sandbox/stdlib/nasl.ui.components.pc.ts +225 -225
- package/sandbox/stdlib/nasl.ui.ts +10 -0
- package/sandbox/stdlib/nasl.util.ts +11 -0
- package/sandbox/stdlib/nasl.validation.ts +3 -2
- package/sandbox-natural/stdlib/nasl.ui.pre.d.ts +1 -1
- package/sandbox-natural/stdlib/nasl.ui.ts +2 -2
- package/sandbox-natural/stdlib/nasl.util.ts +2 -2
- package/src/automate/engine/utils.js +1 -2
- package/src/bak/translator.js +1 -1
- package/src/common/BaseNode.ts +7 -3
- package/src/concepts/App__.ts +9 -1
- package/src/concepts/Argument__.ts +10 -5
- package/src/concepts/AuthLogicForCallInterface__.ts +3 -0
- package/src/concepts/BinaryExpression__.ts +46 -2
- package/src/concepts/BindAttribute__.ts +144 -46
- package/src/concepts/BindEvent__.ts +8 -47
- package/src/concepts/BusinessComponent__.ts +17 -0
- package/src/concepts/BusinessLogic__.ts +3 -0
- package/src/concepts/CallConnector__.ts +1 -1
- package/src/concepts/CallFunction__.ts +1 -1
- package/src/concepts/CallLogic__.ts +63 -17
- package/src/concepts/Connection__.ts +16 -0
- package/src/concepts/DatabaseTypeAnnotation__.ts +11 -0
- package/src/concepts/End__.ts +5 -1
- package/src/concepts/EntityProperty__.ts +5 -0
- package/src/concepts/Entity__.ts +29 -1
- package/src/concepts/EnumItem__.ts +64 -1
- package/src/concepts/Enum__.ts +6 -1
- package/src/concepts/ForEachStatement__.ts +1 -1
- package/src/concepts/FrontendLibrary__.ts +78 -80
- package/src/concepts/I18nInfo__.ts +5 -0
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/Interface__.ts +6 -1
- package/src/concepts/Logic__.ts +39 -10
- package/src/concepts/MatchCase__.ts +8 -9
- package/src/concepts/NewComposite__.ts +2 -1
- package/src/concepts/NewList__.ts +2 -1
- package/src/concepts/NewMap__.ts +2 -1
- package/src/concepts/OqlQueryComponent__.ts +3 -11
- package/src/concepts/OverriddenLogic__.ts +7 -0
- package/src/concepts/Param__.ts +1 -0
- package/src/concepts/ProcessElementV2__.ts +14 -16
- package/src/concepts/ProcessElement__.ts +16 -16
- package/src/concepts/ProcessV2__.ts +39 -3
- package/src/concepts/Process__.ts +36 -0
- package/src/concepts/QueryFromExpression__.ts +2 -2
- package/src/concepts/QueryJoinExpression__.ts +2 -2
- package/src/concepts/Return__.ts +2 -1
- package/src/concepts/StaticString__.ts +12 -0
- package/src/concepts/StructureProperty__.ts +7 -2
- package/src/concepts/Structure__.ts +11 -3
- package/src/concepts/SubLogic__.ts +15 -9
- package/src/concepts/Transactional__.ts +5 -0
- package/src/concepts/TypeParam__.ts +6 -0
- package/src/concepts/ValidationRule__.ts +7 -6
- package/src/concepts/Variable__.ts +7 -2
- package/src/concepts/ViewElement__.ts +130 -47
- package/src/concepts/View__.ts +157 -8
- package/src/concepts/basics/stdlib/nasl.processV2.ts +2 -2
- package/src/concepts/basics/stdlib/nasl.ui.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.validation.ts +111 -4
- package/src/generator/genBundleFiles.ts +53 -39
- package/src/generator/genMetaData.ts +21 -26
- package/src/generator/release-body/body.ts +9 -6
- package/src/generator/release-body/index.ts +1 -0
- package/src/generator/release-body/utils.ts +4 -2
- package/src/natural/genNaturalTS.ts +327 -141
- package/src/natural/getContext/getUILib.ts +4 -2
- package/src/natural/getContext/index.ts +348 -171
- package/src/natural/index.ts +1 -0
- package/src/natural/tools.ts +130 -0
- package/src/natural/transformTS2UI.ts +84 -22
- package/src/natural/transformTSCode.ts +83 -22
- package/src/server/formatTsUtils.ts +21 -1
- package/src/server/getLogics.ts +1 -4
- package/src/server/naslServer.ts +302 -33
- package/src/server/translator.ts +5 -1
- package/src/templator/genCreateBlock.ts +5 -18
- package/src/templator/genCurdMultipleKeyBlock.ts +14 -32
- package/src/templator/genGetBlock.ts +2 -4
- package/src/templator/genListViewBlock.ts +6 -4
- package/src/templator/genSelectBlock.ts +88 -61
- package/src/templator/genTableBlock.ts +4 -4
- package/src/templator/genUpdateBlock.ts +2 -15
- package/src/templator/utils.ts +1 -1
- package/src/translator/types.ts +4 -0
- package/src/translator/utils.ts +6 -0
- package/src/utils/env.ts +5 -4
- package/src/utils/index.ts +50 -1
- package/src/utils/language-cache/constant.ts +37 -0
- package/src/utils/language-cache/index.ts +2 -0
- package/src/utils/language-cache/nasl.ts +83 -0
- package/src/utils/language-cache/types.ts +48 -0
- package/src/utils/time-slicing/controller.ts +0 -1
- package/src/utils/types.ts +20 -0
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +13 -13
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +12 -12
- package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -2
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +221 -217
- package/ts-worker/bundle.js +1 -1
- package/ts-worker/src/index.js +0 -1
- package/out/utils/delay/index.d.ts +0 -0
- package/out/utils/delay/index.js +0 -1
- package/out/utils/delay/index.js.map +0 -1
- package/src/utils/delay/index.ts +0 -0
|
@@ -14,6 +14,11 @@ export function initialize() {
|
|
|
14
14
|
const Param = getConceptConstructor('Param');
|
|
15
15
|
const Return = getConceptConstructor('Return');
|
|
16
16
|
const Function = getConceptConstructor('Function');
|
|
17
|
+
const DefaultValue = getConceptConstructor('DefaultValue');
|
|
18
|
+
const BooleanLiteral = getConceptConstructor('BooleanLiteral');
|
|
19
|
+
const NumericLiteral = getConceptConstructor('NumericLiteral');
|
|
20
|
+
const StringLiteral = getConceptConstructor('StringLiteral');
|
|
21
|
+
const NewList = getConceptConstructor('NewList');
|
|
17
22
|
|
|
18
23
|
const genEmptyParamFunction = function (name: string) {
|
|
19
24
|
return new Function({
|
|
@@ -39,6 +44,9 @@ export function initialize() {
|
|
|
39
44
|
name: 'min',
|
|
40
45
|
typeAnnotation: TypeAnnotation.createPrimitive('Long'),
|
|
41
46
|
required: true,
|
|
47
|
+
defaultValue: new DefaultValue({
|
|
48
|
+
expression: new NumericLiteral({ value: '0' })
|
|
49
|
+
})
|
|
42
50
|
}),
|
|
43
51
|
],
|
|
44
52
|
returns: [
|
|
@@ -54,6 +62,9 @@ export function initialize() {
|
|
|
54
62
|
name: 'max',
|
|
55
63
|
typeAnnotation: TypeAnnotation.createPrimitive('Long'),
|
|
56
64
|
required: true,
|
|
65
|
+
defaultValue: new DefaultValue({
|
|
66
|
+
expression: new NumericLiteral({ value: '0' })
|
|
67
|
+
})
|
|
57
68
|
}),
|
|
58
69
|
],
|
|
59
70
|
returns: [
|
|
@@ -69,11 +80,17 @@ export function initialize() {
|
|
|
69
80
|
name: 'min',
|
|
70
81
|
typeAnnotation: TypeAnnotation.createPrimitive('Long'),
|
|
71
82
|
required: true,
|
|
83
|
+
defaultValue: new DefaultValue({
|
|
84
|
+
expression: new NumericLiteral({ value: '0' })
|
|
85
|
+
})
|
|
72
86
|
}),
|
|
73
87
|
new Param({
|
|
74
88
|
name: 'max',
|
|
75
89
|
typeAnnotation: TypeAnnotation.createPrimitive('Long'),
|
|
76
90
|
required: true,
|
|
91
|
+
defaultValue: new DefaultValue({
|
|
92
|
+
expression: new NumericLiteral({ value: '0' })
|
|
93
|
+
})
|
|
77
94
|
}),
|
|
78
95
|
],
|
|
79
96
|
returns: [
|
|
@@ -89,6 +106,9 @@ export function initialize() {
|
|
|
89
106
|
name: 'min',
|
|
90
107
|
typeAnnotation: TypeAnnotation.createPrimitive('Decimal'),
|
|
91
108
|
required: true,
|
|
109
|
+
defaultValue: new DefaultValue({
|
|
110
|
+
expression: new NumericLiteral({ value: '0' })
|
|
111
|
+
})
|
|
92
112
|
}),
|
|
93
113
|
],
|
|
94
114
|
returns: [
|
|
@@ -104,6 +124,9 @@ export function initialize() {
|
|
|
104
124
|
name: 'max',
|
|
105
125
|
typeAnnotation: TypeAnnotation.createPrimitive('Decimal'),
|
|
106
126
|
required: true,
|
|
127
|
+
defaultValue: new DefaultValue({
|
|
128
|
+
expression: new NumericLiteral({ value: '0' })
|
|
129
|
+
})
|
|
107
130
|
}),
|
|
108
131
|
],
|
|
109
132
|
returns: [
|
|
@@ -119,11 +142,17 @@ export function initialize() {
|
|
|
119
142
|
name: 'min',
|
|
120
143
|
typeAnnotation: TypeAnnotation.createPrimitive('Decimal'),
|
|
121
144
|
required: true,
|
|
145
|
+
defaultValue: new DefaultValue({
|
|
146
|
+
expression: new NumericLiteral({ value: '0' })
|
|
147
|
+
})
|
|
122
148
|
}),
|
|
123
149
|
new Param({
|
|
124
150
|
name: 'max',
|
|
125
151
|
typeAnnotation: TypeAnnotation.createPrimitive('Decimal'),
|
|
126
152
|
required: true,
|
|
153
|
+
defaultValue: new DefaultValue({
|
|
154
|
+
expression: new NumericLiteral({ value: '0' })
|
|
155
|
+
})
|
|
127
156
|
}),
|
|
128
157
|
],
|
|
129
158
|
returns: [
|
|
@@ -140,6 +169,22 @@ export function initialize() {
|
|
|
140
169
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
141
170
|
required: true,
|
|
142
171
|
}),
|
|
172
|
+
new Param({
|
|
173
|
+
name: 'strict',
|
|
174
|
+
typeAnnotation: TypeAnnotation.createPrimitive('Boolean'),
|
|
175
|
+
required: true,
|
|
176
|
+
defaultValue: new DefaultValue({
|
|
177
|
+
expression: new BooleanLiteral({ value: 'true' })
|
|
178
|
+
}),
|
|
179
|
+
}),
|
|
180
|
+
new Param({
|
|
181
|
+
name: 'matchCase',
|
|
182
|
+
typeAnnotation: TypeAnnotation.createPrimitive('Boolean'),
|
|
183
|
+
required: true,
|
|
184
|
+
defaultValue: new DefaultValue({
|
|
185
|
+
expression: new BooleanLiteral({ value: 'true' })
|
|
186
|
+
}),
|
|
187
|
+
}),
|
|
143
188
|
],
|
|
144
189
|
returns: [
|
|
145
190
|
new Return({
|
|
@@ -230,6 +275,9 @@ export function initialize() {
|
|
|
230
275
|
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
231
276
|
typeArguments: [TypeAnnotation.createPrimitive('Any')],
|
|
232
277
|
}),
|
|
278
|
+
defaultValue: new DefaultValue({
|
|
279
|
+
expression: new NewList({ items: [] })
|
|
280
|
+
}),
|
|
233
281
|
required: true,
|
|
234
282
|
}),
|
|
235
283
|
],
|
|
@@ -247,6 +295,9 @@ export function initialize() {
|
|
|
247
295
|
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
248
296
|
typeArguments: [TypeAnnotation.createPrimitive('Any')],
|
|
249
297
|
}),
|
|
298
|
+
defaultValue: new DefaultValue({
|
|
299
|
+
expression: new NewList({ items: [] })
|
|
300
|
+
}),
|
|
250
301
|
required: true,
|
|
251
302
|
}),
|
|
252
303
|
],
|
|
@@ -264,6 +315,9 @@ export function initialize() {
|
|
|
264
315
|
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
265
316
|
typeArguments: [TypeAnnotation.createPrimitive('Any')],
|
|
266
317
|
}),
|
|
318
|
+
defaultValue: new DefaultValue({
|
|
319
|
+
expression: new NewList({ items: [] })
|
|
320
|
+
}),
|
|
267
321
|
required: true,
|
|
268
322
|
}),
|
|
269
323
|
],
|
|
@@ -281,6 +335,9 @@ export function initialize() {
|
|
|
281
335
|
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
282
336
|
typeArguments: [TypeAnnotation.createPrimitive('Any')],
|
|
283
337
|
}),
|
|
338
|
+
defaultValue: new DefaultValue({
|
|
339
|
+
expression: new NewList({ items: [] })
|
|
340
|
+
}),
|
|
284
341
|
required: true,
|
|
285
342
|
}),
|
|
286
343
|
],
|
|
@@ -344,7 +401,7 @@ export function initialize() {
|
|
|
344
401
|
}),
|
|
345
402
|
new Param({
|
|
346
403
|
name: 'digits',
|
|
347
|
-
typeAnnotation: TypeAnnotation.createPrimitive('
|
|
404
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
348
405
|
required: false,
|
|
349
406
|
}),
|
|
350
407
|
],
|
|
@@ -474,9 +531,53 @@ export function initialize() {
|
|
|
474
531
|
}),
|
|
475
532
|
genEmptyParamFunction('hexColor'),
|
|
476
533
|
genEmptyParamFunction('hex'),
|
|
477
|
-
genEmptyParamFunction('creditCard'),
|
|
478
534
|
genEmptyParamFunction('fqdn'),
|
|
479
535
|
genEmptyParamFunction('ipOrFQDN'),
|
|
536
|
+
new Function({
|
|
537
|
+
name: 'creditCard',
|
|
538
|
+
params: [
|
|
539
|
+
new Param({
|
|
540
|
+
name: 'types',
|
|
541
|
+
required: true,
|
|
542
|
+
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
543
|
+
typeArguments: [TypeAnnotation.createPrimitive('String')],
|
|
544
|
+
}),
|
|
545
|
+
defaultValue: new DefaultValue({
|
|
546
|
+
expression: new NewList({
|
|
547
|
+
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
548
|
+
typeArguments: [TypeAnnotation.createPrimitive('String')],
|
|
549
|
+
}),
|
|
550
|
+
items: [
|
|
551
|
+
new StringLiteral({ value: "UnionPay" })
|
|
552
|
+
]
|
|
553
|
+
}),
|
|
554
|
+
|
|
555
|
+
}),
|
|
556
|
+
useComponent: { type: 's-bidirectional-bind-switch' },
|
|
557
|
+
// defaultExpression: new NewList({
|
|
558
|
+
// // name: 'creditCardTypesDefaultExpression',
|
|
559
|
+
// name:"GetSpecificDaysOfWeekTargetDefaultExpression",
|
|
560
|
+
// typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
561
|
+
// typeArguments: [TypeAnnotation.createPrimitive('String')],
|
|
562
|
+
// }),
|
|
563
|
+
// }),
|
|
564
|
+
options: [
|
|
565
|
+
{ text: '银联', value: 'UnionPay' },
|
|
566
|
+
{ text: '维萨', value: 'Visa' },
|
|
567
|
+
{ text: '万事达', value: 'Mastercard' },
|
|
568
|
+
{ text: '美国运通', value: 'AMEX' },
|
|
569
|
+
{ text: '吉士美', value: 'JCB' },
|
|
570
|
+
{ text: '发现', value: 'Discover' },
|
|
571
|
+
{ text: '大来', value: 'DinersClub' },
|
|
572
|
+
],
|
|
573
|
+
}),
|
|
574
|
+
],
|
|
575
|
+
returns: [
|
|
576
|
+
new Return({
|
|
577
|
+
typeAnnotation: TypeAnnotation.createPrimitive('Boolean'),
|
|
578
|
+
}),
|
|
579
|
+
],
|
|
580
|
+
}),
|
|
480
581
|
new Function({
|
|
481
582
|
name: 'isbn',
|
|
482
583
|
params: [
|
|
@@ -520,12 +621,18 @@ export function initialize() {
|
|
|
520
621
|
new Param({
|
|
521
622
|
name: 'locale',
|
|
522
623
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
523
|
-
required:
|
|
624
|
+
required: true,
|
|
625
|
+
defaultValue: new DefaultValue({
|
|
626
|
+
expression: new StringLiteral({ value: "zh-CN" })
|
|
627
|
+
})
|
|
524
628
|
}),
|
|
525
629
|
new Param({
|
|
526
630
|
name: 'strict',
|
|
527
631
|
typeAnnotation: TypeAnnotation.createPrimitive('Boolean'),
|
|
528
|
-
required:
|
|
632
|
+
required: true,
|
|
633
|
+
defaultValue: new DefaultValue({
|
|
634
|
+
expression: new BooleanLiteral({ value: 'false' })
|
|
635
|
+
}),
|
|
529
636
|
}),
|
|
530
637
|
],
|
|
531
638
|
returns: [
|
|
@@ -40,6 +40,8 @@ interface Config {
|
|
|
40
40
|
tenantLevel: any;
|
|
41
41
|
appid: string;
|
|
42
42
|
isExport?:string;
|
|
43
|
+
sysPrefixPath?:string;
|
|
44
|
+
realRelease?:string;
|
|
43
45
|
devDnsAddr: string;
|
|
44
46
|
miniEnable: boolean;
|
|
45
47
|
isPreviewFe?: boolean;
|
|
@@ -113,7 +115,7 @@ function genExportComponetCode(component: RawOptions) {
|
|
|
113
115
|
|
|
114
116
|
// 获取文件路径
|
|
115
117
|
// name 或者 文件 至少有一个必填
|
|
116
|
-
const getCompletePath = (name: string, fileContent: string) => {
|
|
118
|
+
const getCompletePath = (name: string, fileContent: string,config?:any) => {
|
|
117
119
|
let fileName = '';
|
|
118
120
|
if (name) {
|
|
119
121
|
fileName += `${name}.`;
|
|
@@ -122,6 +124,9 @@ const getCompletePath = (name: string, fileContent: string) => {
|
|
|
122
124
|
fileName += `${genHash(fileContent)}.`;
|
|
123
125
|
}
|
|
124
126
|
fileName += `min.js`;
|
|
127
|
+
if(config?.isExport){
|
|
128
|
+
fileName =`${config.sysPrefixPath}/${fileName}`
|
|
129
|
+
}
|
|
125
130
|
|
|
126
131
|
return fileName;
|
|
127
132
|
};
|
|
@@ -167,14 +172,14 @@ function genRouterFileContent(routes: Route[], defaultRoute: string) {
|
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
// 生成路由文件
|
|
170
|
-
function genRouteFiles(routes: Route[], defaultRoute: string) {
|
|
175
|
+
function genRouteFiles(routes: Route[], defaultRoute: string,config?: any) {
|
|
171
176
|
// 生成路由文件列表
|
|
172
177
|
const routeFiles: any[] = [];
|
|
173
178
|
function routeToFile(route: Route) {
|
|
174
179
|
console.log(route, 'route');
|
|
175
180
|
if (route?.component?.script) {
|
|
176
181
|
const content = genExportComponetCode(route.component);
|
|
177
|
-
const lazyPath = getCompletePath(null, content);
|
|
182
|
+
const lazyPath = getCompletePath(null, content, config);
|
|
178
183
|
route.lazyPath = lazyPath;
|
|
179
184
|
routeFiles.push({
|
|
180
185
|
name: lazyPath,
|
|
@@ -189,7 +194,7 @@ function genRouteFiles(routes: Route[], defaultRoute: string) {
|
|
|
189
194
|
routeToFile(route);
|
|
190
195
|
});
|
|
191
196
|
|
|
192
|
-
let routerPath = getCompletePath('router', null);
|
|
197
|
+
let routerPath = getCompletePath('router', null, config);
|
|
193
198
|
|
|
194
199
|
routeFiles.push({
|
|
195
200
|
name: routerPath,
|
|
@@ -199,6 +204,7 @@ function genRouteFiles(routes: Route[], defaultRoute: string) {
|
|
|
199
204
|
return routeFiles;
|
|
200
205
|
}
|
|
201
206
|
export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
207
|
+
config.sysPrefixPath = app?.sysPrefixPath
|
|
202
208
|
// 获取端类型
|
|
203
209
|
const frontendType = frontend.getAncestor('FrontendType') as FrontendType;
|
|
204
210
|
// 获取业务组件
|
|
@@ -234,7 +240,8 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
234
240
|
(current) => {
|
|
235
241
|
if (current.node.toVueOptions) {
|
|
236
242
|
componentMap[current.node.id] = current.node.toVueOptions({
|
|
237
|
-
isExport: !!config.isExport
|
|
243
|
+
isExport: !!config.isExport,
|
|
244
|
+
isRelease: !!config.realRelease,
|
|
238
245
|
});
|
|
239
246
|
}
|
|
240
247
|
},
|
|
@@ -269,6 +276,7 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
269
276
|
baseUrl = '';
|
|
270
277
|
// basePath = '';
|
|
271
278
|
}
|
|
279
|
+
// todo
|
|
272
280
|
let completePath = `${baseUrl}${basePath || ''}/`;
|
|
273
281
|
|
|
274
282
|
/**
|
|
@@ -381,7 +389,7 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
381
389
|
}
|
|
382
390
|
const authResourcePaths: string[] = Object.keys(authResourcePathMap);
|
|
383
391
|
|
|
384
|
-
const routerFiles = genRouteFiles(routes, defaultRoute);
|
|
392
|
+
const routerFiles = genRouteFiles(routes, defaultRoute, config);
|
|
385
393
|
routerFiles.forEach(item => {
|
|
386
394
|
item.name = completePath + item.name;
|
|
387
395
|
// 在路由文件上存入端的信息,后续页面维度发布时候做标识
|
|
@@ -549,7 +557,6 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
549
557
|
}
|
|
550
558
|
`;
|
|
551
559
|
}
|
|
552
|
-
|
|
553
560
|
if (frontend.documentIcon) {
|
|
554
561
|
content += `{
|
|
555
562
|
const link = document.createElement('link');
|
|
@@ -625,7 +632,7 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
625
632
|
return importXMLHttpRequestComponent(scriptUrl);
|
|
626
633
|
}
|
|
627
634
|
|
|
628
|
-
var routes = await importComponent('${getCompletePath('router', null)}?t=' + Date.now());
|
|
635
|
+
var routes = await importComponent('${getCompletePath('router', null, config)}?t=' + Date.now());
|
|
629
636
|
`;
|
|
630
637
|
// 按页面维度发布先不考虑鉴权,页面维度新增的页面都算是不鉴权的数组中
|
|
631
638
|
// 只有完全页面维度新增的才会进入到这个数组中
|
|
@@ -841,9 +848,9 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
841
848
|
if (window.annotationAllData) {
|
|
842
849
|
resolve(window.annotationAllData);
|
|
843
850
|
} else {
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
851
|
+
let urlEntity = window.appInfo.sysPrefixPath + '/api/system/annotation/entityAll'
|
|
852
|
+
let urlLogic = window.appInfo.sysPrefixPath + '/api/system/annotation/logicAll'
|
|
853
|
+
Promise.all([
|
|
847
854
|
fetch(urlEntity).then(response => response.json()),
|
|
848
855
|
fetch(urlLogic).then(response => response.json())
|
|
849
856
|
])
|
|
@@ -868,7 +875,8 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
868
875
|
|
|
869
876
|
|
|
870
877
|
console.time('genHash')
|
|
871
|
-
|
|
878
|
+
// todo
|
|
879
|
+
let bundleMinPath = completePath + getCompletePath(getBundleFileName(), content, config);
|
|
872
880
|
console.timeEnd('genHash');
|
|
873
881
|
|
|
874
882
|
const otherJsList = (frontend as any)?.appletsConfig?.enable ? ['//res.wx.qq.com/open/js/jweixin-1.3.2.js'] : [];
|
|
@@ -995,33 +1003,6 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
995
1003
|
${microAppIntegration || 'loadAssets();'}
|
|
996
1004
|
})()
|
|
997
1005
|
`;
|
|
998
|
-
const assets = config.assets;
|
|
999
|
-
// 导出源码才处理
|
|
1000
|
-
if (config.isExport && Array.isArray(assets) && assets.length) {
|
|
1001
|
-
const assetsMap = config.assetsMap;
|
|
1002
|
-
const regex = new RegExp(assets.map((asset) => asset.fileUrl?.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
1003
|
-
content = content.replace(regex, (url) => {
|
|
1004
|
-
const asset = assetsMap.get(url);
|
|
1005
|
-
if (asset) {
|
|
1006
|
-
const basePath = frontend?.basePath;
|
|
1007
|
-
const assetName = encodeURIComponent(asset.name);
|
|
1008
|
-
const assetDir = basePath ? `${basePath}/assets/${assetName}` : `/assets/${assetName}`;
|
|
1009
|
-
let path = assetDir;
|
|
1010
|
-
const sysPrefixPath = frontend?.app?.sysPrefixPath;
|
|
1011
|
-
if (sysPrefixPath) {
|
|
1012
|
-
path = `${sysPrefixPath}${assetDir}`;
|
|
1013
|
-
}
|
|
1014
|
-
globalConfig.assets.push({
|
|
1015
|
-
path: assetDir,
|
|
1016
|
-
isDir: false,
|
|
1017
|
-
url,
|
|
1018
|
-
});
|
|
1019
|
-
return path;
|
|
1020
|
-
}
|
|
1021
|
-
return url;
|
|
1022
|
-
});
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
1006
|
const outputs = [
|
|
1026
1007
|
{
|
|
1027
1008
|
name: bundleMinPath,
|
|
@@ -1033,6 +1014,39 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
1033
1014
|
},
|
|
1034
1015
|
...routerFiles,
|
|
1035
1016
|
];
|
|
1017
|
+
const assets = config.assets;
|
|
1018
|
+
// 导出源码才处理
|
|
1019
|
+
if (config.isExport && Array.isArray(assets) && assets.length) {
|
|
1020
|
+
function replaceContentFilePath(content: string) {
|
|
1021
|
+
const assetsMap = config.assetsMap;
|
|
1022
|
+
// 正则
|
|
1023
|
+
const regex = utils.transAssetsToRegx(assets, 'fileUrl');
|
|
1024
|
+
content = content.replace(regex, (url) => {
|
|
1025
|
+
const asset: Asset = utils.getAssetFromAssetsMap(assetsMap, url);
|
|
1026
|
+
if (asset) {
|
|
1027
|
+
const basePath = frontend?.basePath;
|
|
1028
|
+
const assetName = encodeURIComponent(asset.name);
|
|
1029
|
+
const assetDir = basePath ? `${basePath}/assets/${assetName}` : `/assets/${assetName}`;
|
|
1030
|
+
let path = assetDir;
|
|
1031
|
+
const sysPrefixPath = frontend?.app?.sysPrefixPath;
|
|
1032
|
+
if (sysPrefixPath) {
|
|
1033
|
+
path = `${sysPrefixPath}${assetDir}`;
|
|
1034
|
+
}
|
|
1035
|
+
globalConfig.assets.push({
|
|
1036
|
+
path: assetDir,
|
|
1037
|
+
isDir: false,
|
|
1038
|
+
url,
|
|
1039
|
+
});
|
|
1040
|
+
return path;
|
|
1041
|
+
}
|
|
1042
|
+
return url;
|
|
1043
|
+
});
|
|
1044
|
+
return content;
|
|
1045
|
+
}
|
|
1046
|
+
outputs.forEach((output) => {
|
|
1047
|
+
output.content = replaceContentFilePath(output.content || '');
|
|
1048
|
+
})
|
|
1049
|
+
}
|
|
1036
1050
|
console.log('outputs', outputs)
|
|
1037
1051
|
return outputs;
|
|
1038
1052
|
}
|
|
@@ -192,31 +192,11 @@ export function genMetaData(app: App, frontend: Frontend, config: any) {
|
|
|
192
192
|
item.value = typeName === 'Long' && typeNamespace === 'nasl.core' ? +item.value : item.value
|
|
193
193
|
})
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
|
|
196
196
|
const nodeJson = newNode.toJSON?.();
|
|
197
|
-
if (Array.isArray(nodeJson.properties)) {
|
|
198
|
-
const app = node.getAncestor('App') as App
|
|
199
|
-
nodeJson.properties.forEach((property: any) => {
|
|
200
|
-
const { typeAnnotation = {} } = property;
|
|
201
|
-
if (typeAnnotation?.typeNamespace?.endsWith('.metadataTypes')) {
|
|
202
|
-
let originType = {} as TypeAnnotation
|
|
203
|
-
if (typeAnnotation.typeNamespace === 'app.metadataTypes') {
|
|
204
|
-
originType = app.metadataTypes?.find((metadataType: MetadataType) => metadataType.name === typeAnnotation.typeName)?.typeAnnotation;
|
|
205
|
-
} else if (typeAnnotation.typeNamespace?.startsWith('extensions.') && typeAnnotation.typeNamespace?.endsWith('.metadataTypes')) {
|
|
206
|
-
const dependencyName = typeAnnotation.typeNamespace?.replace('extensions.', '').replace('.metadataTypes', '')
|
|
207
|
-
originType = app.dependencies?.find((dependency: Module) => dependency.name === dependencyName)?.metadataTypes?.find((ele: MetadataType) => ele.name === typeAnnotation.typeName)?.typeAnnotation ?? {} as TypeAnnotation
|
|
208
|
-
}
|
|
209
|
-
typeAnnotation.typeKind = 'primitive'
|
|
210
|
-
typeAnnotation.typeNamespace = 'nasl.core'
|
|
211
|
-
typeAnnotation.typeName = originType.typeName
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
dataTypesMap[id] = nodeJson;
|
|
216
197
|
// 对存在defaultValue的结构进行翻译储存到defaultCode中
|
|
217
198
|
if (['Entity', 'Structure'].includes(node.concept)) {
|
|
218
|
-
|
|
219
|
-
newNode.properties.forEach((property: any, index: number) => {
|
|
199
|
+
nodeJson.properties.forEach((property: any, index: number) => {
|
|
220
200
|
const { defaultValue } = (node as Entity).properties[index];
|
|
221
201
|
if (defaultValue?.expression) {
|
|
222
202
|
property.defaultCode = {
|
|
@@ -235,11 +215,26 @@ export function genMetaData(app: App, frontend: Frontend, config: any) {
|
|
|
235
215
|
property.defaultCode = {};
|
|
236
216
|
}
|
|
237
217
|
});
|
|
238
|
-
dataTypesMap[id] = newNode;
|
|
239
|
-
newNode = BaseNode.from({ ...node.toJSON?.() });
|
|
240
|
-
} else {
|
|
241
|
-
dataTypesMap[id] = newNode.toJSON?.();
|
|
242
218
|
}
|
|
219
|
+
if (Array.isArray(nodeJson.properties)) {
|
|
220
|
+
const app = node.getAncestor('App') as App
|
|
221
|
+
nodeJson.properties.forEach((property: any) => {
|
|
222
|
+
const { typeAnnotation = {} } = property;
|
|
223
|
+
if (typeAnnotation?.typeNamespace?.endsWith('.metadataTypes')) {
|
|
224
|
+
let originType = {} as TypeAnnotation
|
|
225
|
+
if (typeAnnotation.typeNamespace === 'app.metadataTypes') {
|
|
226
|
+
originType = app.metadataTypes?.find((metadataType: MetadataType) => metadataType.name === typeAnnotation.typeName)?.typeAnnotation;
|
|
227
|
+
} else if (typeAnnotation.typeNamespace?.startsWith('extensions.') && typeAnnotation.typeNamespace?.endsWith('.metadataTypes')) {
|
|
228
|
+
const dependencyName = typeAnnotation.typeNamespace?.replace('extensions.', '').replace('.metadataTypes', '')
|
|
229
|
+
originType = app.dependencies?.find((dependency: Module) => dependency.name === dependencyName)?.metadataTypes?.find((ele: MetadataType) => ele.name === typeAnnotation.typeName)?.typeAnnotation ?? {} as TypeAnnotation
|
|
230
|
+
}
|
|
231
|
+
typeAnnotation.typeKind = 'primitive'
|
|
232
|
+
typeAnnotation.typeNamespace = 'nasl.core'
|
|
233
|
+
typeAnnotation.typeName = originType.typeName
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
dataTypesMap[id] = nodeJson;
|
|
243
238
|
const { properties } = node as any;
|
|
244
239
|
if (Array.isArray(properties)) {
|
|
245
240
|
properties.forEach((property) => {
|
|
@@ -11,6 +11,7 @@ import { getCallLogicData } from './validation';
|
|
|
11
11
|
|
|
12
12
|
import * as utils from '../../utils';
|
|
13
13
|
import { config as globalConfig } from '../../config'
|
|
14
|
+
import type { Asset } from '../release-body/internal';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* 替换端类型中的资源
|
|
@@ -74,11 +75,12 @@ async function getNaslAnnotatedJSON(app: App, opt: InternalReleaseData) {
|
|
|
74
75
|
// 导出前端源码+后端源码
|
|
75
76
|
if (opt.isExport && opt.ignoreFiles && Array.isArray(assets) && assets.length) {
|
|
76
77
|
const assetsMap = opt.assetsMap;
|
|
77
|
-
|
|
78
|
+
// 正则
|
|
79
|
+
const regex = utils.transAssetsToRegx(assets, 'fileUrl');
|
|
78
80
|
replaceFrontendTypesAssets(NaslAnnotatedJSON.frontendTypes, (node: any, key: string, url: string) => {
|
|
79
81
|
if (['staticStyle'].includes(key)) {
|
|
80
82
|
node[key] = url.replace(regex, (url) => {
|
|
81
|
-
const asset =
|
|
83
|
+
const asset: Asset = utils.getAssetFromAssetsMap(assetsMap, url);
|
|
82
84
|
if (asset) {
|
|
83
85
|
const assetName = encodeURIComponent(asset.name);
|
|
84
86
|
const path = `/assets/${assetName}`;
|
|
@@ -92,11 +94,12 @@ async function getNaslAnnotatedJSON(app: App, opt: InternalReleaseData) {
|
|
|
92
94
|
return url;
|
|
93
95
|
});
|
|
94
96
|
} else {
|
|
95
|
-
const asset =
|
|
97
|
+
const asset: Asset = utils.getAssetFromAssetsMap(assetsMap, url);
|
|
96
98
|
if (asset) {
|
|
97
99
|
// 这里是用户上传的图片链接 在导出的时候变为 离线下载的
|
|
98
100
|
// 上边也是同样的目的 只是处理的css样式里的图片链接
|
|
99
|
-
const
|
|
101
|
+
const assetName = encodeURIComponent(asset.name);
|
|
102
|
+
const path = `/assets/${assetName}`;
|
|
100
103
|
globalConfig.assets.push({
|
|
101
104
|
path,
|
|
102
105
|
isDir: false,
|
|
@@ -109,14 +112,14 @@ async function getNaslAnnotatedJSON(app: App, opt: InternalReleaseData) {
|
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
replaceFrontendTypesAssets(NaslAnnotatedJSON.frontendTypes, (node: any, key: string, url: string) => {
|
|
112
|
-
// 增加处理两种情况 1 css 自带图片; 2 src
|
|
115
|
+
// 增加处理两种情况 1 css 自带图片; 2 src 属性带的图片 3 用户上传的icon name 属性
|
|
113
116
|
if (['staticStyle'].includes(key)) {
|
|
114
117
|
// "background: url('/assets/login-bg-1.jpg') no-repeat; background-size: cover; height: 100vh;"
|
|
115
118
|
if(url.includes(`url('/assets/`) && app.sysPrefixPath?.length > 0 ){
|
|
116
119
|
node[key] = url.replace(/url\('\/assets\/(.*?)'\)/, `url('${app.sysPrefixPath}/assets/$1')`)
|
|
117
120
|
}
|
|
118
121
|
} else {
|
|
119
|
-
if(
|
|
122
|
+
if(['src' ,'name'].includes(node.name)&& /^\/assets\/(.*?)$/.test(url) &&app.sysPrefixPath?.length>0){
|
|
120
123
|
node[key]= `${app.sysPrefixPath}${url}`
|
|
121
124
|
}
|
|
122
125
|
}
|
|
@@ -423,6 +423,10 @@ export function getProcessFormDefinitions(app: App) {
|
|
|
423
423
|
`${process.name}.`,
|
|
424
424
|
'processDetailFormData.'
|
|
425
425
|
);
|
|
426
|
+
formDefinition = formDefinition.replaceAll(
|
|
427
|
+
`(${process.name} ||`,
|
|
428
|
+
'{processDetailFormData ||'
|
|
429
|
+
);
|
|
426
430
|
formDefinition = formDefinition.replace(
|
|
427
431
|
/:ref="([^"]+)"/g,
|
|
428
432
|
(match: any, p1: string) => {
|
|
@@ -433,7 +437,6 @@ export function getProcessFormDefinitions(app: App) {
|
|
|
433
437
|
|
|
434
438
|
if (process?.composedBy) {
|
|
435
439
|
const formInfo = genProcessFormCode(view);
|
|
436
|
-
console.log('formInfo: ', formInfo);
|
|
437
440
|
// 往form内塞入内容
|
|
438
441
|
if (type === 'pc')
|
|
439
442
|
formDefinition = formDefinition.replace(/<\/u-form>/, `${formInfo}</u-form>`);
|
|
@@ -458,6 +461,5 @@ export function getProcessFormDefinitions(app: App) {
|
|
|
458
461
|
res.push(itemH5);
|
|
459
462
|
}
|
|
460
463
|
});
|
|
461
|
-
|
|
462
464
|
return res;
|
|
463
465
|
}
|