@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genTableBlock.js","sourceRoot":"","sources":["../../src/templator/genTableBlock.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAElC,
|
|
1
|
+
{"version":3,"file":"genTableBlock.js","sourceRoot":"","sources":["../../src/templator/genTableBlock.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAElC,wBASW;AACX,mCAAkJ;AAElJ;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,QAAwB,EAAE,cAAsB,SAAS;IAC5F,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IAE/B,MAAM,UAAU,GAAG,MAAM,CAAC,UAAwB,CAAC;IACnD,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1D,IAAI,eAAe,GAAG,GAAG,WAAW,SAAS,eAAe,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChF,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC;IAE9C,IAAI,QAAQ,CAAC,cAAc,EAAE;QACzB,MAAM,uBAAuB,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAC9E,MAAM,cAAc,GAAG,UAAU,EAAE,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E,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/E,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAE5B,OAAO;;yBAEc,SAAS,CAAC,mBAAmB,mBAAmB,SAAS,CAAC,aAAa,4EAA4E,SAAS,CAAC,SAAS;UACrL,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;;;;;;UAM9E,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;;;gBAGlE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;;;CAGxC,CAAC;AACF,CAAC;AAhDD,kDAgDC;AAED,kBAAe,aAAa,CAAC"}
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -4,7 +4,7 @@ declare namespace nasl.auth {
|
|
|
4
4
|
export function logout(): Promise<void>;
|
|
5
5
|
export function encryptByAES(authPath: nasl.core.String): nasl.core.String;
|
|
6
6
|
export function decryptByAES(authPath: nasl.core.String): nasl.core.String;
|
|
7
|
-
export function
|
|
7
|
+
export function getUserList(userNameFilter: nasl.core.String, limit: nasl.core.Long, offset: nasl.core.Long): nasl.collection.List<nasl.core.Any>;
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
export class LCAPCurrentUserInfo {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare namespace nasl.logging {
|
|
2
|
-
export function INFO<T>(log: nasl.core.
|
|
3
|
-
export function DEBUG<T>(log: nasl.core.
|
|
4
|
-
export function WARN<T>(log: nasl.core.
|
|
5
|
-
export function ERROR<T>(log: nasl.core.
|
|
2
|
+
export function INFO<T>(log: nasl.core.Any, ..._arg: any[]): T;
|
|
3
|
+
export function DEBUG<T>(log: nasl.core.Any, ..._arg: any[]): T;
|
|
4
|
+
export function WARN<T>(log: nasl.core.Any, ..._arg: any[]): T;
|
|
5
|
+
export function ERROR<T>(log: nasl.core.Any, ..._arg: any[]): T;
|
|
6
6
|
}
|
|
@@ -13,6 +13,8 @@ declare namespace nasl.util {
|
|
|
13
13
|
export function Convert(value: nasl.core.Boolean): <T extends nasl.core.String | nasl.core.Integer | nasl.core.Decimal>() => T;
|
|
14
14
|
export function Convert(value: nasl.core.Any): <T extends nasl.core.String>() => T;
|
|
15
15
|
|
|
16
|
+
export function ToString<T extends nasl.core.Any>(value: T): nasl.core.String;
|
|
17
|
+
export function FromString(value: nasl.core.String): <T extends nasl.core.Decimal | nasl.core.Date | nasl.core.Time | nasl.core.DateTime | nasl.core.Double | nasl.core.Integer | nasl.core.Long | nasl.core.Boolean>() => T;
|
|
16
18
|
export function EnumToList<T extends nasl.core.Enums>(): nasl.collection.List<{ text: nasl.core.String, value: nasl.core.String }>;
|
|
17
19
|
export function EnumValueToText<T extends nasl.core.Enums>(value: nasl.core.Enums): nasl.core.String;
|
|
18
20
|
export function StringToEnumValue<T extends nasl.core.Enums>(value: nasl.core.String): T;
|
|
@@ -44,9 +46,9 @@ declare namespace nasl.util {
|
|
|
44
46
|
export function ListHead<T>(list: nasl.collection.List<T>): T;
|
|
45
47
|
export function ListLast<T>(list: nasl.collection.List<T>): T;
|
|
46
48
|
export function ListFlatten<T>(list: nasl.collection.List<nasl.collection.List<T>>): nasl.collection.List<T>;
|
|
47
|
-
export function ListTransform<T0, T>(list: nasl.collection.List<T0>, by
|
|
48
|
-
export function ListToMap<T, K extends nasl.core.Boolean | nasl.core.Integer | nasl.core.Long | nasl.core.Decimal | nasl.core.String, V>(map: nasl.collection.List<T>, byKey: (elem
|
|
49
|
-
export function ListGroupBy<A, K extends nasl.core.Boolean | nasl.core.Integer | nasl.core.Long | nasl.core.Decimal | nasl.core.String>(list: nasl.collection.List<A>, by
|
|
49
|
+
export function ListTransform<T0, T>(list: nasl.collection.List<T0>, by: (elem: T0) => T): nasl.collection.List<T>;
|
|
50
|
+
export function ListToMap<T, K extends nasl.core.Boolean | nasl.core.Integer | nasl.core.Long | nasl.core.Decimal | nasl.core.String, V>(map: nasl.collection.List<T>, byKey: (elem: T) => K, byVal: (elem: T) => V): nasl.collection.Map<K, V>;
|
|
51
|
+
export function ListGroupBy<A, K extends nasl.core.Boolean | nasl.core.Integer | nasl.core.Long | nasl.core.Decimal | nasl.core.String>(list: nasl.collection.List<A>, by: (elem: A) => K): nasl.collection.Map<K, nasl.collection.List<A>>;
|
|
50
52
|
|
|
51
53
|
export function ListSum<T extends nasl.core.Integer | nasl.core.Long | nasl.core.Double | nasl.core.Decimal>(list: nasl.collection.List<T>): T;
|
|
52
54
|
export function ListProduct<T extends nasl.core.Integer | nasl.core.Long | nasl.core.Double | nasl.core.Decimal>(list: nasl.collection.List<T>): T;
|
|
@@ -93,6 +95,13 @@ declare namespace nasl.util {
|
|
|
93
95
|
export function Clear<T>(struct: T): T;
|
|
94
96
|
export function RandomInt(start: nasl.core.Integer, end: nasl.core.Integer): nasl.core.Integer;
|
|
95
97
|
export function New<T>(): T;
|
|
98
|
+
export function NewList<T>(...args: T[]): nasl.collection.List<T>;
|
|
99
|
+
export function NewMap<K extends nasl.core.String, T>(key: K, ...args: T[]): nasl.collection.Map<K, T>;
|
|
100
|
+
export function NewMap<K extends nasl.core.Integer, T>(key: K, ...args: T[]): nasl.collection.Map<K, T>;
|
|
101
|
+
export function NewMap<K extends nasl.core.Boolean, T>(key: K, ...args: T[]): nasl.collection.Map<K, T>;
|
|
102
|
+
export function NewMap<K extends nasl.core.Long, T>(key: K, ...args: T[]): nasl.collection.Map<K, T>;
|
|
103
|
+
export function NewMap<K extends nasl.core.Decimal, T>(key: K, ...args: T[]): nasl.collection.Map<K, T>;
|
|
104
|
+
export function NewMap<K extends nasl.core.None, T>(key: K, ...args: T[]): nasl.collection.Map<K, T>;
|
|
96
105
|
|
|
97
106
|
export function CreateListPage<T>(list: nasl.collection.List<T>, total: nasl.core.Integer): { list: nasl.collection.List<T>, total: nasl.core.Integer };
|
|
98
107
|
|
|
@@ -101,7 +110,7 @@ declare namespace nasl.util {
|
|
|
101
110
|
export function jsonDeserialize<T>(arg: nasl.core.String): T;
|
|
102
111
|
|
|
103
112
|
export function concatString(...args: nasl.core.String[]): any;
|
|
104
|
-
export function stringInterpolation(...args:
|
|
113
|
+
export function stringInterpolation(...args: nasl.core.Any[]): nasl.core.String;
|
|
105
114
|
}
|
|
106
115
|
|
|
107
116
|
|
|
@@ -10009,7 +10009,7 @@ export const processComponent = (function () {
|
|
|
10009
10009
|
_set(t_CallLogic_unknown_1178, "label", "调用逻辑");
|
|
10010
10010
|
_set(t_CallLogic_unknown_1178, "folded", false);
|
|
10011
10011
|
_set(t_CallLogic_unknown_1178, "calleeNamespace", "nasl.auth");
|
|
10012
|
-
_set(t_CallLogic_unknown_1178, "calleeName", "
|
|
10012
|
+
_set(t_CallLogic_unknown_1178, "calleeName", "getUserList");
|
|
10013
10013
|
_set(t_CallLogic_unknown_1178, "typeArguments", null);
|
|
10014
10014
|
_push(t_CallLogic_unknown_1178, "arguments", t_Argument_unknown_1179);
|
|
10015
10015
|
_push(t_CallLogic_unknown_1178, "arguments", t_Argument_unknown_1183);
|
package/src/bak/translator.js
CHANGED
|
@@ -45,7 +45,10 @@ export default function (definition) {
|
|
|
45
45
|
viewVariables.forEach((viewVariable) => {
|
|
46
46
|
dataMap[viewVariable.code || viewVariable.name] = true;
|
|
47
47
|
const typeAnnotation = viewVariable.typeAnnotation || viewVariable.__TypeAnnotation;
|
|
48
|
-
const needGenInitFromSchema = typeAnnotation &&
|
|
48
|
+
const needGenInitFromSchema = typeAnnotation && (
|
|
49
|
+
!['primitive', 'union'].includes(typeAnnotation.typeKind)
|
|
50
|
+
|| typeAnnotation.typeName === 'DateTime'
|
|
51
|
+
);
|
|
49
52
|
let code = `${safeCodeAsKey(viewVariable.name)}:`;
|
|
50
53
|
if (needGenInitFromSchema) {
|
|
51
54
|
code += `this.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}', `;
|
package/src/common/Command.ts
CHANGED
|
@@ -2,6 +2,10 @@ import Namespace from './Namespace__';
|
|
|
2
2
|
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
import ForEachStatement from './ForEachStatement__';
|
|
5
|
+
import NewList from './NewList__';
|
|
6
|
+
import CallLogic from './CallLogic__';
|
|
7
|
+
import MemberExpression from './MemberExpression__';
|
|
8
|
+
import Entity from './Entity__';
|
|
5
9
|
//================================================================================
|
|
6
10
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
7
11
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -412,6 +416,12 @@ export class AnonymousFunction extends BaseNode {
|
|
|
412
416
|
//================================================================================
|
|
413
417
|
|
|
414
418
|
toJS(state?: TranslatorState): String {
|
|
419
|
+
const grandParent = this.parentNode?.parentNode;
|
|
420
|
+
if(grandParent instanceof CallLogic
|
|
421
|
+
&& /dataSources\.[^.]+\.entities\.[^.]+\.logics/.test(grandParent.calleeNamespace)
|
|
422
|
+
&& ['update', 'updateBy', 'createOrUpdate', 'batchUpdate'].includes(grandParent.calleeName))
|
|
423
|
+
return this.toJSOfEntityLogicProperties(state);
|
|
424
|
+
|
|
415
425
|
let code = '';
|
|
416
426
|
code += '(';
|
|
417
427
|
this.params.forEach((param, index) => {
|
|
@@ -429,6 +439,18 @@ export class AnonymousFunction extends BaseNode {
|
|
|
429
439
|
return code;
|
|
430
440
|
}
|
|
431
441
|
|
|
442
|
+
toJSOfEntityLogicProperties(state?: TranslatorState): String {
|
|
443
|
+
let code = '[';
|
|
444
|
+
if (this.body && this.body instanceof NewList) {
|
|
445
|
+
this.body.items.forEach((item: MemberExpression, index, array) => {
|
|
446
|
+
code += `'${item.property.toJS(shiftState(state, code))}'`;
|
|
447
|
+
if(index !== array.length-1) code += ',';
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
code += ']';
|
|
451
|
+
return code;
|
|
452
|
+
}
|
|
453
|
+
|
|
432
454
|
getVarExistingNames(excludedList: Array<Param> = []) {
|
|
433
455
|
const excludedSet = new Set(excludedList);
|
|
434
456
|
return [...this.params].filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -445,6 +467,24 @@ export class AnonymousFunction extends BaseNode {
|
|
|
445
467
|
}
|
|
446
468
|
@withSourceMap()
|
|
447
469
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
470
|
+
let updateNoPropertyCode = '';
|
|
471
|
+
const grandParent = this.parentNode?.parentNode;
|
|
472
|
+
if(grandParent instanceof CallLogic
|
|
473
|
+
&& /dataSources\.[^.]+\.entities\.[^.]+\.logics/.test(grandParent.calleeNamespace)
|
|
474
|
+
&& ['update', 'updateBy', 'createOrUpdate', 'batchUpdate'].includes(grandParent.calleeName)) {
|
|
475
|
+
const logicNode = grandParent.getCallNode();
|
|
476
|
+
const entity = logicNode.upperNode.upperNode as Entity;
|
|
477
|
+
const primaryKeys = entity.properties.filter((item) => item.primaryKey);
|
|
478
|
+
|
|
479
|
+
const propertyArg = grandParent.arguments.find((item) => item.keyword === 'properties');
|
|
480
|
+
const expression = propertyArg?.expression as unknown as AnonymousFunction;
|
|
481
|
+
const newList = expression?.body as NewList;
|
|
482
|
+
const newListItems = newList?.items;
|
|
483
|
+
|
|
484
|
+
if(primaryKeys.length === newListItems?.length)
|
|
485
|
+
updateNoPropertyCode = 'const __UpdateNoProperty__: any = null;\n';
|
|
486
|
+
}
|
|
487
|
+
|
|
448
488
|
let code = '';
|
|
449
489
|
if (this.body) {
|
|
450
490
|
code += `(`;
|
|
@@ -454,12 +494,18 @@ export class AnonymousFunction extends BaseNode {
|
|
|
454
494
|
code += ', ';
|
|
455
495
|
});
|
|
456
496
|
code += `)`;
|
|
457
|
-
code += ` =>
|
|
497
|
+
code += ` => {\n`;
|
|
498
|
+
|
|
499
|
+
if(updateNoPropertyCode)
|
|
500
|
+
code += updateNoPropertyCode;
|
|
458
501
|
|
|
502
|
+
code += `return `;
|
|
503
|
+
|
|
459
504
|
if (this.body) {
|
|
460
505
|
code += this.body.toEmbeddedTS && this.body.toEmbeddedTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
461
506
|
}
|
|
462
|
-
code +=
|
|
507
|
+
code += ';'
|
|
508
|
+
code += indent(state.tabSize) + '}';
|
|
463
509
|
} else {
|
|
464
510
|
code += '__IDENTIFIER__';
|
|
465
511
|
}
|
package/src/concepts/App__.ts
CHANGED
|
@@ -3,10 +3,20 @@ export interface AssetsInfo {
|
|
|
3
3
|
css: Array<string>;
|
|
4
4
|
names?: Array<string>;
|
|
5
5
|
}
|
|
6
|
+
|
|
6
7
|
import { queryNodeByPath } from '../service/storage/jsoner';
|
|
7
8
|
import { getNaslNodeByNodeCallee, getNodeByNodeCallee } from '../automate/engine/utils';
|
|
8
9
|
import ConfigProperty from './ConfigProperty__';
|
|
9
10
|
import TypeAnnotation from './TypeAnnotation__';
|
|
11
|
+
interface MessageData {
|
|
12
|
+
logicName: string
|
|
13
|
+
param?: string
|
|
14
|
+
interfaceName?: string
|
|
15
|
+
message:string
|
|
16
|
+
type: number
|
|
17
|
+
resultName?:string,
|
|
18
|
+
}
|
|
19
|
+
// import CallLogic from './CallLogic__';
|
|
10
20
|
//================================================================================
|
|
11
21
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
12
22
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -198,8 +208,6 @@ export class App extends BaseNode {
|
|
|
198
208
|
@property('Module')
|
|
199
209
|
componentDependencies: Array<Module> = [];
|
|
200
210
|
|
|
201
|
-
|
|
202
|
-
|
|
203
211
|
/**
|
|
204
212
|
* @param source 需要合并的部分参数
|
|
205
213
|
*/
|
|
@@ -248,7 +256,7 @@ export class App extends BaseNode {
|
|
|
248
256
|
});
|
|
249
257
|
}
|
|
250
258
|
|
|
251
|
-
|
|
259
|
+
getDataSourceUniqueName(name = 'dataSource1') {
|
|
252
260
|
return utils.unique(name, this.getDataSourceExistingNames(), undefined, true);
|
|
253
261
|
}
|
|
254
262
|
|
|
@@ -385,7 +393,6 @@ export class App extends BaseNode {
|
|
|
385
393
|
return node;
|
|
386
394
|
}
|
|
387
395
|
|
|
388
|
-
|
|
389
396
|
getStructureExistingNames(excludedList: Array<Structure> = []) {
|
|
390
397
|
const excludedSet = new Set(excludedList);
|
|
391
398
|
return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -527,7 +534,6 @@ export class App extends BaseNode {
|
|
|
527
534
|
return node;
|
|
528
535
|
}
|
|
529
536
|
|
|
530
|
-
|
|
531
537
|
getEnumExistingNames(excludedList: Array<Enum> = []) {
|
|
532
538
|
const excludedSet = new Set(excludedList);
|
|
533
539
|
return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -669,7 +675,6 @@ export class App extends BaseNode {
|
|
|
669
675
|
return node;
|
|
670
676
|
}
|
|
671
677
|
|
|
672
|
-
|
|
673
678
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
674
679
|
const excludedSet = new Set(excludedList);
|
|
675
680
|
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -811,7 +816,6 @@ export class App extends BaseNode {
|
|
|
811
816
|
return node;
|
|
812
817
|
}
|
|
813
818
|
|
|
814
|
-
|
|
815
819
|
getInterfaceExistingNames(excludedList: Array<Interface> = []) {
|
|
816
820
|
const excludedSet = new Set(excludedList);
|
|
817
821
|
return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -953,7 +957,6 @@ export class App extends BaseNode {
|
|
|
953
957
|
return node;
|
|
954
958
|
}
|
|
955
959
|
|
|
956
|
-
|
|
957
960
|
getViewExistingNames(excludedList: Array<View> = []) {
|
|
958
961
|
const excludedSet = new Set(excludedList);
|
|
959
962
|
return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1095,7 +1098,6 @@ export class App extends BaseNode {
|
|
|
1095
1098
|
return node;
|
|
1096
1099
|
}
|
|
1097
1100
|
|
|
1098
|
-
|
|
1099
1101
|
getVarExistingNames(excludedList: Array<Variable> = []) {
|
|
1100
1102
|
const excludedSet = new Set(excludedList);
|
|
1101
1103
|
return ((this.frontendVariables as Variable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1237,7 +1239,6 @@ export class App extends BaseNode {
|
|
|
1237
1239
|
return node;
|
|
1238
1240
|
}
|
|
1239
1241
|
|
|
1240
|
-
|
|
1241
1242
|
getProcessExistingNames(excludedList: Array<Process> = []) {
|
|
1242
1243
|
const excludedSet = new Set(excludedList);
|
|
1243
1244
|
return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1379,7 +1380,6 @@ export class App extends BaseNode {
|
|
|
1379
1380
|
return node;
|
|
1380
1381
|
}
|
|
1381
1382
|
|
|
1382
|
-
|
|
1383
1383
|
getRoleExistingNames(excludedList: Array<Role> = []) {
|
|
1384
1384
|
const excludedSet = new Set(excludedList);
|
|
1385
1385
|
return ((this.roles as Role[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1521,7 +1521,6 @@ export class App extends BaseNode {
|
|
|
1521
1521
|
return node;
|
|
1522
1522
|
}
|
|
1523
1523
|
|
|
1524
|
-
|
|
1525
1524
|
getModuleExistingNames(excludedList: Array<Module> = []) {
|
|
1526
1525
|
const excludedSet = new Set(excludedList);
|
|
1527
1526
|
return ((this.dependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1929,9 +1928,6 @@ export class App extends BaseNode {
|
|
|
1929
1928
|
return node;
|
|
1930
1929
|
}
|
|
1931
1930
|
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
1931
|
/**
|
|
1936
1932
|
* 删除数据源
|
|
1937
1933
|
* @param name 数据源名称
|
|
@@ -1980,8 +1976,6 @@ export class App extends BaseNode {
|
|
|
1980
1976
|
return params;
|
|
1981
1977
|
}
|
|
1982
1978
|
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
1979
|
/**
|
|
1986
1980
|
* 删除数据结构
|
|
1987
1981
|
* @param name 数据结构名称
|
|
@@ -2030,8 +2024,6 @@ export class App extends BaseNode {
|
|
|
2030
2024
|
return params;
|
|
2031
2025
|
}
|
|
2032
2026
|
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
2027
|
/**
|
|
2036
2028
|
* 删除枚举
|
|
2037
2029
|
* @param name 枚举名称
|
|
@@ -2080,8 +2072,6 @@ export class App extends BaseNode {
|
|
|
2080
2072
|
return params;
|
|
2081
2073
|
}
|
|
2082
2074
|
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
2075
|
/**
|
|
2086
2076
|
* 删除逻辑
|
|
2087
2077
|
* @param name 逻辑名称
|
|
@@ -2130,8 +2120,6 @@ export class App extends BaseNode {
|
|
|
2130
2120
|
return params;
|
|
2131
2121
|
}
|
|
2132
2122
|
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
2123
|
/**
|
|
2136
2124
|
* 删除接口
|
|
2137
2125
|
* @param name 接口名称
|
|
@@ -2180,8 +2168,6 @@ export class App extends BaseNode {
|
|
|
2180
2168
|
return params;
|
|
2181
2169
|
}
|
|
2182
2170
|
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
2171
|
/**
|
|
2186
2172
|
* 删除页面
|
|
2187
2173
|
* @param name 页面名称
|
|
@@ -2230,8 +2216,6 @@ export class App extends BaseNode {
|
|
|
2230
2216
|
return params;
|
|
2231
2217
|
}
|
|
2232
2218
|
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
2219
|
/**
|
|
2236
2220
|
* 删除变量
|
|
2237
2221
|
* @param name 变量名称
|
|
@@ -2280,8 +2264,6 @@ export class App extends BaseNode {
|
|
|
2280
2264
|
return params;
|
|
2281
2265
|
}
|
|
2282
2266
|
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
2267
|
/**
|
|
2286
2268
|
* 删除流程
|
|
2287
2269
|
* @param name 流程名称
|
|
@@ -2330,8 +2312,6 @@ export class App extends BaseNode {
|
|
|
2330
2312
|
return params;
|
|
2331
2313
|
}
|
|
2332
2314
|
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
2315
|
/**
|
|
2336
2316
|
* 删除角色
|
|
2337
2317
|
* @param name 角色名称
|
|
@@ -2380,8 +2360,6 @@ export class App extends BaseNode {
|
|
|
2380
2360
|
return params;
|
|
2381
2361
|
}
|
|
2382
2362
|
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
2363
|
/**
|
|
2386
2364
|
* 删除主题
|
|
2387
2365
|
* @param name 主题名称
|
|
@@ -2430,8 +2408,6 @@ export class App extends BaseNode {
|
|
|
2430
2408
|
return params;
|
|
2431
2409
|
}
|
|
2432
2410
|
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
2411
|
/**
|
|
2436
2412
|
* 删除配置管理
|
|
2437
2413
|
* @param name 配置管理名称
|
|
@@ -2480,8 +2456,6 @@ export class App extends BaseNode {
|
|
|
2480
2456
|
return params;
|
|
2481
2457
|
}
|
|
2482
2458
|
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
2459
|
/**
|
|
2486
2460
|
* 删除模块
|
|
2487
2461
|
* @param name 模块名称
|
|
@@ -2507,8 +2481,6 @@ export class App extends BaseNode {
|
|
|
2507
2481
|
return module.delete();
|
|
2508
2482
|
}
|
|
2509
2483
|
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
2484
|
/**
|
|
2513
2485
|
* 删除模块
|
|
2514
2486
|
* @param name 模块名称
|
|
@@ -2534,8 +2506,6 @@ export class App extends BaseNode {
|
|
|
2534
2506
|
return module.delete();
|
|
2535
2507
|
}
|
|
2536
2508
|
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
2509
|
/**
|
|
2540
2510
|
* 删除模块
|
|
2541
2511
|
* @param name 模块名称
|
|
@@ -2947,6 +2917,135 @@ ${keys.map((key) => ` ${key}: ${this.theme?.variableMap[key]};`).join('\n')}
|
|
|
2947
2917
|
console.log(err);
|
|
2948
2918
|
}
|
|
2949
2919
|
}
|
|
2920
|
+
/* 判断接口是否有误,需要重新导出 */
|
|
2921
|
+
|
|
2922
|
+
getQualifiedInterface(interfaces: Interface[] = this.interfaces):MessageData[] {
|
|
2923
|
+
const errorList: MessageData[] = [];
|
|
2924
|
+
interfaces.forEach((item:Interface) => {
|
|
2925
|
+
const logic = this.logics.find((logic: Logic) => logic.name === item.originLogicName);
|
|
2926
|
+
const logicParamMap: any = {};
|
|
2927
|
+
logic.params.forEach((param) => {
|
|
2928
|
+
logicParamMap[param.name] = param.typeAnnotation;
|
|
2929
|
+
});
|
|
2930
|
+
item.params.forEach((param) => {
|
|
2931
|
+
const logicTypeAnnotation = logicParamMap[param.name]?.toJSON();
|
|
2932
|
+
delete logicParamMap[param.name];
|
|
2933
|
+
if (!logicTypeAnnotation) {
|
|
2934
|
+
return errorList.push({
|
|
2935
|
+
logicName: logic.name,
|
|
2936
|
+
interfaceName: item.name,
|
|
2937
|
+
param: param.name,
|
|
2938
|
+
type: 1,
|
|
2939
|
+
message: `参数“${param.name}”已被删除,请确定请求类型无误后点击“重新导出”`,
|
|
2940
|
+
});
|
|
2941
|
+
}
|
|
2942
|
+
const interfaceTypeAnnotation = param.typeAnnotation.toJSON() as TypeAnnotation;
|
|
2943
|
+
let isSame = false;
|
|
2944
|
+
if (logicTypeAnnotation?.typeNamespace === 'app.enums') {
|
|
2945
|
+
if (interfaceTypeAnnotation.typeNamespace === 'nasl.core' && interfaceTypeAnnotation.typeName === 'String') {
|
|
2946
|
+
isSame = true;
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
if (JSON.stringify(logicTypeAnnotation) === JSON.stringify(interfaceTypeAnnotation)) {
|
|
2950
|
+
isSame = true;
|
|
2951
|
+
}
|
|
2952
|
+
if (!isSame) {
|
|
2953
|
+
errorList.push({
|
|
2954
|
+
logicName: logic.name,
|
|
2955
|
+
interfaceName: item.name,
|
|
2956
|
+
param: param.name,
|
|
2957
|
+
type: 2,
|
|
2958
|
+
message: `参数“${param.name}”数据类型变更,请确定请求类型无误后点击“重新导出”`,
|
|
2959
|
+
});
|
|
2960
|
+
}
|
|
2961
|
+
});
|
|
2962
|
+
const logicReturns = logic.returns;
|
|
2963
|
+
const interfaceReturns = item.returns;
|
|
2964
|
+
if (logicReturns?.length > interfaceReturns?.length) {
|
|
2965
|
+
if (!logicReturns[0].typeAnnotation) {
|
|
2966
|
+
errorList.push({
|
|
2967
|
+
logicName: logic.name,
|
|
2968
|
+
interfaceName: item.name,
|
|
2969
|
+
resultName: logicReturns[0].name,
|
|
2970
|
+
type: 4,
|
|
2971
|
+
message: `输出参数发生变更,请点击“重新导出”`,
|
|
2972
|
+
});
|
|
2973
|
+
} else {
|
|
2974
|
+
errorList.push({
|
|
2975
|
+
logicName: logic.name,
|
|
2976
|
+
interfaceName: item.name,
|
|
2977
|
+
resultName: logicReturns[0].name,
|
|
2978
|
+
type: 4,
|
|
2979
|
+
message: `输出参数发生变更,请点击“重新导出”`,
|
|
2980
|
+
});
|
|
2981
|
+
}
|
|
2982
|
+
} else if (logicReturns?.length < interfaceReturns?.length) {
|
|
2983
|
+
errorList.push({
|
|
2984
|
+
logicName: logic.name,
|
|
2985
|
+
interfaceName: item.name,
|
|
2986
|
+
resultName: interfaceReturns[0].name,
|
|
2987
|
+
type: 4,
|
|
2988
|
+
message: `输出参数发生变更,请点击“重新导出”`,
|
|
2989
|
+
});
|
|
2990
|
+
} else if (logicReturns?.length === interfaceReturns?.length) {
|
|
2991
|
+
if (logicReturns.length !== 0) {
|
|
2992
|
+
if (logicReturns[0].name !== interfaceReturns[0].name) {
|
|
2993
|
+
errorList.push({
|
|
2994
|
+
logicName: logic.name,
|
|
2995
|
+
interfaceName: item.name,
|
|
2996
|
+
resultName: logicReturns[0].name,
|
|
2997
|
+
type: 4,
|
|
2998
|
+
message: `输出参数发生变更,请点击“重新导出”`,
|
|
2999
|
+
});
|
|
3000
|
+
} else if (!logicReturns[0].typeAnnotation) {
|
|
3001
|
+
if (!logicReturns[0]?.__TypeAnnotation) {
|
|
3002
|
+
errorList.push({
|
|
3003
|
+
logicName: logic.name,
|
|
3004
|
+
interfaceName: item.name,
|
|
3005
|
+
resultName: logicReturns[0].name,
|
|
3006
|
+
type: 7,
|
|
3007
|
+
message: `输出参数“${logicReturns[0].name}”没有数据类型,无法导出`,
|
|
3008
|
+
});
|
|
3009
|
+
} else if (!logicReturns[0]?.__TypeAnnotation.isSame(interfaceReturns[0]?.typeAnnotation)) {
|
|
3010
|
+
errorList.push({
|
|
3011
|
+
logicName: logic.name,
|
|
3012
|
+
interfaceName: item.name,
|
|
3013
|
+
resultName: logicReturns[0].name,
|
|
3014
|
+
type: 4,
|
|
3015
|
+
message: `输出参数发生变更,请点击“重新导出”`,
|
|
3016
|
+
});
|
|
3017
|
+
}
|
|
3018
|
+
} else if (JSON.stringify(logicReturns[0]?.typeAnnotation?.toJSON()) !== JSON.stringify(interfaceReturns[0]?.typeAnnotation?.toJSON())) {
|
|
3019
|
+
errorList.push({
|
|
3020
|
+
logicName: logic.name,
|
|
3021
|
+
interfaceName: item.name,
|
|
3022
|
+
resultName: logicReturns[0].name,
|
|
3023
|
+
type: 4,
|
|
3024
|
+
message: `输出参数发生变更,请点击“重新导出”`,
|
|
3025
|
+
});
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
}
|
|
3029
|
+
for (const i in logicParamMap) {
|
|
3030
|
+
errorList.push({
|
|
3031
|
+
logicName: logic.name,
|
|
3032
|
+
param: i,
|
|
3033
|
+
message: `新增参数“${i}”,请确定请求类型无误后点击“重新导出”`,
|
|
3034
|
+
type: 3,
|
|
3035
|
+
});
|
|
3036
|
+
}
|
|
3037
|
+
});
|
|
3038
|
+
return errorList;
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
getExtensionsCallbackLogics() {
|
|
3042
|
+
let resultLogics:string[] = [];
|
|
3043
|
+
this.views.forEach((item:View) => {
|
|
3044
|
+
resultLogics = [...resultLogics, ...item.getViewCallLogics()];
|
|
3045
|
+
});
|
|
3046
|
+
return Array.from(new Set(resultLogics));
|
|
3047
|
+
}
|
|
3048
|
+
|
|
2950
3049
|
//================================================================================
|
|
2951
3050
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
2952
3051
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -664,10 +664,11 @@ export class Assignee extends LogicItem {
|
|
|
664
664
|
code += `${logic.toEmbeddedTSInProcess(shiftState(state, code, { tabSize: (state?.tabSize || 0) }), prevCode, false, true)}\n`;
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
|
-
code += `${tab}
|
|
668
|
-
this.dynamicUsers.forEach((u) => {
|
|
667
|
+
code += `${tab}nasl.util.concatString(`;
|
|
668
|
+
this.dynamicUsers.forEach((u, index) => {
|
|
669
669
|
code += u.toEmbeddedTS(shiftState(state, code));
|
|
670
|
-
|
|
670
|
+
if (index + 1 < this.dynamicUsers.length)
|
|
671
|
+
code += ', ';
|
|
671
672
|
});
|
|
672
673
|
code += ')\n';
|
|
673
674
|
// code += `${this.dynamicUsers.map(u => u.toEmbeddedTS(shiftState(state, code))).join(',\n')})\n`;
|