@lcap/nasl 2.18.0-beta.7 → 2.19.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/template/myProcess.js +1 -1
- package/out/automate/template/myProcess.js.map +1 -1
- package/out/bak/translator.js +2 -1
- package/out/bak/translator.js.map +1 -1
- package/out/common/Command.d.ts +1 -0
- package/out/common/Command.js +5 -1
- package/out/common/Command.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +1 -0
- package/out/concepts/AnonymousFunction__.js +40 -2
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +10 -0
- package/out/concepts/App__.js +132 -0
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Assignee__.js +4 -3
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +2 -0
- package/out/concepts/BatchAssignment__.js +45 -1
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +8 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/CallFunction__.js +51 -18
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +6 -4
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +87 -15
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +4 -1
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +2 -0
- package/out/concepts/DataSource__.js +55 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +2 -0
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +1 -0
- package/out/concepts/Identifier__.js +18 -7
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -0
- package/out/concepts/Logic__.js +27 -14
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Match__.js +13 -8
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +345 -0
- package/out/concepts/NewComposite__.js +1067 -0
- package/out/concepts/NewComposite__.js.map +1 -0
- package/out/concepts/NewList__.d.ts +130 -0
- package/out/concepts/NewList__.js +353 -0
- package/out/concepts/NewList__.js.map +1 -0
- package/out/concepts/NewMap__.d.ts +221 -0
- package/out/concepts/NewMap__.js +492 -0
- package/out/concepts/NewMap__.js.map +1 -0
- package/out/concepts/New__.d.ts +19 -0
- package/out/concepts/New__.js +66 -0
- package/out/concepts/New__.js.map +1 -0
- package/out/concepts/Param__.d.ts +2 -0
- package/out/concepts/Param__.js +40 -3
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +31 -10
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +30 -0
- package/out/concepts/{ConstructArgument__.js → ProcessOutcomes__.js} +27 -48
- package/out/concepts/ProcessOutcomes__.js.map +1 -0
- package/out/concepts/Return__.js +2 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +3 -3
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +12 -2
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +4 -0
- package/out/concepts/TypeAnnotation__.js +66 -12
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +2 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.js +12 -0
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -0
- package/out/concepts/View__.js +9 -0
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.logging.js +5 -0
- package/out/concepts/basics/stdlib/nasl.logging.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +2 -0
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +151 -19
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +5 -0
- package/out/concepts/index__.js +5 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/enums/KEYWORDS.js +1 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genMetaData.js +1 -6
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +2 -0
- package/out/generator/genReleaseBody.js +18 -1
- package/out/generator/genReleaseBody.js.map +1 -1
- 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/generator/permission.d.ts +9 -0
- package/out/generator/permission.js +235 -0
- package/out/generator/permission.js.map +1 -0
- package/out/index.d.ts +1 -1
- package/out/index.js +2 -1
- package/out/index.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +69 -9
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/extendBaseNode.js +7 -3
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.js +6 -0
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.d.ts +2 -1
- package/out/server/getLogics.js +11 -0
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +1 -1
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +1 -1
- package/out/server/naslServer.js +161 -22
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.js +8 -0
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.js +53 -8
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/add.configs.js +4 -0
- package/out/service/creator/add.configs.js.map +1 -1
- package/out/service/datasource/api.d.ts +12 -0
- package/out/service/datasource/api.js +14 -0
- package/out/service/datasource/api.js.map +1 -0
- package/out/service/datasource/index.d.ts +2 -0
- package/out/service/datasource/index.js +10 -0
- package/out/service/datasource/index.js.map +1 -0
- package/out/service/storage/init.js +8 -1
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genEditTableBlock.js +4 -5
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +4 -3
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +16 -14
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +5 -5
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +6 -10
- package/out/templator/genTableBlock.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/dist/nasl.util.js +0 -0
- package/sandbox/stdlib/nasl.auth.ts +1 -1
- package/sandbox/stdlib/nasl.core.ts +4 -0
- package/sandbox/stdlib/nasl.logging.ts +4 -4
- package/sandbox/stdlib/nasl.util.ts +13 -4
- package/src/automate/template/myProcess.js +1 -1
- package/src/bak/translator.js +4 -1
- package/src/common/Command.ts +4 -0
- package/src/concepts/AnonymousFunction__.ts +48 -2
- package/src/concepts/App__.ts +140 -41
- package/src/concepts/Assignee__.ts +4 -3
- package/src/concepts/BatchAssignment__.ts +45 -1
- package/src/concepts/BindAttribute__.ts +9 -2
- package/src/concepts/CallFunction__.ts +65 -31
- package/src/concepts/CallInterface__.ts +6 -22
- package/src/concepts/CallLogic__.ts +62 -13
- package/src/concepts/CallQueryComponent__.ts +4 -1
- package/src/concepts/DataSource__.ts +56 -1
- package/src/concepts/ForEachStatement__.ts +2 -0
- package/src/concepts/Identifier__.ts +18 -7
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +48 -32
- package/src/concepts/Match__.ts +12 -8
- package/src/concepts/NewComposite__.ts +1356 -0
- package/src/concepts/NewList__.ts +444 -0
- package/src/concepts/NewMap__.ts +678 -0
- package/src/concepts/New__.ts +73 -0
- package/src/concepts/Param__.ts +238 -199
- package/src/concepts/ProcessElement__.ts +32 -10
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/ProcessOutcomes__.ts +90 -0
- package/src/concepts/Return__.ts +4 -1
- package/src/concepts/SelectMembers__.ts +3 -3
- package/src/concepts/StringInterpolation__.ts +21 -11
- package/src/concepts/TypeAnnotation__.ts +71 -50
- package/src/concepts/ValidationRule__.ts +19 -1
- package/src/concepts/Variable__.ts +4 -1
- package/src/concepts/ViewElement__.ts +38 -1
- package/src/concepts/View__.ts +12 -2
- package/src/concepts/basics/stdlib/dist/nasl.util.js +133 -34
- package/src/concepts/basics/stdlib/nasl.auth.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.logging.ts +5 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +2 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +153 -19
- package/src/concepts/dist/BindAttribute__.js +760 -0
- package/src/concepts/dist/BindEvent__.js +732 -0
- package/src/concepts/dist/CallFunction__.js +21 -7
- package/src/concepts/dist/CallLogic__.js +50 -10
- package/src/concepts/dist/Identifier__.js +311 -0
- package/src/concepts/dist/StringInterpolation__.js +231 -0
- package/src/concepts/dist/TypeAnnotation__.js +834 -0
- package/src/concepts/dist/ViewElement__.js +12 -0
- package/src/concepts/dist/View__.js +1601 -0
- package/src/concepts/index__.ts +5 -0
- package/src/enums/KEYWORDS.ts +1 -0
- package/src/generator/dist/genMetaData.js +1 -5
- package/src/generator/dist/permission.js +392 -0
- package/src/generator/genMetaData.ts +1 -6
- package/src/generator/genReleaseBody.ts +21 -3
- package/src/generator/index.ts +1 -0
- package/src/generator/permission.ts +271 -0
- package/src/index.ts +1 -1
- package/src/server/dist/naslServer.js +385 -269
- package/src/server/entity2LogicNamespace.ts +70 -10
- package/src/server/extendBaseNode.ts +7 -3
- package/src/server/formatTsUtils.ts +6 -0
- package/src/server/getLogics.ts +13 -1
- package/src/server/getMemberIdentifier.ts +1 -1
- package/src/server/naslServer.ts +162 -29
- package/src/server/process2LogicNamespace.ts +8 -0
- package/src/server/translator.ts +52 -9
- package/src/service/creator/add.configs.js +4 -0
- package/src/service/dataSource/api.js +11 -0
- package/src/service/dataSource/index.js +6 -0
- package/src/service/storage/dist/init.js +8 -1
- package/src/service/storage/init.ts +9 -2
- package/src/service/video/VideoTranscribe.js +1 -0
- package/src/templator/dist/genEditTableBlock.js +204 -0
- package/src/templator/dist/genGridViewBlock.js +265 -0
- package/src/templator/dist/genListViewBlock.js +84 -0
- package/src/templator/dist/genTableBlock.js +209 -0
- package/src/templator/dist/utils.js +527 -0
- package/src/templator/genEditTableBlock.ts +8 -16
- package/src/templator/genGetBlock.ts +18 -19
- package/src/templator/genGridViewBlock.ts +18 -18
- package/src/templator/genListViewBlock.ts +8 -11
- package/src/templator/genTableBlock.ts +6 -10
- package/ts-worker/dist/webpack.config.dev.js +1 -3
- package/ts-worker/lib/tsserver.js +8 -1
- package/out/automate/engine/2.14-components.d.ts +0 -1115
- package/out/automate/engine/2.14-components.js +0 -1087
- package/out/automate/engine/2.14-components.js.map +0 -1
- package/out/concepts/ConstructArgument__.d.ts +0 -40
- package/out/concepts/ConstructArgument__.js.map +0 -1
- package/out/concepts/Construct__.d.ts +0 -189
- package/out/concepts/Construct__.js +0 -340
- package/out/concepts/Construct__.js.map +0 -1
- package/out/concepts/MatchExpression__.d.ts +0 -97
- package/out/concepts/MatchExpression__.js +0 -281
- package/out/concepts/MatchExpression__.js.map +0 -1
- package/out/templator/sql-parser/index.d.ts +0 -1
- package/out/templator/sql-parser/index.js +0 -228
- package/out/templator/sql-parser/index.js.map +0 -1
- package/out/templator/sql-parser/parser.js +0 -26664
- package/out/templator/sql-parser/parser.js.map +0 -1
- package/src/concepts/dist/Anchor__.js +0 -179
- package/src/concepts/dist/Assignment__.js +0 -301
- package/src/concepts/dist/CallInterface__.js +0 -533
- package/src/concepts/dist/ForEachStatement__.js +0 -426
- package/src/concepts/dist/MatchCase__.js +0 -587
- package/src/concepts/dist/Match__.js +0 -631
- package/src/concepts/dist/MemberExpression__.js +0 -348
- package/src/concepts/dist/Param__.js +0 -538
- package/src/concepts/dist/Return__.js +0 -494
- package/src/concepts/dist/Variable__.js +0 -537
- package/src/server/dist/formatTsUtils.js +0 -683
|
@@ -731,7 +731,7 @@ export class BatchAssignment extends LogicItem {
|
|
|
731
731
|
}
|
|
732
732
|
|
|
733
733
|
deleteAssignmentLine(assignmentLine: AssignmentLine) {
|
|
734
|
-
const newLine = this.assignmentLines.filter((line) => line
|
|
734
|
+
const newLine = this.assignmentLines.filter((line) => line !== assignmentLine);
|
|
735
735
|
this.update({
|
|
736
736
|
assignmentLines: newLine,
|
|
737
737
|
});
|
|
@@ -769,6 +769,50 @@ export class BatchAssignment extends LogicItem {
|
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
771
|
|
|
772
|
+
changeMembers(oldNode:any, members: MemberExpression[], keepMembers: any, expression: LogicItem) {
|
|
773
|
+
this.app.emit('collect:start', {
|
|
774
|
+
actionMsg: '批量赋值修改变量',
|
|
775
|
+
});
|
|
776
|
+
const selectMember = oldNode.parentNode;
|
|
777
|
+
const autoConnectionIndex = this.rights.findIndex((right) => right === selectMember);
|
|
778
|
+
const newSelectMember = Object.assign({}, selectMember, { expression, members });
|
|
779
|
+
let newLines: any = [];
|
|
780
|
+
// 修改连线
|
|
781
|
+
if (selectMember.parentKey === 'left') {
|
|
782
|
+
members.forEach((item: any, index: any) => {
|
|
783
|
+
if (keepMembers.has(item.completeName)) {
|
|
784
|
+
const lines = this.findlines(item, selectMember);
|
|
785
|
+
lines.forEach((line) => {
|
|
786
|
+
const newLine = Object.assign({}, line, { leftIndex: [line.leftIndex[0], index] });
|
|
787
|
+
newLines.push(newLine);
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
this.update({
|
|
792
|
+
assignmentLines: newLines,
|
|
793
|
+
left: newSelectMember,
|
|
794
|
+
});
|
|
795
|
+
} else {
|
|
796
|
+
const splitIndex = this.rights.findIndex((right) => selectMember === right);
|
|
797
|
+
newLines = this.assignmentLines.filter(({ rightIndex }) => rightIndex[0] !== splitIndex);
|
|
798
|
+
members.forEach((item, index) => {
|
|
799
|
+
if (keepMembers.has(item.completeName)) {
|
|
800
|
+
const lines = this.findlines(item, selectMember);
|
|
801
|
+
lines.forEach((line) => {
|
|
802
|
+
const newLine = Object.assign({}, line, { rightIndex: [line.rightIndex[0], index] });
|
|
803
|
+
newLines.push(newLine);
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
this.update({
|
|
808
|
+
assignmentLines: newLines,
|
|
809
|
+
rights: [...this.rights.slice(0, splitIndex), newSelectMember, ...this.rights.slice(splitIndex + 1, this.rights.length)],
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
this.autoConnection && this.batchAutoConnection(autoConnectionIndex);
|
|
813
|
+
this.app.emit('collect:end');
|
|
814
|
+
}
|
|
815
|
+
|
|
772
816
|
findMember(arrIndex: Array<number>, place: string) {
|
|
773
817
|
const [firstIndex, secondIndex] = [arrIndex[0], arrIndex[1]];
|
|
774
818
|
if (place === 'left') {
|
|
@@ -723,13 +723,20 @@ export class BindAttribute extends BaseNode {
|
|
|
723
723
|
str += 'download="true" ';
|
|
724
724
|
name = 'href';
|
|
725
725
|
}
|
|
726
|
+
// 文本默认要经过toString转换
|
|
727
|
+
if (options.finalCode !== false && name === 'text' && !this.sync && this.type === 'dynamic') {
|
|
728
|
+
const expTypeAnnotation = (this.expression as any)?.typeAnnotation || this.expression?.__TypeAnnotation;
|
|
729
|
+
value = `$utils['ToString'](${value}, '${expTypeAnnotation?.sortedTypeKey}')`;
|
|
730
|
+
}
|
|
726
731
|
if (this.type === 'string') {
|
|
727
732
|
str += `${name}="${value}"`;
|
|
728
733
|
} else {
|
|
729
734
|
str += `:${name}${this.sync ? '.sync' : ''}="${value}"`;
|
|
730
735
|
}
|
|
731
|
-
} else if(this.type === 'string' && this.value === '')
|
|
732
|
-
|
|
736
|
+
} else if (this.type === 'string' && this.value === '')
|
|
737
|
+
if (!['destination', 'externalDestination'].includes(this.name)) {
|
|
738
|
+
str = `${name}="${this.value}"`;
|
|
739
|
+
}
|
|
733
740
|
|
|
734
741
|
return str;
|
|
735
742
|
}
|
|
@@ -66,7 +66,7 @@ export class CallFunction extends LogicItem {
|
|
|
66
66
|
@property('Argument')
|
|
67
67
|
arguments: Array<Argument> = [];
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @param source 需要合并的部分参数
|
|
@@ -81,12 +81,12 @@ export class CallFunction extends LogicItem {
|
|
|
81
81
|
return super.from(source, parentNode, parentKey) as CallFunction;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
84
|
|
|
87
|
-
|
|
88
85
|
|
|
89
|
-
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* 插入类型标注
|
|
@@ -120,7 +120,7 @@ export class CallFunction extends LogicItem {
|
|
|
120
120
|
return typeAnnotation;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
126
|
* 插入类型标注
|
|
@@ -144,7 +144,7 @@ export class CallFunction extends LogicItem {
|
|
|
144
144
|
return node;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
|
|
149
149
|
/**
|
|
150
150
|
* 添加类型标注
|
|
@@ -165,7 +165,7 @@ export class CallFunction extends LogicItem {
|
|
|
165
165
|
return this._insertTypeAnnotationAt(options as any, index);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
171
|
* 添加类型标注
|
|
@@ -193,7 +193,7 @@ export class CallFunction extends LogicItem {
|
|
|
193
193
|
|
|
194
194
|
|
|
195
195
|
|
|
196
|
-
|
|
196
|
+
|
|
197
197
|
|
|
198
198
|
/**
|
|
199
199
|
* 插入实际参数
|
|
@@ -227,7 +227,7 @@ export class CallFunction extends LogicItem {
|
|
|
227
227
|
return argument;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
|
|
231
231
|
|
|
232
232
|
/**
|
|
233
233
|
* 插入实际参数
|
|
@@ -251,7 +251,7 @@ export class CallFunction extends LogicItem {
|
|
|
251
251
|
return node;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
|
|
254
|
+
|
|
255
255
|
|
|
256
256
|
/**
|
|
257
257
|
* 添加实际参数
|
|
@@ -272,7 +272,7 @@ export class CallFunction extends LogicItem {
|
|
|
272
272
|
return this._insertArgumentAt(options as any, index);
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
|
|
275
|
+
|
|
276
276
|
|
|
277
277
|
/**
|
|
278
278
|
* 添加实际参数
|
|
@@ -298,7 +298,7 @@ export class CallFunction extends LogicItem {
|
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
304
|
* 删除类型标注
|
|
@@ -380,11 +380,19 @@ export class CallFunction extends LogicItem {
|
|
|
380
380
|
} else {
|
|
381
381
|
let code = `$utils['${this.calleeName}']`;
|
|
382
382
|
code += '(';
|
|
383
|
-
this.arguments
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
383
|
+
if (Array.isArray(this.arguments) && this.arguments.length) {
|
|
384
|
+
const needToString = ['Concat'].includes(this.calleeName);
|
|
385
|
+
this.arguments?.forEach((arg: any, index) => {
|
|
386
|
+
let argStr = arg?.toVue(options);
|
|
387
|
+
if (needToString) {
|
|
388
|
+
const argTypeAnnotation = arg.typeAnnotation || arg.__TypeAnnotation;
|
|
389
|
+
argStr = `$utils['ToString'](${argStr}, '${argTypeAnnotation?.sortedTypeKey}')`;
|
|
390
|
+
}
|
|
391
|
+
code += argStr;
|
|
392
|
+
if (index !== this.arguments?.length - 1)
|
|
393
|
+
code += ', ';
|
|
394
|
+
});
|
|
395
|
+
}
|
|
388
396
|
if (this.typeArguments && this.typeArguments.length) {
|
|
389
397
|
if (this.arguments?.length)
|
|
390
398
|
code += ', ';
|
|
@@ -423,23 +431,49 @@ export class CallFunction extends LogicItem {
|
|
|
423
431
|
toJS(state?: TranslatorState): string {
|
|
424
432
|
let code = `this.$utils['${this.calleeName}']`;
|
|
425
433
|
code += '(';
|
|
426
|
-
this.arguments
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
if (index !== this.typeArguments?.length - 1)
|
|
434
|
+
if (Array.isArray(this.arguments) && this.arguments.length) {
|
|
435
|
+
const needToString = ['Concat'].includes(this.calleeName);
|
|
436
|
+
this.arguments.forEach((arg: any, index) => {
|
|
437
|
+
let argStr = arg?.toJS(shiftState(state, code));
|
|
438
|
+
if (needToString) {
|
|
439
|
+
const argTypeAnnotation = arg.typeAnnotation || arg.__TypeAnnotation;
|
|
440
|
+
argStr = `this.$utils['ToString'](${argStr}, '${argTypeAnnotation?.sortedTypeKey}')`;
|
|
441
|
+
}
|
|
442
|
+
code += argStr;
|
|
443
|
+
if (index !== this.arguments?.length - 1)
|
|
437
444
|
code += ', ';
|
|
438
445
|
});
|
|
439
446
|
}
|
|
447
|
+
const isStringConvert = ['ToString', 'FromString'].includes(this.calleeName);
|
|
448
|
+
let argTypeAnnotation;
|
|
449
|
+
if (isStringConvert) {
|
|
450
|
+
if (this.calleeName === 'ToString') {
|
|
451
|
+
const arg = this.arguments[0];
|
|
452
|
+
argTypeAnnotation = (arg as any).typeAnnotation || arg.__TypeAnnotation;
|
|
453
|
+
} else if (this.calleeName === 'FromString') {
|
|
454
|
+
argTypeAnnotation = this.typeArguments?.[0];
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
if (argTypeAnnotation) {
|
|
458
|
+
code += `, '${argTypeAnnotation?.sortedTypeKey}'`;
|
|
459
|
+
} else {
|
|
460
|
+
if (Array.isArray(this.typeArguments) && this.typeArguments.length) {
|
|
461
|
+
if (this.arguments?.length)
|
|
462
|
+
code += ', ';
|
|
463
|
+
this.typeArguments?.forEach((arg, index) => {
|
|
464
|
+
code += arg?.toJS(shiftState(state, code));
|
|
465
|
+
if (index !== this.typeArguments?.length - 1)
|
|
466
|
+
code += ', ';
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
440
471
|
code += ')';
|
|
441
472
|
const typeAnnotation = (this as any).typeAnnotation || this.__TypeAnnotation;
|
|
442
|
-
const needGenInitFromSchema = typeAnnotation &&
|
|
473
|
+
const needGenInitFromSchema = typeAnnotation && (
|
|
474
|
+
!['primitive', 'union'].includes(typeAnnotation.typeKind)
|
|
475
|
+
|| typeAnnotation.typeName === 'DateTime'
|
|
476
|
+
);
|
|
443
477
|
if (needGenInitFromSchema) {
|
|
444
478
|
code = `this.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}', ${code})`;
|
|
445
479
|
}
|
|
@@ -550,7 +584,7 @@ export class CallFunction extends LogicItem {
|
|
|
550
584
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
551
585
|
let code = '';
|
|
552
586
|
const calleeKey = this.calleeKey;
|
|
553
|
-
if (
|
|
587
|
+
if (['nasl.util.Convert', 'nasl.util.FromString'].includes(calleeKey)) {
|
|
554
588
|
// nasl.util.Convert(variable1)<nasl.core.String>();
|
|
555
589
|
// 单独处理
|
|
556
590
|
|
|
@@ -61,8 +61,6 @@ export class CallInterface extends LogicItem {
|
|
|
61
61
|
@property('Argument')
|
|
62
62
|
arguments: Array<Argument> = [];
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
64
|
/**
|
|
67
65
|
* @param source 需要合并的部分参数
|
|
68
66
|
*/
|
|
@@ -76,13 +74,6 @@ export class CallInterface extends LogicItem {
|
|
|
76
74
|
return super.from(source, parentNode, parentKey) as CallInterface;
|
|
77
75
|
}
|
|
78
76
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
77
|
/**
|
|
87
78
|
* 插入实际参数
|
|
88
79
|
* @internal
|
|
@@ -115,8 +106,6 @@ export class CallInterface extends LogicItem {
|
|
|
115
106
|
return argument;
|
|
116
107
|
}
|
|
117
108
|
|
|
118
|
-
|
|
119
|
-
|
|
120
109
|
/**
|
|
121
110
|
* 插入实际参数
|
|
122
111
|
* @param argumentOptions 实际参数参数
|
|
@@ -139,8 +128,6 @@ export class CallInterface extends LogicItem {
|
|
|
139
128
|
return node;
|
|
140
129
|
}
|
|
141
130
|
|
|
142
|
-
|
|
143
|
-
|
|
144
131
|
/**
|
|
145
132
|
* 添加实际参数
|
|
146
133
|
* @internal
|
|
@@ -160,8 +147,6 @@ export class CallInterface extends LogicItem {
|
|
|
160
147
|
return this._insertArgumentAt(options as any, index);
|
|
161
148
|
}
|
|
162
149
|
|
|
163
|
-
|
|
164
|
-
|
|
165
150
|
/**
|
|
166
151
|
* 添加实际参数
|
|
167
152
|
* @param argumentOptions 实际参数参数
|
|
@@ -185,9 +170,6 @@ export class CallInterface extends LogicItem {
|
|
|
185
170
|
return node;
|
|
186
171
|
}
|
|
187
172
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
173
|
/**
|
|
192
174
|
* 删除实际参数
|
|
193
175
|
* @param argument 已有的实际参数实例
|
|
@@ -195,7 +177,7 @@ export class CallInterface extends LogicItem {
|
|
|
195
177
|
removeArgument(argument: Argument): void;
|
|
196
178
|
|
|
197
179
|
removeArgument(options: Argument) {
|
|
198
|
-
|
|
180
|
+
const argument: Argument = options;
|
|
199
181
|
return argument.delete();
|
|
200
182
|
}
|
|
201
183
|
|
|
@@ -368,7 +350,8 @@ export class CallInterface extends LogicItem {
|
|
|
368
350
|
&& this.parentNode.concept !== 'SelectMembers'
|
|
369
351
|
&& this.parentNode.concept !== 'BinaryExpression'
|
|
370
352
|
&& this.parentNode.concept !== 'MemberExpression'
|
|
371
|
-
&& this.parentNode.concept !== 'StringInterpolation'
|
|
353
|
+
&& this.parentNode.concept !== 'StringInterpolation'
|
|
354
|
+
&& !['NewMap', 'NewList'].includes(this.parentNode.concept)) {
|
|
372
355
|
code += ';';
|
|
373
356
|
}
|
|
374
357
|
code += '\n';
|
|
@@ -553,8 +536,9 @@ export class CallInterface extends LogicItem {
|
|
|
553
536
|
logicParam = node.params;
|
|
554
537
|
}
|
|
555
538
|
if (this.arguments?.length) {
|
|
556
|
-
this.arguments.forEach((arg
|
|
557
|
-
const
|
|
539
|
+
this.arguments.forEach((arg) => {
|
|
540
|
+
const idx = logicParam.findIndex((params) => arg.keyword === params.name);
|
|
541
|
+
const param = logicParam[idx];
|
|
558
542
|
|
|
559
543
|
arg.paramRequired = param?.required;
|
|
560
544
|
arg.paramTypeAnnotation = undefined;
|
|
@@ -5,6 +5,8 @@ import View from './View__';
|
|
|
5
5
|
import { ElementToVueOptions } from './ViewElement__';
|
|
6
6
|
import { getNodeByNodeCallee, getNaslNodeByNodeCallee } from '../automate/engine/utils';
|
|
7
7
|
import { findConceptKeyWordIndexFromNamespace } from '../utils';
|
|
8
|
+
import * as JSON5 from 'json5';
|
|
9
|
+
import Identifier from './Identifier__';
|
|
8
10
|
|
|
9
11
|
//================================================================================
|
|
10
12
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -448,10 +450,14 @@ export class CallLogic extends LogicItem {
|
|
|
448
450
|
}
|
|
449
451
|
this.calleeName = logic.name;
|
|
450
452
|
this.arguments = [];
|
|
451
|
-
logic.params.forEach((param) => {
|
|
452
|
-
this._addArgument({
|
|
453
|
+
logic.params.forEach((param: any) => {
|
|
454
|
+
const argument = this._addArgument({
|
|
453
455
|
keyword: param.name,
|
|
454
456
|
});
|
|
457
|
+
if (param.defaultExpression) {
|
|
458
|
+
const exp: any = BaseNode.from({ ...param.defaultExpression.toJSON() });
|
|
459
|
+
argument.setExpression(exp);
|
|
460
|
+
}
|
|
455
461
|
});
|
|
456
462
|
if (logic.typeParams) {
|
|
457
463
|
this.typeArguments = [];
|
|
@@ -471,7 +477,7 @@ export class CallLogic extends LogicItem {
|
|
|
471
477
|
const relationOptions = { parentNode: this, parentKey: 'arguments' };
|
|
472
478
|
const argument = Argument.from({
|
|
473
479
|
keyword: param.name,
|
|
474
|
-
expression: param.defaultExpression,
|
|
480
|
+
expression: param.isFunction ? new Identifier() : param.defaultExpression,
|
|
475
481
|
}, this);
|
|
476
482
|
Object.assign(argument, relationOptions);
|
|
477
483
|
return argument;
|
|
@@ -692,7 +698,6 @@ var __parseType = __parseType || ((root, prop) => {
|
|
|
692
698
|
|
|
693
699
|
// 全局逻辑
|
|
694
700
|
if (!isViewLogic) {
|
|
695
|
-
const namespaceArr = calleeNamespace?.split('.');
|
|
696
701
|
const logic = getNodeByNodeCallee(this.app, this.calleewholeKey, (key: string, tempPoint: any) => {
|
|
697
702
|
// 处理 NASL 中未定义的假的节点
|
|
698
703
|
if (key === tempPoint.name) {
|
|
@@ -754,12 +759,31 @@ var __parseType = __parseType || ((root, prop) => {
|
|
|
754
759
|
code += `},\n`;
|
|
755
760
|
break;
|
|
756
761
|
}
|
|
762
|
+
case 'update':
|
|
763
|
+
case 'createOrUpdate':
|
|
764
|
+
case 'batchUpdate': {
|
|
765
|
+
code += `body: {\n`;
|
|
766
|
+
const argsStr = logicArgs
|
|
767
|
+
.filter((arg: any) => arg.expression)
|
|
768
|
+
.map((arg: any) => {
|
|
769
|
+
const name = arg.keyword === 'body' ?
|
|
770
|
+
(this.calleeName === 'batchUpdate' ? 'entities' : 'entity') :
|
|
771
|
+
arg.keyword;
|
|
772
|
+
return `${name}: ${arg.expression.toJS(shiftState(state, code))}`;
|
|
773
|
+
})
|
|
774
|
+
.join(',\n');
|
|
775
|
+
code += argsStr;
|
|
776
|
+
code += `},\n`;
|
|
777
|
+
logicArgs = [];
|
|
778
|
+
breakBody = true;
|
|
779
|
+
break;
|
|
780
|
+
}
|
|
757
781
|
case 'updateBy': {
|
|
758
782
|
code += `body: {`;
|
|
759
783
|
const argsStr = logicArgs
|
|
760
784
|
.filter((arg: any) => arg.expression)
|
|
761
785
|
.map((arg: any) => {
|
|
762
|
-
const name = arg.
|
|
786
|
+
const name = arg.keyword === 'body' ? 'entity' : arg.keyword;
|
|
763
787
|
// filter回调函数
|
|
764
788
|
if (arg.expression.returnExpression) {
|
|
765
789
|
const argsStr = JSON.stringify(handleMember(arg.expression.returnExpression));
|
|
@@ -816,6 +840,9 @@ var __parseType = __parseType || ((root, prop) => {
|
|
|
816
840
|
.map((obj: any) => `\n${obj?.keyword}: ${obj?.arg?.toJS(shiftState(state, code))}`)
|
|
817
841
|
.join(', ');
|
|
818
842
|
code += argsStr;
|
|
843
|
+
if (Array.isArray(this.typeArguments) && this.typeArguments.length) {
|
|
844
|
+
code += `,\n__typeArguments: ${JSON5.stringify(this.typeArguments)}`;
|
|
845
|
+
}
|
|
819
846
|
}
|
|
820
847
|
code += '\n}';
|
|
821
848
|
}
|
|
@@ -854,12 +881,27 @@ var __parseType = __parseType || ((root, prop) => {
|
|
|
854
881
|
code += '})';
|
|
855
882
|
} else {
|
|
856
883
|
code += '(';
|
|
857
|
-
|
|
858
|
-
|
|
884
|
+
const needToString = ['showMessage', 'consoleLog'].includes(this.calleeName);
|
|
885
|
+
if (needToString) {
|
|
886
|
+
code += `this.$utils['ToString'](`;
|
|
887
|
+
}
|
|
888
|
+
if (Array.isArray(completeArguments) && completeArguments.length) {
|
|
889
|
+
completeArguments.forEach((arg, index) => {
|
|
859
890
|
code += arg?.toJS(shiftState(state, code));
|
|
860
891
|
if (index !== completeArguments?.length - 1)
|
|
861
892
|
code += ', ';
|
|
862
893
|
});
|
|
894
|
+
if (needToString) {
|
|
895
|
+
const arg = this.arguments[0];
|
|
896
|
+
const argTypeAnnotation = (arg as any).typeAnnotation || arg.__TypeAnnotation;
|
|
897
|
+
if (argTypeAnnotation) {
|
|
898
|
+
code += `, '${argTypeAnnotation?.sortedTypeKey}'`;
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
if (needToString) {
|
|
903
|
+
code += `)`;
|
|
904
|
+
}
|
|
863
905
|
code += ')';
|
|
864
906
|
}
|
|
865
907
|
}
|
|
@@ -914,7 +956,10 @@ var __parseType = __parseType || ((root, prop) => {
|
|
|
914
956
|
};
|
|
915
957
|
}
|
|
916
958
|
const typeAnnotation = (this as any).typeAnnotation || this.__TypeAnnotation;
|
|
917
|
-
const needGenInitFromSchema = typeAnnotation &&
|
|
959
|
+
const needGenInitFromSchema = typeAnnotation && (
|
|
960
|
+
!['primitive', 'union'].includes(typeAnnotation.typeKind)
|
|
961
|
+
|| typeAnnotation.typeName === 'DateTime'
|
|
962
|
+
);
|
|
918
963
|
if (needGenInitFromSchema) {
|
|
919
964
|
code = `this.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}', ${code})`;
|
|
920
965
|
}
|
|
@@ -934,13 +979,14 @@ var __parseType = __parseType || ((root, prop) => {
|
|
|
934
979
|
code += `<`;
|
|
935
980
|
code += `${typeAnnotation.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }))}>`;
|
|
936
981
|
}
|
|
937
|
-
|
|
982
|
+
// 参数必填
|
|
983
|
+
const paramRequired = ['showMessage', 'consoleLog'].includes(this.calleeName);
|
|
938
984
|
const tsCalleeNamespace = this.tsCalleeNamespace;
|
|
939
985
|
if ((tsCalleeNamespace.startsWith('elements') && tsCalleeNamespace.endsWith('logics')) || tsCalleeNamespace.startsWith('nasl.')) {
|
|
940
986
|
code += '(';
|
|
941
987
|
this.arguments.forEach((arg, index) => {
|
|
942
988
|
// 页面逻辑先都非必填
|
|
943
|
-
code += arg.toEmbeddedTS(shiftState(state, code),
|
|
989
|
+
code += arg.toEmbeddedTS(shiftState(state, code), paramRequired);
|
|
944
990
|
if (index !== this.arguments.length - 1)
|
|
945
991
|
code += ', ';
|
|
946
992
|
});
|
|
@@ -953,7 +999,8 @@ var __parseType = __parseType || ((root, prop) => {
|
|
|
953
999
|
&& this.parentNode.concept !== 'SelectMembers'
|
|
954
1000
|
&& this.parentNode.concept !== 'BinaryExpression'
|
|
955
1001
|
&& this.parentNode.concept !== 'StringInterpolation'
|
|
956
|
-
&& this.parentNode.concept !== 'MemberExpression'
|
|
1002
|
+
&& this.parentNode.concept !== 'MemberExpression'
|
|
1003
|
+
&& !['NewMap', 'NewList'].includes(this.parentNode.concept)) {
|
|
957
1004
|
code += ';';
|
|
958
1005
|
}
|
|
959
1006
|
} else {
|
|
@@ -975,7 +1022,8 @@ var __parseType = __parseType || ((root, prop) => {
|
|
|
975
1022
|
&& this.parentNode.concept !== 'SelectMembers'
|
|
976
1023
|
&& this.parentNode.concept !== 'BinaryExpression'
|
|
977
1024
|
&& this.parentNode.concept !== 'StringInterpolation'
|
|
978
|
-
&& this.parentNode.concept !== 'MemberExpression'
|
|
1025
|
+
&& this.parentNode.concept !== 'MemberExpression'
|
|
1026
|
+
&& !['NewMap', 'NewList'].includes(this.parentNode.concept)) {
|
|
979
1027
|
code += ';';
|
|
980
1028
|
}
|
|
981
1029
|
} else {
|
|
@@ -988,7 +1036,8 @@ var __parseType = __parseType || ((root, prop) => {
|
|
|
988
1036
|
&& this.parentNode.concept !== 'SelectMembers'
|
|
989
1037
|
&& this.parentNode.concept !== 'BinaryExpression'
|
|
990
1038
|
&& this.parentNode.concept !== 'StringInterpolation'
|
|
991
|
-
&& this.parentNode.concept !== 'MemberExpression'
|
|
1039
|
+
&& this.parentNode.concept !== 'MemberExpression'
|
|
1040
|
+
&& !['NewMap', 'NewList'].includes(this.parentNode.concept)) {
|
|
992
1041
|
code += ';';
|
|
993
1042
|
}
|
|
994
1043
|
}
|
|
@@ -1087,7 +1087,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1087
1087
|
&& this.parentNode.concept !== 'SelectMembers'
|
|
1088
1088
|
&& this.parentNode.concept !== 'BinaryExpression'
|
|
1089
1089
|
&& this.parentNode.concept !== 'StringInterpolation'
|
|
1090
|
-
&& this.parentNode.concept !== 'MemberExpression'
|
|
1090
|
+
&& this.parentNode.concept !== 'MemberExpression'
|
|
1091
|
+
&& ['NewMap', 'NewList'].includes(this.parentNode.concept)) {
|
|
1091
1092
|
code += ';';
|
|
1092
1093
|
}
|
|
1093
1094
|
code += '\n';
|
|
@@ -1486,6 +1487,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1486
1487
|
expression,
|
|
1487
1488
|
});
|
|
1488
1489
|
completionProperty.icon = 'property';
|
|
1490
|
+
// 标记实体属性是否是符合类型
|
|
1491
|
+
Object.assign(completionProperty, { isComplexType: property.typeAnnotation.isComplexType() });
|
|
1489
1492
|
return completionProperty;
|
|
1490
1493
|
}),
|
|
1491
1494
|
}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, withSourceMap, createCompilerState } from '../translator';
|
|
2
|
+
import datasourceService from '../service/datasource';
|
|
2
3
|
|
|
3
4
|
//================================================================================
|
|
4
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -402,7 +403,7 @@ export class DataSource extends BaseNode {
|
|
|
402
403
|
code += this.toEmbeddedTS(state);
|
|
403
404
|
} catch (err) {
|
|
404
405
|
code += '';
|
|
405
|
-
console.
|
|
406
|
+
console.error(err);
|
|
406
407
|
}
|
|
407
408
|
code += '}\n';
|
|
408
409
|
|
|
@@ -413,6 +414,60 @@ export class DataSource extends BaseNode {
|
|
|
413
414
|
};
|
|
414
415
|
}
|
|
415
416
|
|
|
417
|
+
// 测试数据源连通性
|
|
418
|
+
async pingDatabase(recordEnvConnectError: Function) {
|
|
419
|
+
const configProperty = this.app.configuration.getGroup('dataSource').getProperty(this.name);
|
|
420
|
+
configProperty && configProperty.values.forEach((prop) => {
|
|
421
|
+
// 未配置数据源时,不进行连接测试
|
|
422
|
+
if (!prop.value) {
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
const dataSource = configProperty.name;
|
|
426
|
+
const env = prop.env;
|
|
427
|
+
return datasourceService.pingDatabase({
|
|
428
|
+
body: {
|
|
429
|
+
category: 'sql',
|
|
430
|
+
appId: this.app.id,
|
|
431
|
+
dataSource,
|
|
432
|
+
env,
|
|
433
|
+
},
|
|
434
|
+
}).then(() => {
|
|
435
|
+
Object.assign(this, { [`__${env}ConnectError`]: false });
|
|
436
|
+
}).catch(() => {
|
|
437
|
+
Object.assign(this, { [`__${env}ConnectError`]: true });
|
|
438
|
+
}).then(() => {
|
|
439
|
+
recordEnvConnectError(env);
|
|
440
|
+
});
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
recordEnvConnectError(records: any[], env: string) {
|
|
444
|
+
const target = records?.find((item: any) => item.id === this.id);
|
|
445
|
+
// 诊断还未生成,在诊断时生成问题
|
|
446
|
+
if (!target) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
// 诊断已生成,手动插入问题
|
|
450
|
+
const errorKey = `__${env}ConnectError`;
|
|
451
|
+
const errorText = `DataSource ${env} env connect error`;
|
|
452
|
+
target.semanticDiagnostics = target.semanticDiagnostics.filter((item: any) => item.code !== errorText);
|
|
453
|
+
if ((this as any)[errorKey]) {
|
|
454
|
+
const envText = env === 'online' ? '生产' : '开发';
|
|
455
|
+
target.semanticDiagnostics.push({
|
|
456
|
+
text: errorText,
|
|
457
|
+
node: this,
|
|
458
|
+
severity: 'error',
|
|
459
|
+
message: `数据源配置:数据源 ${this.name} ${envText}环境数据源连接不通,请先检查${envText}环境数据源配置`,
|
|
460
|
+
originalDiagnostic: {
|
|
461
|
+
fileName: '',
|
|
462
|
+
start: null,
|
|
463
|
+
end: null,
|
|
464
|
+
category: 'error',
|
|
465
|
+
text: `DataSource connection error`,
|
|
466
|
+
},
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
416
471
|
// 获取datasource对应的数据源配置
|
|
417
472
|
get dataSourceConfig() {
|
|
418
473
|
let devProperty = null;
|
|
@@ -531,6 +531,8 @@ export class ForEachStatement extends LogicItem {
|
|
|
531
531
|
code += this.each ? this.each.toEmbeddedTS(shiftState(state, code, {
|
|
532
532
|
tabSize: 0,
|
|
533
533
|
})) : '__IDENTIFIER__';
|
|
534
|
+
if (['NewList', 'NewMap'].includes(this.each.concept))
|
|
535
|
+
code += '\n';
|
|
534
536
|
code += '.__slice(';
|
|
535
537
|
code += this.start ? this.start.toEmbeddedTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
536
538
|
code += ', ';
|