@lcap/nasl 2.22.0-beta.0 → 2.22.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/automate/engine/operators.d.ts +9 -0
- package/out/automate/engine/viewCache.d.ts +1 -0
- package/out/automate/template/myProcess.d.ts +1 -0
- package/out/common/BaseNode.d.ts +1 -0
- package/out/common/BaseNode.js +7 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.d.ts +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +78 -12
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +9 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +2 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +2 -0
- package/out/concepts/CallQueryComponent__.js +76 -24
- 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__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +4 -0
- package/out/concepts/ConfigProperty__.js +18 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.js +2 -2
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +7 -2
- package/out/concepts/EntityProperty__.js +100 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +2 -1
- package/out/concepts/Entity__.js +30 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +7 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +53 -0
- package/out/concepts/Integration__.js +143 -0
- package/out/concepts/Integration__.js.map +1 -0
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +42 -0
- package/out/concepts/JavaLogic__.js +122 -0
- package/out/concepts/JavaLogic__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +12 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +11 -6
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +51 -0
- package/out/concepts/MicroApp__.js +113 -0
- package/out/concepts/MicroApp__.js.map +1 -0
- package/out/concepts/Module__.d.ts +20 -9
- package/out/concepts/Module__.js +72 -14
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +1 -1
- package/out/concepts/NewComposite__.js +25 -11
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +1 -1
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -0
- package/out/concepts/Param__.js +5 -0
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +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.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +104 -16
- package/out/concepts/QuerySelectExpression__.js +99 -9
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +2 -2
- 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 +8 -3
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +26 -6
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -1
- package/out/concepts/View__.js +3 -1
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +15 -0
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +94 -0
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +3 -0
- package/out/concepts/index__.js +3 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/config.d.ts +1 -1
- package/out/decorators/index.d.ts +2 -2
- package/out/generator/genBundleFiles.js +20 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +2 -2
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/icestark.d.ts +2 -0
- package/out/generator/icestark.js +48 -0
- package/out/generator/icestark.js.map +1 -0
- package/out/generator/microApp.d.ts +2 -0
- package/out/generator/microApp.js +35 -0
- package/out/generator/microApp.js.map +1 -0
- package/out/generator/permission.d.ts +1 -1
- package/out/generator/permission.js +0 -13
- package/out/generator/permission.js.map +1 -1
- package/out/generator/qiankun.d.ts +2 -0
- package/out/generator/qiankun.js +52 -0
- package/out/generator/qiankun.js.map +1 -0
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/manager/stepRecorder.d.ts +20 -0
- package/out/manager/stepRecorder.js +110 -0
- package/out/manager/stepRecorder.js.map +1 -0
- package/out/sentry/index.d.ts +5 -4
- package/out/sentry/index.js +9 -2
- package/out/sentry/index.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +1 -1
- package/out/server/formatTsUtils.js +40 -14
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.js +38 -6
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +5 -4
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +3 -3
- package/out/server/getScope.d.ts +1 -1
- package/out/server/naslServer.d.ts +7 -3
- package/out/server/naslServer.js +270 -102
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +25 -7
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +3 -3
- package/out/service/storage/init.js +6 -0
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -1
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +20 -6
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genUpdateBlock.js +7 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +16 -0
- package/out/templator/utils.js +2 -0
- package/out/templator/utils.js.map +1 -1
- package/out/translator/index.d.ts +1 -1
- package/out/translator/lsp.d.ts +3 -3
- package/out/utils/index.d.ts +4 -4
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.ui.ts +16 -11
- package/sandbox/stdlib/nasl.util.ts +4 -0
- package/sandbox/stdlib/nasl.validation.ts +2 -2
- package/src/automate/upgrader/2.17.js +1 -1
- package/src/common/BaseNode.ts +10 -2
- package/src/concepts/App__.ts +90 -46
- package/src/concepts/CallInterface__.ts +9 -1
- package/src/concepts/CallLogic__.ts +2 -1
- package/src/concepts/CallQueryComponent__.ts +73 -82
- package/src/concepts/ConfigProperty__.ts +18 -1
- package/src/concepts/Destination__.ts +2 -20
- package/src/concepts/EntityProperty__.ts +102 -8
- package/src/concepts/Entity__.ts +31 -8
- package/src/concepts/Identifier__.ts +9 -2
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/Integration__.ts +162 -0
- package/src/concepts/JavaLogic__.ts +129 -0
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +12 -45
- package/src/concepts/Match__.ts +10 -5
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/MicroApp__.ts +118 -0
- package/src/concepts/Module__.ts +106 -79
- package/src/concepts/NewComposite__.ts +23 -11
- package/src/concepts/OqlQueryComponent__.ts +1 -1
- package/src/concepts/Param__.ts +3 -0
- package/src/concepts/QueryFieldExpression__.ts +0 -7
- package/src/concepts/QuerySelectExpression__.ts +206 -30
- package/src/concepts/SwitchCase__.ts +2 -2
- package/src/concepts/TypeAnnotation__.ts +8 -42
- package/src/concepts/ViewElement__.ts +24 -6
- package/src/concepts/View__.ts +3 -24
- package/src/concepts/basics/stdlib/nasl.ui.ts +15 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +94 -0
- package/src/concepts/index__.ts +3 -0
- package/src/generator/genBundleFiles.ts +22 -4
- package/src/generator/genReleaseBody.ts +2 -2
- package/src/generator/icestark.ts +45 -0
- package/src/generator/microApp.ts +32 -0
- package/src/generator/permission.ts +1 -15
- package/src/generator/qiankun.ts +49 -0
- package/src/index.ts +1 -0
- package/src/manager/stepRecorder.ts +112 -0
- package/src/sentry/index.ts +8 -2
- package/src/server/formatTsUtils.ts +42 -14
- package/src/server/getLogics.ts +41 -6
- package/src/server/getMemberIdentifier.ts +5 -4
- package/src/server/naslServer.ts +270 -101
- package/src/server/translator.ts +25 -7
- package/src/service/storage/init.ts +7 -0
- package/src/templator/genCreateBlock.ts +6 -1
- package/src/templator/genQueryComponent.ts +22 -8
- package/src/templator/genUpdateBlock.ts +7 -1
- package/src/templator/utils.ts +2 -0
- package/ts-worker/src/index.js +1 -4
- package/src/manager/history.ts +0 -0
- package/src/manager/problem.ts +0 -0
package/src/concepts/Logic__.ts
CHANGED
|
@@ -249,7 +249,7 @@ export class Logic extends BaseNode {
|
|
|
249
249
|
});
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
|
|
252
|
+
getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
|
|
253
253
|
const excludedSet = new Set(excludedList);
|
|
254
254
|
return ((this.typeParams as TypeParam[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
255
255
|
}
|
|
@@ -390,7 +390,6 @@ export class Logic extends BaseNode {
|
|
|
390
390
|
return node;
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
|
|
394
393
|
getParamUniqueName(name = 'param1') {
|
|
395
394
|
return utils.unique(name, this.getVarExistingNames(), undefined, false);
|
|
396
395
|
}
|
|
@@ -528,7 +527,6 @@ export class Logic extends BaseNode {
|
|
|
528
527
|
return node;
|
|
529
528
|
}
|
|
530
529
|
|
|
531
|
-
|
|
532
530
|
getReturnUniqueName(name = 'result') {
|
|
533
531
|
return utils.unique(name, this.getVarExistingNames(), undefined, false);
|
|
534
532
|
}
|
|
@@ -666,7 +664,6 @@ export class Logic extends BaseNode {
|
|
|
666
664
|
return node;
|
|
667
665
|
}
|
|
668
666
|
|
|
669
|
-
|
|
670
667
|
getVariableUniqueName(name = 'variable1') {
|
|
671
668
|
return utils.unique(name, this.getVarExistingNames(), undefined, false);
|
|
672
669
|
}
|
|
@@ -804,11 +801,6 @@ export class Logic extends BaseNode {
|
|
|
804
801
|
return node;
|
|
805
802
|
}
|
|
806
803
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
804
|
/**
|
|
813
805
|
* 插入逻辑项
|
|
814
806
|
* @internal
|
|
@@ -841,8 +833,6 @@ export class Logic extends BaseNode {
|
|
|
841
833
|
return logicItem;
|
|
842
834
|
}
|
|
843
835
|
|
|
844
|
-
|
|
845
|
-
|
|
846
836
|
/**
|
|
847
837
|
* 插入逻辑项
|
|
848
838
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -865,8 +855,6 @@ export class Logic extends BaseNode {
|
|
|
865
855
|
return node;
|
|
866
856
|
}
|
|
867
857
|
|
|
868
|
-
|
|
869
|
-
|
|
870
858
|
/**
|
|
871
859
|
* 添加逻辑项
|
|
872
860
|
* @internal
|
|
@@ -886,8 +874,6 @@ export class Logic extends BaseNode {
|
|
|
886
874
|
return this._insertItemInBodyAt(options as any, index);
|
|
887
875
|
}
|
|
888
876
|
|
|
889
|
-
|
|
890
|
-
|
|
891
877
|
/**
|
|
892
878
|
* 添加逻辑项
|
|
893
879
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -911,8 +897,6 @@ export class Logic extends BaseNode {
|
|
|
911
897
|
return node;
|
|
912
898
|
}
|
|
913
899
|
|
|
914
|
-
|
|
915
|
-
|
|
916
900
|
/**
|
|
917
901
|
* 插入逻辑项
|
|
918
902
|
* @internal
|
|
@@ -945,8 +929,6 @@ export class Logic extends BaseNode {
|
|
|
945
929
|
return logicItem;
|
|
946
930
|
}
|
|
947
931
|
|
|
948
|
-
|
|
949
|
-
|
|
950
932
|
/**
|
|
951
933
|
* 插入逻辑项
|
|
952
934
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -969,8 +951,6 @@ export class Logic extends BaseNode {
|
|
|
969
951
|
return node;
|
|
970
952
|
}
|
|
971
953
|
|
|
972
|
-
|
|
973
|
-
|
|
974
954
|
/**
|
|
975
955
|
* 添加逻辑项
|
|
976
956
|
* @internal
|
|
@@ -990,8 +970,6 @@ export class Logic extends BaseNode {
|
|
|
990
970
|
return this._insertItemInPlaygroundAt(options as any, index);
|
|
991
971
|
}
|
|
992
972
|
|
|
993
|
-
|
|
994
|
-
|
|
995
973
|
/**
|
|
996
974
|
* 添加逻辑项
|
|
997
975
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -1015,9 +993,6 @@ export class Logic extends BaseNode {
|
|
|
1015
993
|
return node;
|
|
1016
994
|
}
|
|
1017
995
|
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
996
|
/**
|
|
1022
997
|
* 删除事务
|
|
1023
998
|
* @param name 事务名称
|
|
@@ -1066,8 +1041,6 @@ export class Logic extends BaseNode {
|
|
|
1066
1041
|
return params;
|
|
1067
1042
|
}
|
|
1068
1043
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
1044
|
/**
|
|
1072
1045
|
* 删除类型参数
|
|
1073
1046
|
* @param name 类型参数名称
|
|
@@ -1116,8 +1089,6 @@ export class Logic extends BaseNode {
|
|
|
1116
1089
|
return params;
|
|
1117
1090
|
}
|
|
1118
1091
|
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
1092
|
/**
|
|
1122
1093
|
* 删除输入参数
|
|
1123
1094
|
* @param name 输入参数名称
|
|
@@ -1166,8 +1137,6 @@ export class Logic extends BaseNode {
|
|
|
1166
1137
|
return params;
|
|
1167
1138
|
}
|
|
1168
1139
|
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
1140
|
/**
|
|
1172
1141
|
* 删除输出参数
|
|
1173
1142
|
* @param name 输出参数名称
|
|
@@ -1216,8 +1185,6 @@ export class Logic extends BaseNode {
|
|
|
1216
1185
|
return params;
|
|
1217
1186
|
}
|
|
1218
1187
|
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
1188
|
/**
|
|
1222
1189
|
* 删除变量
|
|
1223
1190
|
* @param name 变量名称
|
|
@@ -1266,8 +1233,6 @@ export class Logic extends BaseNode {
|
|
|
1266
1233
|
return params;
|
|
1267
1234
|
}
|
|
1268
1235
|
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
1236
|
/**
|
|
1272
1237
|
* 删除逻辑项
|
|
1273
1238
|
* @param logicItem 已有的逻辑项实例
|
|
@@ -1275,12 +1240,10 @@ export class Logic extends BaseNode {
|
|
|
1275
1240
|
removeItemInBody(logicItem: LogicItem): void;
|
|
1276
1241
|
|
|
1277
1242
|
removeItemInBody(options: LogicItem) {
|
|
1278
|
-
|
|
1243
|
+
const logicItem: LogicItem = options;
|
|
1279
1244
|
return logicItem.delete();
|
|
1280
1245
|
}
|
|
1281
1246
|
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
1247
|
/**
|
|
1285
1248
|
* 删除逻辑项
|
|
1286
1249
|
* @param logicItem 已有的逻辑项实例
|
|
@@ -1288,7 +1251,7 @@ export class Logic extends BaseNode {
|
|
|
1288
1251
|
removeItemInPlayground(logicItem: LogicItem): void;
|
|
1289
1252
|
|
|
1290
1253
|
removeItemInPlayground(options: LogicItem) {
|
|
1291
|
-
|
|
1254
|
+
const logicItem: LogicItem = options;
|
|
1292
1255
|
return logicItem.delete();
|
|
1293
1256
|
}
|
|
1294
1257
|
|
|
@@ -1477,7 +1440,7 @@ export class Logic extends BaseNode {
|
|
|
1477
1440
|
const logicName = this.name;
|
|
1478
1441
|
let serviceType = 'micro';
|
|
1479
1442
|
let method = 'POST';
|
|
1480
|
-
let path = `/api/${logicName}`;
|
|
1443
|
+
let path = `/api/lcplogics/${logicName}`;
|
|
1481
1444
|
if (concept === 'Module') {
|
|
1482
1445
|
path = `/api/${entityName.replace('-', '_')}/${logicName}`;
|
|
1483
1446
|
} else if (concept === 'Namespace') {
|
|
@@ -1740,7 +1703,7 @@ export class Logic extends BaseNode {
|
|
|
1740
1703
|
if (leftCode === node.name) {
|
|
1741
1704
|
const rightNode: any = rightIndex.length === 1 ? assignment.rights[rightIndex[0]]?.expression : assignment.rights[rightIndex[0]]?.members[rightIndex[1]];
|
|
1742
1705
|
// 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
|
|
1743
|
-
if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && rightNode.
|
|
1706
|
+
if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && !rightNode.isAutoInfer())) {
|
|
1744
1707
|
code += ': ';
|
|
1745
1708
|
code += rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) || 'null';
|
|
1746
1709
|
} else {
|
|
@@ -1761,7 +1724,7 @@ export class Logic extends BaseNode {
|
|
|
1761
1724
|
} else {
|
|
1762
1725
|
const rightNode: any = assignment.right;
|
|
1763
1726
|
// 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
|
|
1764
|
-
if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && rightNode.
|
|
1727
|
+
if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && !rightNode.isAutoInfer())) {
|
|
1765
1728
|
code += ': ';
|
|
1766
1729
|
code += rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) || 'null';
|
|
1767
1730
|
} else {
|
|
@@ -1783,8 +1746,12 @@ export class Logic extends BaseNode {
|
|
|
1783
1746
|
} else {
|
|
1784
1747
|
// 如果长度小于2 并且不是虚拟节点就 加 报错,
|
|
1785
1748
|
if (this.body.length <= 2 && !(this.parentNode instanceof Namespace)) {
|
|
1786
|
-
|
|
1787
|
-
|
|
1749
|
+
if (this.body.length && this.body[0].concept === 'JavaLogic') {
|
|
1750
|
+
code += '';
|
|
1751
|
+
} else {
|
|
1752
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
1753
|
+
code += 'const __LogicEmpty: any = null;';
|
|
1754
|
+
}
|
|
1788
1755
|
}
|
|
1789
1756
|
this.body.forEach((item) => {
|
|
1790
1757
|
code += item.toEmbeddedTS && item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
package/src/concepts/Match__.ts
CHANGED
|
@@ -615,17 +615,21 @@ export class Match extends LogicItem {
|
|
|
615
615
|
let code = '';
|
|
616
616
|
// 祖先逻辑
|
|
617
617
|
const ancestorLogic = this.getAncestor('Logic');
|
|
618
|
-
if (ancestorLogic) {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
618
|
+
if (this.isExpression || !ancestorLogic) {
|
|
619
|
+
if (ancestorLogic) {
|
|
620
|
+
code += 'await (async () => {\n';
|
|
621
|
+
} else {
|
|
622
|
+
code += '(() => {\n';
|
|
623
|
+
}
|
|
622
624
|
}
|
|
623
625
|
if (this.expression && Array.isArray(this.cases)) {
|
|
624
626
|
this.cases.forEach((item, index) => {
|
|
625
627
|
code += item?.toJS?.(this.expression, index, this.cases.length);
|
|
626
628
|
});
|
|
627
629
|
}
|
|
628
|
-
|
|
630
|
+
if (this.isExpression || !ancestorLogic) {
|
|
631
|
+
code += '})()';
|
|
632
|
+
}
|
|
629
633
|
return code;
|
|
630
634
|
}
|
|
631
635
|
|
|
@@ -674,6 +678,7 @@ export class Match extends LogicItem {
|
|
|
674
678
|
&& this.parentNode.concept !== 'Assignment'
|
|
675
679
|
&& this.parentNode.concept !== 'ForEachStatement'
|
|
676
680
|
&& this.parentNode.concept !== 'SelectMembers'
|
|
681
|
+
&& this.parentNode.concept !== 'UnaryExpression'
|
|
677
682
|
&& this.parentNode.concept !== 'BinaryExpression'
|
|
678
683
|
&& this.parentNode.concept !== 'StringInterpolation'
|
|
679
684
|
&& this.parentNode.concept !== 'MemberExpression'
|
|
@@ -348,7 +348,7 @@ export class MemberExpression extends LogicItem {
|
|
|
348
348
|
}
|
|
349
349
|
firstMemberExpressionNode() {
|
|
350
350
|
let tempNode: any = this;
|
|
351
|
-
while (tempNode.parentNode
|
|
351
|
+
while (tempNode.parentNode?.concept === 'MemberExpression') {
|
|
352
352
|
tempNode = tempNode.parentNode;
|
|
353
353
|
}
|
|
354
354
|
return tempNode;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
//================================================================================
|
|
2
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
4
|
+
//================================================================================
|
|
5
|
+
import { EventPayload, Params } from '../common/EventEmitter';
|
|
6
|
+
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
|
+
|
|
8
|
+
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import BaseNode from '../common/BaseNode';
|
|
11
|
+
import classMap from '../common/classMap';
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 微应用
|
|
16
|
+
*/
|
|
17
|
+
@concept('微应用')
|
|
18
|
+
export class MicroApp extends BaseNode {
|
|
19
|
+
/**
|
|
20
|
+
* 产品概念
|
|
21
|
+
*/
|
|
22
|
+
@property()
|
|
23
|
+
concept: 'MicroApp' = 'MicroApp';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 微前端框架
|
|
27
|
+
*/
|
|
28
|
+
@property()
|
|
29
|
+
framework: 'qiankun' | 'icestark' = undefined;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 微应用名称
|
|
33
|
+
*/
|
|
34
|
+
@property()
|
|
35
|
+
name: string = undefined;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 页面路径前缀
|
|
39
|
+
*/
|
|
40
|
+
@property()
|
|
41
|
+
routePrefix: string = undefined;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 接口和静态资源前缀
|
|
45
|
+
*/
|
|
46
|
+
@property()
|
|
47
|
+
proxyPrefix: string = undefined;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 登录页面地址
|
|
51
|
+
*/
|
|
52
|
+
@property()
|
|
53
|
+
loginUrl: string = undefined;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 无权限页面地址
|
|
57
|
+
*/
|
|
58
|
+
@property()
|
|
59
|
+
noAuthUrl: string = undefined;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 404页面地址
|
|
63
|
+
*/
|
|
64
|
+
@property()
|
|
65
|
+
notFoundUrl: string = undefined;
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param source 需要合并的部分参数
|
|
71
|
+
*/
|
|
72
|
+
constructor(source?: Partial<MicroApp>) {
|
|
73
|
+
source = Object.assign({}, MicroApp.getDefaultOptions(), source);
|
|
74
|
+
super(source);
|
|
75
|
+
super.subConstructor(source);
|
|
76
|
+
}
|
|
77
|
+
getClassName() {
|
|
78
|
+
return 'MicroApp';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
static from(source: any, parentNode?: any, parentKey?: string): MicroApp {
|
|
82
|
+
return super.from(source, parentNode, parentKey) as MicroApp;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 从父级删除该节点
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
_delete() {
|
|
90
|
+
let params: Params = null;
|
|
91
|
+
if (this.parentNode) {
|
|
92
|
+
params = (this.parentNode as any)?.__removeMicroApp?.(this);
|
|
93
|
+
}
|
|
94
|
+
return params;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
//================================================================================
|
|
103
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
104
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
105
|
+
//================================================================================
|
|
106
|
+
|
|
107
|
+
//================================================================================
|
|
108
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
109
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
110
|
+
//================================================================================
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
classMap.MicroApp = MicroApp;
|
|
114
|
+
export default MicroApp;
|
|
115
|
+
//================================================================================
|
|
116
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
117
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
118
|
+
//================================================================================
|