@lcap/nasl 3.8.2-beta.8 → 3.8.3-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/ai-engineer.config.js +617 -0
- package/out/common/BaseNode.js +5 -3
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/ComponentAPI.d.ts +9 -0
- package/out/concepts/AuthLogicForCallInterface__.js +21 -6
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +16 -1
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +12 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindStyle__.js +1 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BusinessComponent__.js +24 -8
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.js +21 -6
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallInterface__.js +2 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +1 -0
- package/out/concepts/CallLogic__.js +32 -11
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +1 -0
- package/out/concepts/CallQueryComponent__.js +23 -12
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Destination__.js +11 -8
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +3 -2
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +1 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Interface__.js +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/Logic__.js +49 -17
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +19 -13
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +37 -12
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +21 -6
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +5 -4
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +0 -1
- package/out/concepts/QueryOrderByExpression__.js +0 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/Structure__.js +5 -7
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/Variable__.js +5 -0
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +1 -0
- package/out/concepts/ViewElement__.js +17 -7
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +70 -14
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.processV2.js +78 -0
- package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +40 -40
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/generator/genBundleFiles.js +1 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/release-body/utils.js +1 -1
- package/out/natural/genNaturalTS.d.ts +45 -10
- package/out/natural/genNaturalTS.js +57 -33
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/getContext/getUILib.js +6 -3
- package/out/natural/getContext/getUILib.js.map +1 -1
- package/out/natural/getContext/index.d.ts +20 -7
- package/out/natural/getContext/index.js +143 -23
- package/out/natural/getContext/index.js.map +1 -1
- package/out/natural/getContext/naslStdlibMap.js +8 -8
- package/out/natural/getContext/naslStdlibMap.js.map +1 -1
- package/out/natural/tools.d.ts +16 -0
- package/out/natural/tools.js +110 -2
- package/out/natural/tools.js.map +1 -1
- package/out/natural/transformTS2UI.js +361 -304
- package/out/natural/transformTS2UI.js.map +1 -1
- package/out/natural/transformTSCode.d.ts +3 -5
- package/out/natural/transformTSCode.js +30 -1089
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/natural/transforms/registerTransform.d.ts +7 -0
- package/out/natural/transforms/registerTransform.js +24 -0
- package/out/natural/transforms/registerTransform.js.map +1 -0
- package/out/natural/transforms/transform2LogicItem.d.ts +24 -0
- package/out/natural/transforms/transform2LogicItem.js +1240 -0
- package/out/natural/transforms/transform2LogicItem.js.map +1 -0
- package/out/natural/transforms/transform2TypeAnnotation.d.ts +2 -0
- package/out/natural/transforms/transform2TypeAnnotation.js +86 -0
- package/out/natural/transforms/transform2TypeAnnotation.js.map +1 -0
- package/out/natural/transforms/utils.d.ts +8 -0
- package/out/natural/transforms/utils.js +59 -0
- package/out/natural/transforms/utils.js.map +1 -0
- package/out/server/getLogics.js +12 -12
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +11 -17
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +2 -2
- package/out/server/naslServer.js +38 -18
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +5 -0
- package/out/server/translator.js.map +1 -1
- package/out/templator/block2nasl/jsx2nasl/index.d.ts +5 -0
- package/out/templator/block2nasl/jsx2nasl/index.js +15 -0
- package/out/templator/block2nasl/jsx2nasl/index.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-expression2nasl.d.ts +3 -0
- package/out/templator/block2nasl/jsx2nasl/transform-expression2nasl.js +213 -0
- package/out/templator/block2nasl/jsx2nasl/transform-expression2nasl.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.d.ts +14 -0
- package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.js +201 -0
- package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tstype2nasl.d.ts +4 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tstype2nasl.js +186 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tstype2nasl.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.d.ts +28 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.js +336 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/utils.d.ts +2 -0
- package/out/templator/block2nasl/jsx2nasl/utils.js +26 -0
- package/out/templator/block2nasl/jsx2nasl/utils.js.map +1 -0
- package/out/templator/block2nasl/transformBlock2Nasl.d.ts +10 -0
- package/out/templator/block2nasl/transformBlock2Nasl.js +122 -0
- package/out/templator/block2nasl/transformBlock2Nasl.js.map +1 -0
- package/out/templator/block2nasl/viewMergeBlock.d.ts +9 -0
- package/out/templator/block2nasl/viewMergeBlock.js +110 -0
- package/out/templator/block2nasl/viewMergeBlock.js.map +1 -0
- package/out/translator/types.d.ts +2 -0
- package/out/translator/utils.js +1 -1
- package/out/translator/utils.js.map +1 -1
- package/out/utils/index.js +0 -4
- package/out/utils/index.js.map +1 -1
- package/out/utils/language-cache/constant.d.ts +2 -1
- package/out/utils/language-cache/constant.js +1 -0
- package/out/utils/language-cache/constant.js.map +1 -1
- package/out/utils/language-cache/nasl.d.ts +1 -0
- package/out/utils/language-cache/nasl.js +9 -1
- package/out/utils/language-cache/nasl.js.map +1 -1
- package/package.json +6 -2
- package/sandbox/stdlib/nasl.processV2.ts +19 -0
- package/sandbox/stdlib/nasl.ui.ts +8 -8
- package/sandbox-natural/stdlib/nasl.core.d.ts +54 -0
- package/sandbox-natural/stdlib/nasl.oql.d.ts +22 -0
- package/sandbox-natural/stdlib/nasl.ui.d.ts +78 -0
- package/sandbox-natural/stdlib/nasl.ui.h5.d.ts +1684 -1643
- package/sandbox-natural/stdlib/nasl.ui.h5.json +15746 -15045
- package/sandbox-natural/stdlib/nasl.ui.pc.d.ts +5341 -5154
- package/sandbox-natural/stdlib/nasl.ui.pc.json +31176 -30681
- package/sandbox-natural/stdlib/{nasl.util.ts → nasl.util.d.ts} +49 -43
- package/src/common/BaseNode.ts +5 -3
- package/src/common/ComponentAPI.ts +7 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +23 -6
- package/src/concepts/BackendVariable__.ts +16 -1
- package/src/concepts/BindAttribute__.ts +18 -13
- package/src/concepts/BindDirective__.ts +1 -1
- package/src/concepts/BindStyle__.ts +1 -1
- package/src/concepts/BusinessComponent__.ts +26 -8
- package/src/concepts/BusinessLogic__.ts +23 -6
- package/src/concepts/CallInterface__.ts +2 -2
- package/src/concepts/CallLogic__.ts +50 -24
- package/src/concepts/CallQueryComponent__.ts +26 -12
- package/src/concepts/Destination__.ts +14 -12
- package/src/concepts/EntityProperty__.ts +5 -5
- package/src/concepts/Entity__.ts +1 -1
- package/src/concepts/Interface__.ts +1 -1
- package/src/concepts/Logic__.ts +62 -33
- package/src/concepts/MemberExpression__.ts +20 -13
- package/src/concepts/OqlQueryComponent__.ts +29 -5
- package/src/concepts/OverriddenLogic__.ts +23 -6
- package/src/concepts/Param__.ts +5 -4
- package/src/concepts/QueryOrderByExpression__.ts +0 -1
- package/src/concepts/Structure__.ts +5 -7
- package/src/concepts/Variable__.ts +9 -5
- package/src/concepts/ViewElement__.ts +25 -9
- package/src/concepts/View__.ts +97 -37
- package/src/concepts/basics/stdlib/nasl.processV2.ts +79 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +40 -40
- package/src/generator/genBundleFiles.ts +1 -1
- package/src/generator/release-body/utils.ts +1 -1
- package/src/natural/genNaturalTS.ts +88 -39
- package/src/natural/getContext/getUILib.ts +6 -3
- package/src/natural/getContext/index.ts +125 -23
- package/src/natural/getContext/naslStdlibMap.ts +8 -8
- package/src/natural/tools.ts +107 -2
- package/src/natural/transformTS2UI.ts +205 -147
- package/src/natural/transformTSCode.ts +29 -1055
- package/src/natural/transforms/registerTransform.ts +34 -0
- package/src/natural/transforms/transform2LogicItem.ts +1335 -0
- package/src/natural/transforms/transform2TypeAnnotation.ts +77 -0
- package/src/natural/transforms/utils.ts +25 -0
- package/src/server/getLogics.ts +12 -12
- package/src/server/getMemberIdentifier.ts +14 -14
- package/src/server/naslServer.ts +39 -19
- package/src/server/translator.ts +5 -0
- package/src/templator/block2nasl/jsx2nasl/index.ts +11 -0
- package/src/templator/block2nasl/jsx2nasl/transform-expression2nasl.ts +238 -0
- package/src/templator/block2nasl/jsx2nasl/transform-func2nasl.ts +241 -0
- package/src/templator/block2nasl/jsx2nasl/transform-tstype2nasl.ts +213 -0
- package/src/templator/block2nasl/jsx2nasl/transform-tsx2nasl.ts +422 -0
- package/src/templator/block2nasl/jsx2nasl/utils.ts +19 -0
- package/src/templator/block2nasl/transformBlock2Nasl.ts +99 -0
- package/src/templator/block2nasl/viewMergeBlock.ts +149 -0
- package/src/translator/types.ts +2 -0
- package/src/translator/utils.ts +1 -1
- package/src/utils/index.ts +0 -4
- package/src/utils/language-cache/constant.ts +1 -0
- package/src/utils/language-cache/nasl.ts +6 -0
- package/test/concepts/member-expression/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/member-expression/__snapshots__/toVue.spec.ts.snap +1 -1
- package/test/tdd/dataQuery/QueryFieldExpression/case1/ast.json +7 -0
- package/test/tdd/dataQuery/QueryFieldExpression/case1/natural.ts.txt +1 -0
- package/test/tdd/dataQuery/QueryFieldExpression/case2/ast.json +7 -0
- package/test/tdd/dataQuery/QueryFieldExpression/case2/natural.ts.txt +1 -0
- package/test/tdd/transform/case1/ast.json +243 -0
- package/test/tdd/transform/case1/natural.ts.md +20 -0
- package/test/tdd/transform/case2/ast.json +207 -0
- package/test/tdd/transform/case2/natural.ts.md +12 -0
- package/test/tdd.test.js +10 -0
- package/test/tdd.transform.test.js +38 -0
- package/test/utils.js +40 -0
- package/sandbox-natural/stdlib/nasl.core.ts +0 -36
- package/sandbox-natural/stdlib/nasl.oql.ts +0 -14
- package/sandbox-natural/stdlib/nasl.ui.pre.d.ts +0 -90
- package/sandbox-natural/stdlib/nasl.ui.ts +0 -63
|
@@ -16,7 +16,8 @@ import type Identifier from './Identifier__';
|
|
|
16
16
|
import type MemberExpression from './MemberExpression__';
|
|
17
17
|
import type { Entity } from './Entity__';
|
|
18
18
|
import type { EntityProperty } from './EntityProperty__';
|
|
19
|
-
import
|
|
19
|
+
import { naslOQLCacheStore } from '../utils/language-cache/nasl';
|
|
20
|
+
|
|
20
21
|
//================================================================================
|
|
21
22
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
22
23
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -303,8 +304,8 @@ export class OqlQueryComponent extends LogicItem {
|
|
|
303
304
|
};
|
|
304
305
|
}
|
|
305
306
|
|
|
306
|
-
|
|
307
|
-
|
|
307
|
+
const query = async () => {
|
|
308
|
+
const params = {
|
|
308
309
|
appId: 'myAppId',
|
|
309
310
|
oqlIdentifier: 'myoqlIdentifier',
|
|
310
311
|
dataSourceName: this.dataSource,
|
|
@@ -313,8 +314,31 @@ export class OqlQueryComponent extends LogicItem {
|
|
|
313
314
|
dataSourceNasl,
|
|
314
315
|
typeScriptStartLine: 1,
|
|
315
316
|
typeScriptStartLineColumn: 1,
|
|
316
|
-
}
|
|
317
|
-
|
|
317
|
+
};
|
|
318
|
+
const key = JSON.stringify(params);
|
|
319
|
+
let res = null;
|
|
320
|
+
let canUseCache = false;
|
|
321
|
+
try {
|
|
322
|
+
res = await naslOQLCacheStore.getItem(key);
|
|
323
|
+
canUseCache = true;
|
|
324
|
+
} catch (error) {}
|
|
325
|
+
if (res !== null) {
|
|
326
|
+
return res;
|
|
327
|
+
}
|
|
328
|
+
return http
|
|
329
|
+
.post('/api/v1/querydebug/generate/typescript', params)
|
|
330
|
+
.then(async ({ data }) => {
|
|
331
|
+
if (canUseCache) {
|
|
332
|
+
try {
|
|
333
|
+
await naslOQLCacheStore.setItem(key, data);
|
|
334
|
+
} catch (error) {}
|
|
335
|
+
}
|
|
336
|
+
return data;
|
|
337
|
+
});
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
return query()
|
|
341
|
+
.then((data: any) => {
|
|
318
342
|
this.codeSourceMap = data.result ?? { typescript: '', lexicalErrorCode: 1001 };
|
|
319
343
|
})
|
|
320
344
|
.catch((err) => {
|
|
@@ -1769,22 +1769,39 @@ export class OverriddenLogic extends BaseNode {
|
|
|
1769
1769
|
],
|
|
1770
1770
|
function* warpForEachGenerator({ key, node: itemNode }) {
|
|
1771
1771
|
if (itemNode) {
|
|
1772
|
-
code += `
|
|
1772
|
+
code += `let __${key}_${node?.name}`;
|
|
1773
1773
|
let itemCode = '';
|
|
1774
|
+
// 匿名数据结构 / 未设置类型的List/map 才进getInitCode
|
|
1774
1775
|
if (
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1776
|
+
(
|
|
1777
|
+
asserts.isNewComposite(itemNode)
|
|
1778
|
+
&& itemNode.typeAnnotation?.typeKind === 'anonymousStructure'
|
|
1779
|
+
)
|
|
1780
|
+
|| (
|
|
1781
|
+
(asserts.isNewList(itemNode) || asserts.isNewMap(itemNode))
|
|
1782
|
+
&& !(itemNode?.typeAnnotation)
|
|
1783
|
+
)
|
|
1778
1784
|
) {
|
|
1779
|
-
|
|
1785
|
+
code += ' = ';
|
|
1786
|
+
itemCode += yield* itemNode?.getInitCode?.(shiftState(state, code, {
|
|
1780
1787
|
inline: true
|
|
1781
1788
|
})) ??
|
|
1782
1789
|
returnOrigin('');
|
|
1790
|
+
} else if (asserts.isNewComposite(itemNode) && itemNode.typeAnnotation?.typeKind === 'generic') { // new 带泛型的数据结构/实体 进这里
|
|
1791
|
+
code += ' = ';
|
|
1792
|
+
itemCode += (yield* itemNode?.getNewCompositeCode?.(shiftState(state, code, { inline: true }))) || 'null';
|
|
1793
|
+
} else if ((itemNode as any)?.typeAnnotation && !(asserts.isCallQueryComponent(itemNode) && !itemNode.isAutoInfer())) {
|
|
1794
|
+
code += ': ';
|
|
1795
|
+
code += yield* (itemNode as any)?.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
1796
|
+
returnOrigin('');
|
|
1783
1797
|
} else {
|
|
1798
|
+
code += ' = ';
|
|
1784
1799
|
itemCode = yield* itemNode?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
1785
1800
|
returnOrigin('');
|
|
1786
1801
|
}
|
|
1787
|
-
|
|
1802
|
+
if (itemCode) {
|
|
1803
|
+
code += yield* self.getRightCode(itemCode, assignment, itemNode);
|
|
1804
|
+
}
|
|
1788
1805
|
code += ';\n';
|
|
1789
1806
|
}
|
|
1790
1807
|
},
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -329,12 +329,13 @@ export class Param extends BaseNode {
|
|
|
329
329
|
if (asserts.isFunction(this.defaultExpression) || asserts.isAnonymousFunction(this.defaultExpression)) {
|
|
330
330
|
code += this.defaultValue?.expression || this.defaultExpression ? '?: ' : ': ';
|
|
331
331
|
code += runSync(this.defaultExpression.toEmbeddedTSDefinition(shiftState(state, code)));
|
|
332
|
-
} else if (!dontType && this.typeAnnotation) {
|
|
332
|
+
} else if (!dontType && (this.typeAnnotation || this.__TypeAnnotation)) {
|
|
333
|
+
const typeAnnotation = this?.typeAnnotation || this?.__TypeAnnotation;
|
|
333
334
|
code += ': ';
|
|
334
|
-
code +=
|
|
335
|
-
if (
|
|
335
|
+
code += typeAnnotation?.toNaturalTS(shiftState(state, code));
|
|
336
|
+
if (typeAnnotation?.typeKind !== 'primitive' && this.defaultValue) {
|
|
336
337
|
if (this.isEnum()) {
|
|
337
|
-
code += `= ${
|
|
338
|
+
code += `= ${typeAnnotation.typeKey}['${this.defaultValue}']`;
|
|
338
339
|
}
|
|
339
340
|
}
|
|
340
341
|
}
|
|
@@ -573,16 +573,14 @@ export class Structure extends BaseNode {
|
|
|
573
573
|
.join(', ')}>`;
|
|
574
574
|
}
|
|
575
575
|
|
|
576
|
-
code += ` {`;
|
|
577
|
-
if (state.descriptionComment && this.description)
|
|
578
|
-
|
|
579
|
-
code += '\n';
|
|
576
|
+
code += ` {\n`;
|
|
577
|
+
// if (state.descriptionComment && this.description)
|
|
578
|
+
// code += `/* ${this.description} */`;
|
|
579
|
+
// code += '\n';
|
|
580
580
|
|
|
581
581
|
// code += `${indent(state.tabSize + 1)}__name: '${this.getNamespace()}.${this.name}';\n`;
|
|
582
582
|
this.properties.forEach((property) => {
|
|
583
|
-
code +=
|
|
584
|
-
code += property.toNaturalTS(shiftState(state, code, { tabSize: 0 }));
|
|
585
|
-
code += ';\n';
|
|
583
|
+
code += `${property.toNaturalTS(shiftState(state, code, { tabSize: state.tabSize + 1 }))};\n`;
|
|
586
584
|
});
|
|
587
585
|
code += `${indent(state.tabSize)}}\n`;
|
|
588
586
|
return code;
|
|
@@ -24,7 +24,7 @@ function tryJSONParse(str: string) {
|
|
|
24
24
|
|
|
25
25
|
try {
|
|
26
26
|
result = JSON.parse(str);
|
|
27
|
-
} catch (e) {}
|
|
27
|
+
} catch (e) { }
|
|
28
28
|
|
|
29
29
|
return result;
|
|
30
30
|
}
|
|
@@ -208,7 +208,7 @@ export class Variable extends BaseNode {
|
|
|
208
208
|
get __isVirtual() {
|
|
209
209
|
const processV2 = this.getAncestor('ProcessV2') as ProcessV2;
|
|
210
210
|
const process = this.getAncestor('Process') as Process;
|
|
211
|
-
const isDisabled = !!this.getAncestor('HistoryProcessV2') || ['enabled', 'history'].includes(processV2?.status)
|
|
211
|
+
const isDisabled = !!this.getAncestor('HistoryProcessV2') || ['enabled', 'history'].includes(processV2?.status);
|
|
212
212
|
return isDisabled || process?.__isVirtual || false;
|
|
213
213
|
}
|
|
214
214
|
|
|
@@ -305,6 +305,11 @@ export class Variable extends BaseNode {
|
|
|
305
305
|
@withSourceMap()
|
|
306
306
|
toNaturalTS(state = createCompilerState()): string {
|
|
307
307
|
let code = this.name;
|
|
308
|
+
if (state.needNamespace) {
|
|
309
|
+
const namespace = this.getNamespace();
|
|
310
|
+
const prefix = ['Frontend', 'Backend']?.includes(this?.parentNode?.concept) ? `${namespace}.` : '';
|
|
311
|
+
code = `${prefix}${code}`;
|
|
312
|
+
}
|
|
308
313
|
if (this.typeAnnotation) {
|
|
309
314
|
code += ': ';
|
|
310
315
|
code += this.typeAnnotation.toNaturalTS(shiftState(state, code));
|
|
@@ -363,9 +368,8 @@ export class Variable extends BaseNode {
|
|
|
363
368
|
* @param name 一般不用传,用于 rename
|
|
364
369
|
*/
|
|
365
370
|
getEmbeddedFilePath(name = this.name) {
|
|
366
|
-
return `/embedded/${this.getAncestor('App')?.name}/frontendTypes/${
|
|
367
|
-
this.getAncestor('
|
|
368
|
-
}/frontends/${this.getAncestor('Frontend')?.name}/variables/${name}.ts`;
|
|
371
|
+
return `/embedded/${this.getAncestor('App')?.name}/frontendTypes/${this.getAncestor('FrontendType')?.name
|
|
372
|
+
}/frontends/${this.getAncestor('Frontend')?.name}/variables/${name}.ts`;
|
|
369
373
|
}
|
|
370
374
|
|
|
371
375
|
*toEmbeddedTSFile(): EmbeddedTSFileGenerator {
|
|
@@ -27,7 +27,6 @@ import type Identifier from './Identifier__';
|
|
|
27
27
|
import { PAGE_COMPONENT_INCLUDE_TAG_MAP } from './View__';
|
|
28
28
|
import type BusinessComponent from './BusinessComponent__';
|
|
29
29
|
import type FrontendType from './FrontendType__';
|
|
30
|
-
import { ComponentCompletionPropertyMap } from './View__';
|
|
31
30
|
|
|
32
31
|
import { kebab2Camel } from '../utils';
|
|
33
32
|
export interface ParseContext {
|
|
@@ -1493,6 +1492,10 @@ export class ViewElement extends Annotatable {
|
|
|
1493
1492
|
return this.bindStyles.find((bindStyle) => bindStyle.name === name);
|
|
1494
1493
|
}
|
|
1495
1494
|
|
|
1495
|
+
getBindEvent(name: string) {
|
|
1496
|
+
return this.bindEvents.find((bindEvent) => bindEvent.name === name);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1496
1499
|
toHump(name: string): string {
|
|
1497
1500
|
return name.replace(/-(\w)/g, (all, letter) => letter.toUpperCase());
|
|
1498
1501
|
}
|
|
@@ -1637,7 +1640,7 @@ export class ViewElement extends Annotatable {
|
|
|
1637
1640
|
code += `${self.name}: () => {\n`;
|
|
1638
1641
|
|
|
1639
1642
|
const getPropInitialValue = (name: string) => {
|
|
1640
|
-
let v = 'new nasl.core.
|
|
1643
|
+
let v = 'new nasl.core.Boolean()';
|
|
1641
1644
|
const attr = self.bindAttrs?.find((attr) => attr.name === name);
|
|
1642
1645
|
if (['static', 'string'].includes(attr?.type)) {
|
|
1643
1646
|
v = attr.value ? 'new nasl.core.BooleanTrue()' : 'new nasl.core.BooleanFalse()';
|
|
@@ -1777,7 +1780,7 @@ export class ViewElement extends Annotatable {
|
|
|
1777
1780
|
if (hasDataSource && V && !T1) {
|
|
1778
1781
|
const valueFieldAttr = self.bindAttrs?.find((attr) => attr.name === 'valueField');
|
|
1779
1782
|
if (dataSourceSetted && ['static', 'string'].includes(valueFieldAttr?.type)) {
|
|
1780
|
-
valueType = `nasl.util._formatEnum<typeof __item.${valueFieldAttr.value}>`;
|
|
1783
|
+
valueType = `nasl.util._formatEnum<typeof __item.${valueFieldAttr.value || 'value'}>`;
|
|
1781
1784
|
} else {
|
|
1782
1785
|
valueType = `nasl.util._formatEnum<typeof __staticItem>`;
|
|
1783
1786
|
}
|
|
@@ -2262,6 +2265,15 @@ export class ViewElement extends Annotatable {
|
|
|
2262
2265
|
|
|
2263
2266
|
code += `$refs.${this.name} = new ${kebab2Camel(this.tag)}({\n`;
|
|
2264
2267
|
|
|
2268
|
+
this?.bindDirectives?.forEach((directive) => {
|
|
2269
|
+
code += directive.toNaturalTS(
|
|
2270
|
+
shiftState(state, code, {
|
|
2271
|
+
tabSize: state.tabSize + 1,
|
|
2272
|
+
}),
|
|
2273
|
+
);
|
|
2274
|
+
code += ',\n';
|
|
2275
|
+
});
|
|
2276
|
+
|
|
2265
2277
|
this.bindAttrs.forEach((attr) => {
|
|
2266
2278
|
code += attr.toNaturalTS(
|
|
2267
2279
|
shiftState(state, code, {
|
|
@@ -2271,6 +2283,15 @@ export class ViewElement extends Annotatable {
|
|
|
2271
2283
|
code += ',\n';
|
|
2272
2284
|
});
|
|
2273
2285
|
|
|
2286
|
+
this.bindStyles.forEach((style) => {
|
|
2287
|
+
code += style.toNaturalTS(
|
|
2288
|
+
shiftState(state, code, {
|
|
2289
|
+
tabSize: state.tabSize + 1,
|
|
2290
|
+
}),
|
|
2291
|
+
);
|
|
2292
|
+
code += ',\n';
|
|
2293
|
+
});
|
|
2294
|
+
|
|
2274
2295
|
this.bindEvents.forEach((event) => {
|
|
2275
2296
|
code += event.toNaturalTS(
|
|
2276
2297
|
shiftState(state, code, {
|
|
@@ -2438,12 +2459,7 @@ export class ViewElement extends Annotatable {
|
|
|
2438
2459
|
|
|
2439
2460
|
if (['u-button', 'u-form', 'u-modal', 'u-table-view', 'u-select', 'u-input', 'u-number-input'].includes(this.tag)) {
|
|
2440
2461
|
code += indent(state.tabSize + 1);
|
|
2441
|
-
|
|
2442
|
-
// if (this.toHump(this.tag) === 'lcapLogin' || this.staticClass === 'login-form') {
|
|
2443
|
-
// code += `${this.name}: nasl.ui.div;\n`;
|
|
2444
|
-
// } else {
|
|
2445
|
-
code += `${this.name}: nasl.ui.${kebab2Camel(this.tag.replace(/^\w-/, ''))},\n`;
|
|
2446
|
-
// }
|
|
2462
|
+
code += `${this.name}: nasl.ui.${kebab2Camel(this.tag.replace(/^\w-/, ''))},\n`;
|
|
2447
2463
|
}
|
|
2448
2464
|
|
|
2449
2465
|
if (Array.isArray(this.children)) {
|
package/src/concepts/View__.ts
CHANGED
|
@@ -46,6 +46,8 @@ const removedViewElementCache: {
|
|
|
46
46
|
[key: string]: number | bigint;
|
|
47
47
|
} = {};
|
|
48
48
|
|
|
49
|
+
import { config } from '../config';
|
|
50
|
+
|
|
49
51
|
//================================================================================
|
|
50
52
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
51
53
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -1583,8 +1585,8 @@ export class View extends Annotatable {
|
|
|
1583
1585
|
const BindEvent = getConceptConstructor('BindEvent');
|
|
1584
1586
|
const definitionStr = utils.sliceTagContent(code, 'definition') || '{}';
|
|
1585
1587
|
const definition: any = JSON.parse(definitionStr);
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
+
// 服务端逻辑
|
|
1589
|
+
if (Array.isArray(definition.logics)) {
|
|
1588
1590
|
definition.logics.forEach((logicOption: any) => {
|
|
1589
1591
|
const logic = Logic.from(
|
|
1590
1592
|
{
|
|
@@ -1671,8 +1673,8 @@ export class View extends Annotatable {
|
|
|
1671
1673
|
const BindEvent = getConceptConstructor('BindEvent');
|
|
1672
1674
|
const definitionStr = utils.sliceTagContent(code, 'definition') || '{}';
|
|
1673
1675
|
const definition: any = JSON.parse(definitionStr);
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
+
// 服务端逻辑
|
|
1677
|
+
if (Array.isArray(definition.logics)) {
|
|
1676
1678
|
definition.logics.forEach((logicOption: any) => {
|
|
1677
1679
|
const logic = Logic.from(
|
|
1678
1680
|
{
|
|
@@ -1834,7 +1836,7 @@ export class View extends Annotatable {
|
|
|
1834
1836
|
*/
|
|
1835
1837
|
genScript() {
|
|
1836
1838
|
const componentList: Array<ViewElement> = [];
|
|
1837
|
-
const allComponentList: Array<ViewElement & { currentIndex: number }> = [];
|
|
1839
|
+
const allComponentList: Array<ViewElement & { currentIndex: number; }> = [];
|
|
1838
1840
|
this.elementsAttrs(this.elements, componentList, allComponentList, -1);
|
|
1839
1841
|
|
|
1840
1842
|
const routeMeta = this.getRouteMeta();
|
|
@@ -1857,22 +1859,22 @@ export class View extends Annotatable {
|
|
|
1857
1859
|
document.addEventListener('keydown', this.onKeyDown);
|
|
1858
1860
|
document.addEventListener('keyup', this.onKeyUp);
|
|
1859
1861
|
},
|
|
1860
|
-
|
|
1862
|
+
beforeDestroy() {
|
|
1861
1863
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
1862
1864
|
document.removeEventListener('keyup', this.onKeyUp);
|
|
1863
1865
|
},
|
|
1864
1866
|
methods: {
|
|
1865
1867
|
async onKeyDown(e) {
|
|
1866
1868
|
${this.bindEvents
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1869
|
+
.filter((event) => ['keydown'].includes(event.name))
|
|
1870
|
+
.map((event) => `await this.${event.view.name}_${event.name}(e);`)
|
|
1871
|
+
.join('\n')}
|
|
1870
1872
|
},
|
|
1871
1873
|
async onKeyUp(e) {
|
|
1872
1874
|
${this.bindEvents
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1875
|
+
.filter((event) => ['keyup'].includes(event.name))
|
|
1876
|
+
.map((event) => `await this.${event.view.name}_${event.name}(e);`)
|
|
1877
|
+
.join('\n')}
|
|
1876
1878
|
}
|
|
1877
1879
|
}
|
|
1878
1880
|
};\n`;
|
|
@@ -2066,9 +2068,8 @@ export class View extends Annotatable {
|
|
|
2066
2068
|
parent = parent.parentNode;
|
|
2067
2069
|
}
|
|
2068
2070
|
}
|
|
2069
|
-
return `/embedded/${this.getAncestor('App')?.name}/frontendTypes/${
|
|
2070
|
-
this.getAncestor('
|
|
2071
|
-
}/frontends/${this.getAncestor('Frontend')?.name}/views/${pathName}.ts`;
|
|
2071
|
+
return `/embedded/${this.getAncestor('App')?.name}/frontendTypes/${this.getAncestor('FrontendType')?.name
|
|
2072
|
+
}/frontends/${this.getAncestor('Frontend')?.name}/views/${pathName}.ts`;
|
|
2072
2073
|
}
|
|
2073
2074
|
|
|
2074
2075
|
getNamespace(): string {
|
|
@@ -2117,16 +2118,16 @@ export class View extends Annotatable {
|
|
|
2117
2118
|
elementsAttrs(
|
|
2118
2119
|
elements: Array<ViewElement>,
|
|
2119
2120
|
componentList: Array<ViewElement>,
|
|
2120
|
-
allComponentList: Array<ViewElement & { currentIndex: number }>,
|
|
2121
|
+
allComponentList: Array<ViewElement & { currentIndex: number; }>,
|
|
2121
2122
|
currentIndex: number,
|
|
2122
2123
|
) {
|
|
2123
2124
|
if (elements) {
|
|
2124
|
-
elements.forEach((item: ViewElement & { currentIndex: number }) => {
|
|
2125
|
+
elements.forEach((item: ViewElement & { currentIndex: number; }) => {
|
|
2125
2126
|
let index = currentIndex ?? -1;
|
|
2126
2127
|
if (item.tag === 'template' && item.haveScope()) {
|
|
2127
2128
|
index += 1;
|
|
2128
2129
|
}
|
|
2129
|
-
if (
|
|
2130
|
+
if (config?.allNodesAPI && config?.allNodesAPI[item.tag]?.readablePropsMap) {
|
|
2130
2131
|
componentList.push(item);
|
|
2131
2132
|
}
|
|
2132
2133
|
item.currentIndex = index;
|
|
@@ -2246,9 +2247,9 @@ export class View extends Annotatable {
|
|
|
2246
2247
|
const leftCode =
|
|
2247
2248
|
leftIndex.length === 1
|
|
2248
2249
|
? yield* el.left?.expression?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
2249
|
-
|
|
2250
|
+
returnOrigin('')
|
|
2250
2251
|
: yield* el.left?.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
2251
|
-
|
|
2252
|
+
returnOrigin('');
|
|
2252
2253
|
const advanceVar = self.variables?.find(
|
|
2253
2254
|
(variable) => !variable.typeAnnotation && leftCode === variable.name,
|
|
2254
2255
|
);
|
|
@@ -2303,7 +2304,7 @@ export class View extends Annotatable {
|
|
|
2303
2304
|
leftIndex.length === 1
|
|
2304
2305
|
? yield* assignment.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
2305
2306
|
: yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
2306
|
-
|
|
2307
|
+
returnOrigin('');
|
|
2307
2308
|
if (leftCode === variable.name) {
|
|
2308
2309
|
const rightNode =
|
|
2309
2310
|
rightIndex.length === 1
|
|
@@ -2360,22 +2361,39 @@ export class View extends Annotatable {
|
|
|
2360
2361
|
],
|
|
2361
2362
|
function* warpForEachGenerator({ key, node: itemNode }) {
|
|
2362
2363
|
if (itemNode) {
|
|
2363
|
-
code += `
|
|
2364
|
+
code += `let __${key}_${node?.name}`;
|
|
2364
2365
|
let itemCode = '';
|
|
2366
|
+
// 匿名数据结构 / 未设置类型的List/map 才进getInitCode
|
|
2365
2367
|
if (
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2368
|
+
(
|
|
2369
|
+
asserts.isNewComposite(itemNode)
|
|
2370
|
+
&& itemNode.typeAnnotation?.typeKind === 'anonymousStructure'
|
|
2371
|
+
)
|
|
2372
|
+
|| (
|
|
2373
|
+
(asserts.isNewList(itemNode) || asserts.isNewMap(itemNode))
|
|
2374
|
+
&& !(itemNode?.typeAnnotation)
|
|
2375
|
+
)
|
|
2369
2376
|
) {
|
|
2370
|
-
|
|
2377
|
+
code += ' = ';
|
|
2378
|
+
itemCode += yield* itemNode?.getInitCode?.(shiftState(state, code, {
|
|
2371
2379
|
inline: true
|
|
2372
2380
|
})) ??
|
|
2373
|
-
|
|
2381
|
+
returnOrigin('');
|
|
2382
|
+
} else if (asserts.isNewComposite(itemNode) && itemNode.typeAnnotation?.typeKind === 'generic') { // new 带泛型的数据结构/实体 进这里
|
|
2383
|
+
code += ' = ';
|
|
2384
|
+
itemCode += (yield* itemNode?.getNewCompositeCode?.(shiftState(state, code, { inline: true }))) || 'null';
|
|
2385
|
+
} else if ((itemNode as any)?.typeAnnotation && !(asserts.isCallQueryComponent(itemNode) && !itemNode.isAutoInfer())) {
|
|
2386
|
+
code += ': ';
|
|
2387
|
+
code += yield* (itemNode as any)?.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
2388
|
+
returnOrigin('');
|
|
2374
2389
|
} else {
|
|
2390
|
+
code += ' = ';
|
|
2375
2391
|
itemCode = yield* itemNode?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
2376
2392
|
returnOrigin('');
|
|
2377
2393
|
}
|
|
2378
|
-
|
|
2394
|
+
if (itemCode) {
|
|
2395
|
+
code += yield* self.getRightCode(itemCode, assignment, itemNode);
|
|
2396
|
+
}
|
|
2379
2397
|
code += ';\n';
|
|
2380
2398
|
}
|
|
2381
2399
|
},
|
|
@@ -2541,10 +2559,16 @@ export class View extends Annotatable {
|
|
|
2541
2559
|
code += `export function ${viewName}_view`;
|
|
2542
2560
|
// 有参数长度
|
|
2543
2561
|
code += '(';
|
|
2562
|
+
if (this.params?.length > 0) {
|
|
2563
|
+
code += '{';
|
|
2564
|
+
}
|
|
2544
2565
|
this.params.forEach((param, index) => {
|
|
2545
2566
|
code += param.toNaturalTS(shiftState(state, code, { tabSize: 0 }));
|
|
2546
2567
|
if (index !== this.params.length - 1) code += ', ';
|
|
2547
2568
|
});
|
|
2569
|
+
if (this.params?.length > 0) {
|
|
2570
|
+
code += '}';
|
|
2571
|
+
}
|
|
2548
2572
|
code += ') {';
|
|
2549
2573
|
if (state.convertChildren && this.children?.length) {
|
|
2550
2574
|
code += '\n';
|
|
@@ -2559,10 +2583,16 @@ export class View extends Annotatable {
|
|
|
2559
2583
|
|
|
2560
2584
|
// 有参数长度
|
|
2561
2585
|
code += '(';
|
|
2586
|
+
if (this.params?.length > 0) {
|
|
2587
|
+
code += '{';
|
|
2588
|
+
}
|
|
2562
2589
|
this.params.forEach((param, index) => {
|
|
2563
2590
|
code += param.toNaturalTS(shiftState(state, code, { inline: true }));
|
|
2564
2591
|
if (index !== this.params.length - 1) code += ', ';
|
|
2565
2592
|
});
|
|
2593
|
+
if (this.params?.length > 0) {
|
|
2594
|
+
code += '}';
|
|
2595
|
+
}
|
|
2566
2596
|
code += ')';
|
|
2567
2597
|
|
|
2568
2598
|
code += ' {\n';
|
|
@@ -2573,7 +2603,35 @@ export class View extends Annotatable {
|
|
|
2573
2603
|
code += ';\n';
|
|
2574
2604
|
});
|
|
2575
2605
|
if (this.variables.length) code += '\n';
|
|
2606
|
+
if (!callback) {
|
|
2607
|
+
this.bindEvents.forEach((bindEvent) => {
|
|
2608
|
+
bindEvent.logics.forEach((logic) => {
|
|
2609
|
+
const logicCode = logic.toNaturalTS(
|
|
2610
|
+
shiftState(state, code, {
|
|
2611
|
+
tabSize: state.tabSize + 1,
|
|
2612
|
+
// declaration: true,
|
|
2613
|
+
autoPrefixName: true,
|
|
2614
|
+
})
|
|
2615
|
+
);
|
|
2616
|
+
code += logicCode.replace('function ', 'private function ');
|
|
2617
|
+
code += '\n';
|
|
2618
|
+
});
|
|
2619
|
+
if (bindEvent.logics.length) code += '\n';
|
|
2620
|
+
});
|
|
2576
2621
|
|
|
2622
|
+
this.logics.forEach((logic) => {
|
|
2623
|
+
const logicCode = logic.toNaturalTS(
|
|
2624
|
+
shiftState(state, code, {
|
|
2625
|
+
tabSize: state.tabSize + 1,
|
|
2626
|
+
declaration: true,
|
|
2627
|
+
autoPrefixName: true,
|
|
2628
|
+
})
|
|
2629
|
+
);
|
|
2630
|
+
code += logicCode.replace('declare function', 'function');
|
|
2631
|
+
code += '\n';
|
|
2632
|
+
});
|
|
2633
|
+
if (this.logics.length) code += '\n';
|
|
2634
|
+
}
|
|
2577
2635
|
if (callback) {
|
|
2578
2636
|
code += callback.call(this, state);
|
|
2579
2637
|
} else {
|
|
@@ -3129,15 +3187,17 @@ export class View extends Annotatable {
|
|
|
3129
3187
|
|
|
3130
3188
|
getSubLogics() {
|
|
3131
3189
|
const subLogics = this.findNaslNodeByBFS((node: BaseNode) => {
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3190
|
+
// 仅仅是为了处理数据源中的子逻辑,Logic 下面的,交由Logic 自己处理
|
|
3191
|
+
if (node?.concept === 'Logic') {
|
|
3192
|
+
return true;
|
|
3193
|
+
}
|
|
3194
|
+
if (node?.concept === 'SubLogic') {
|
|
3137
3195
|
return true;
|
|
3138
3196
|
}
|
|
3139
3197
|
});
|
|
3140
|
-
this.subLogics = subLogics
|
|
3198
|
+
this.subLogics = subLogics?.filter(node => {
|
|
3199
|
+
return asserts.isSubLogic(node);
|
|
3200
|
+
}) as Array<SubLogic>;
|
|
3141
3201
|
}
|
|
3142
3202
|
|
|
3143
3203
|
existingSubLogic: Set<string> = new Set<string>();
|
|
@@ -3697,9 +3757,9 @@ export const ComponentCompletionPropertyMap: Record<string, any> = {
|
|
|
3697
3757
|
prop: 'sorting',
|
|
3698
3758
|
label: '排序方式',
|
|
3699
3759
|
},
|
|
3700
|
-
filter:{
|
|
3701
|
-
prop:'filter',
|
|
3702
|
-
label:'筛选条件'
|
|
3760
|
+
filter: {
|
|
3761
|
+
prop: 'filter',
|
|
3762
|
+
label: '筛选条件'
|
|
3703
3763
|
},
|
|
3704
3764
|
},
|
|
3705
3765
|
List: {
|
|
@@ -378,6 +378,51 @@ export function initialize() {
|
|
|
378
378
|
}),
|
|
379
379
|
],
|
|
380
380
|
}),
|
|
381
|
+
new Structure({
|
|
382
|
+
name: 'TaskInst',
|
|
383
|
+
properties: [
|
|
384
|
+
new StructureProperty({
|
|
385
|
+
name: 'processDefUniqueKey',
|
|
386
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
387
|
+
}),
|
|
388
|
+
new StructureProperty({
|
|
389
|
+
name: 'processDefinitionId',
|
|
390
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
391
|
+
}),
|
|
392
|
+
new StructureProperty({
|
|
393
|
+
name: 'processInstanceId',
|
|
394
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
395
|
+
}),
|
|
396
|
+
new StructureProperty({
|
|
397
|
+
name: 'taskDefName',
|
|
398
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
399
|
+
}),
|
|
400
|
+
new StructureProperty({
|
|
401
|
+
name: 'taskTitle',
|
|
402
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
403
|
+
}),
|
|
404
|
+
new StructureProperty({
|
|
405
|
+
name: 'taskId',
|
|
406
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
407
|
+
}),
|
|
408
|
+
new StructureProperty({
|
|
409
|
+
name: 'completeBy',
|
|
410
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
411
|
+
}),
|
|
412
|
+
new StructureProperty({
|
|
413
|
+
name: 'finished',
|
|
414
|
+
typeAnnotation: TypeAnnotation.createPrimitive('Boolean'),
|
|
415
|
+
}),
|
|
416
|
+
new StructureProperty({
|
|
417
|
+
name: 'createTime',
|
|
418
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
419
|
+
}),
|
|
420
|
+
new StructureProperty({
|
|
421
|
+
name: 'completeTime',
|
|
422
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
423
|
+
}),
|
|
424
|
+
],
|
|
425
|
+
}),
|
|
381
426
|
);
|
|
382
427
|
|
|
383
428
|
processV2TypeList.push(
|
|
@@ -820,6 +865,24 @@ export function initialize() {
|
|
|
820
865
|
],
|
|
821
866
|
returns: [],
|
|
822
867
|
}),
|
|
868
|
+
new Logic({
|
|
869
|
+
name: 'getUsersForAddSign',
|
|
870
|
+
description: '查询可加签用户列表',
|
|
871
|
+
params: [
|
|
872
|
+
new Param({
|
|
873
|
+
name: 'taskId',
|
|
874
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
875
|
+
}),
|
|
876
|
+
],
|
|
877
|
+
returns: [
|
|
878
|
+
new Return({
|
|
879
|
+
name: 'result',
|
|
880
|
+
typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
881
|
+
typeArguments: [TypeAnnotation.createReference('LCAPUser', { typeNamespace: 'nasl.processV2' })],
|
|
882
|
+
}),
|
|
883
|
+
}),
|
|
884
|
+
],
|
|
885
|
+
}),
|
|
823
886
|
new Logic({
|
|
824
887
|
name: 'terminateProcess',
|
|
825
888
|
description: '终止',
|
|
@@ -919,6 +982,22 @@ export function initialize() {
|
|
|
919
982
|
}),
|
|
920
983
|
],
|
|
921
984
|
}),
|
|
985
|
+
new Logic({
|
|
986
|
+
name: 'getTaskInfo',
|
|
987
|
+
description: '查询流程任务信息',
|
|
988
|
+
params: [
|
|
989
|
+
new Param({
|
|
990
|
+
name: 'taskId',
|
|
991
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
992
|
+
}),
|
|
993
|
+
],
|
|
994
|
+
returns: [
|
|
995
|
+
new Return({
|
|
996
|
+
name: 'result',
|
|
997
|
+
typeAnnotation: TypeAnnotation.createReference('TaskInst', { typeNamespace: 'nasl.processV2' }),
|
|
998
|
+
}),
|
|
999
|
+
],
|
|
1000
|
+
}),
|
|
922
1001
|
];
|
|
923
1002
|
|
|
924
1003
|
const processComponents = [
|