@lcap/nasl 2.20.0-beta.4 → 2.20.1-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/2.14-components.d.ts +1115 -0
- package/out/automate/engine/2.14-components.js +1087 -0
- package/out/automate/engine/2.14-components.js.map +1 -0
- package/out/automate/engine/operators.d.ts +0 -9
- package/out/automate/engine/viewCache.d.ts +0 -1
- package/out/automate/template/myProcess.d.ts +0 -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/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +13 -0
- 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__.d.ts +9 -14
- package/out/concepts/Attribute__.js +12 -39
- 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 +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +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.map +1 -1
- package/out/concepts/CallLogic__.js +13 -6
- package/out/concepts/CallLogic__.js.map +1 -1
- 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__.js +8 -6
- 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/Destination__.js +1 -1
- 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 +1 -1
- package/out/concepts/EntityProperty__.js.map +1 -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 +1 -1
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +212 -0
- package/out/concepts/FrontendLibrary__.js +349 -0
- package/out/concepts/FrontendLibrary__.js.map +1 -0
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js.map +1 -1
- 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/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +26 -13
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +49 -49
- package/out/concepts/Module__.js +50 -50
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js.map +1 -1
- 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.map +1 -1
- 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__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js +3 -0
- 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__.d.ts +16 -0
- package/out/concepts/Slot__.js +43 -0
- 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 +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.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 +1 -1
- 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 +3 -0
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.d.ts +34 -0
- package/out/concepts/ViewBlock__.js +82 -0
- package/out/concepts/ViewBlock__.js.map +1 -0
- package/out/concepts/ViewComponent__.d.ts +85 -0
- package/out/concepts/ViewComponent__.js +104 -0
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -0
- package/out/concepts/View__.js +13 -8
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/index__.d.ts +2 -0
- package/out/concepts/index__.js +2 -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/permission.d.ts +1 -1
- package/out/server/getLogics.js +12 -0
- package/out/server/getLogics.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 +1 -1
- package/out/server/naslServer.js +70 -36
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +1 -1
- package/out/service/storage/init.js +1 -1
- package/out/service/storage/init.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/src/concepts/App__.ts +13 -0
- package/src/concepts/Attribute__.ts +10 -59
- package/src/concepts/BindAttribute__.ts +11 -12
- package/src/concepts/BindDirective__.ts +16 -1
- package/src/concepts/BindStyle__.ts +16 -1
- package/src/concepts/CallLogic__.ts +12 -37
- package/src/concepts/ConfigProperty__.ts +8 -6
- package/src/concepts/Destination__.ts +19 -1
- package/src/concepts/ExternalDestination__.ts +6 -6
- package/src/concepts/FrontendLibrary__.ts +518 -0
- package/src/concepts/Frontend__.ts +12 -1
- package/src/concepts/Identifier__.ts +9 -0
- package/src/concepts/Logic__.ts +27 -14
- package/src/concepts/Module__.ts +92 -121
- package/src/concepts/Param__.ts +4 -0
- package/src/concepts/ProcessElement__.ts +23 -1
- package/src/concepts/Process__.ts +16 -1
- package/src/concepts/Return__.ts +2 -0
- package/src/concepts/Slot__.ts +55 -0
- package/src/concepts/StringInterpolation__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +9 -9
- package/src/concepts/Variable__.ts +2 -0
- package/src/concepts/ViewBlock__.ts +91 -0
- package/src/concepts/ViewComponent__.ts +199 -0
- package/src/concepts/View__.ts +39 -10
- package/src/concepts/index__.ts +2 -0
- package/src/server/getLogics.ts +13 -0
- package/src/server/naslServer.ts +66 -34
- package/src/server/translator.ts +1 -1
- package/src/service/storage/init.ts +1 -1
- package/yarn-error.log +2087 -0
- package/sandbox/stdlib/dist/nasl.logging.js +0 -0
- package/sandbox/stdlib/dist/nasl.util.js +0 -0
- package/src/automate/engine/dist/index.dev.js +0 -517
- package/src/common/dist/BaseNode.js +0 -1101
- package/src/concepts/basics/stdlib/dist/nasl.util.js +0 -1602
- package/src/concepts/basics/stdlib/dist/reference2TypeAnnotationList.js +0 -24
- package/src/concepts/dist/BindAttribute__.js +0 -795
- package/src/concepts/dist/BindEvent__.js +0 -732
- package/src/concepts/dist/CallFunction__.js +0 -527
- package/src/concepts/dist/CallLogic__.js +0 -932
- package/src/concepts/dist/Destination__.js +0 -708
- package/src/concepts/dist/ExternalDestination__.js +0 -298
- package/src/concepts/dist/Identifier__.js +0 -311
- package/src/concepts/dist/StringInterpolation__.js +0 -231
- package/src/concepts/dist/TypeAnnotation__.js +0 -834
- package/src/concepts/dist/ViewElement__.js +0 -1692
- package/src/concepts/dist/View__.js +0 -1601
- package/src/generator/dist/genBundleFiles.js +0 -261
- package/src/generator/dist/genMetaData.js +0 -245
- package/src/generator/dist/permission.js +0 -405
- package/src/service/storage/dist/init.js +0 -579
- package/src/templator/dist/genEditTableBlock.js +0 -204
- package/src/templator/dist/genGridViewBlock.js +0 -265
- package/src/templator/dist/genListViewBlock.js +0 -84
- package/src/templator/dist/genTableBlock.js +0 -209
- package/src/templator/dist/utils.js +0 -527
|
@@ -182,7 +182,7 @@ export class Frontend extends BaseNode {
|
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
getViewExistingNames(excludedList: Array<View> = []) {
|
|
186
186
|
const excludedSet = new Set(excludedList);
|
|
187
187
|
return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
188
188
|
}
|
|
@@ -323,6 +323,7 @@ export class Frontend extends BaseNode {
|
|
|
323
323
|
return node;
|
|
324
324
|
}
|
|
325
325
|
|
|
326
|
+
|
|
326
327
|
getVarExistingNames(excludedList: Array<Variable> = []) {
|
|
327
328
|
const excludedSet = new Set(excludedList);
|
|
328
329
|
return ((this.variables as Variable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -464,6 +465,7 @@ export class Frontend extends BaseNode {
|
|
|
464
465
|
return node;
|
|
465
466
|
}
|
|
466
467
|
|
|
468
|
+
|
|
467
469
|
getModuleExistingNames(excludedList: Array<Module> = []) {
|
|
468
470
|
const excludedSet = new Set(excludedList);
|
|
469
471
|
return ((this.componentDependencies as Module[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -605,6 +607,9 @@ export class Frontend extends BaseNode {
|
|
|
605
607
|
return node;
|
|
606
608
|
}
|
|
607
609
|
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
608
613
|
/**
|
|
609
614
|
* 删除页面
|
|
610
615
|
* @param name 页面名称
|
|
@@ -653,6 +658,8 @@ export class Frontend extends BaseNode {
|
|
|
653
658
|
return params;
|
|
654
659
|
}
|
|
655
660
|
|
|
661
|
+
|
|
662
|
+
|
|
656
663
|
/**
|
|
657
664
|
* 删除变量
|
|
658
665
|
* @param name 变量名称
|
|
@@ -701,6 +708,8 @@ export class Frontend extends BaseNode {
|
|
|
701
708
|
return params;
|
|
702
709
|
}
|
|
703
710
|
|
|
711
|
+
|
|
712
|
+
|
|
704
713
|
/**
|
|
705
714
|
* 删除主题
|
|
706
715
|
* @param name 主题名称
|
|
@@ -749,6 +758,8 @@ export class Frontend extends BaseNode {
|
|
|
749
758
|
return params;
|
|
750
759
|
}
|
|
751
760
|
|
|
761
|
+
|
|
762
|
+
|
|
752
763
|
/**
|
|
753
764
|
* 删除模块
|
|
754
765
|
* @param name 模块名称
|
|
@@ -39,6 +39,8 @@ export class Identifier extends LogicItem {
|
|
|
39
39
|
@property()
|
|
40
40
|
name: string = undefined;
|
|
41
41
|
|
|
42
|
+
|
|
43
|
+
|
|
42
44
|
/**
|
|
43
45
|
* @param source 需要合并的部分参数
|
|
44
46
|
*/
|
|
@@ -52,6 +54,13 @@ export class Identifier extends LogicItem {
|
|
|
52
54
|
return super.from(source, parentNode, parentKey) as Identifier;
|
|
53
55
|
}
|
|
54
56
|
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
55
64
|
//================================================================================
|
|
56
65
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
57
66
|
// 自动生成的代码已结束。下面可以手动编写。
|
package/src/concepts/Logic__.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FrontendLibrary } from './FrontendLibrary__';
|
|
1
2
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, embeddedTSEmitter } from '../translator';
|
|
2
3
|
import Namespace from './Namespace__';
|
|
3
4
|
import CallQueryComponent from './CallQueryComponent__';
|
|
@@ -1611,19 +1612,28 @@ export class Logic extends BaseNode {
|
|
|
1611
1612
|
const needGetSourceMapOqlList: Promise<any>[] = [];
|
|
1612
1613
|
this.traverseChildren((el) => {
|
|
1613
1614
|
if (el && (el instanceof BatchAssignment || (el instanceof Assignment && el.left?.name))) {
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1615
|
+
if (el instanceof Assignment) {
|
|
1616
|
+
const advanceVar = this.variables?.find((variable) => !variable.typeAnnotation && (el.left?.name === variable.name));
|
|
1617
|
+
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1618
|
+
advanceMap.set(advanceVar, el);
|
|
1619
|
+
}
|
|
1620
|
+
const advanceRn = this.returns?.find((ret) => !ret.typeAnnotation && el.left?.name === ret.name);
|
|
1621
|
+
if (advanceRn && !advanceMap.get(advanceRn)) {
|
|
1622
|
+
advanceMap.set(advanceRn, el);
|
|
1623
|
+
}
|
|
1624
|
+
} else if (el instanceof BatchAssignment) {
|
|
1625
|
+
el.assignmentLines.forEach(({ leftIndex }) => {
|
|
1626
|
+
const leftCode
|
|
1627
|
+
= leftIndex.length === 1 ? el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true })) : el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1628
|
+
const advanceVar = this.variables?.find((variable) => !variable.typeAnnotation && (leftCode === variable.name));
|
|
1629
|
+
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1630
|
+
advanceMap.set(advanceVar, el);
|
|
1631
|
+
}
|
|
1632
|
+
const advanceRn = this.returns?.find((ret) => !ret.typeAnnotation && leftCode === ret.name);
|
|
1633
|
+
if (advanceRn && !advanceMap.get(advanceRn)) {
|
|
1634
|
+
advanceMap.set(advanceRn, el);
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1627
1637
|
}
|
|
1628
1638
|
}
|
|
1629
1639
|
// 如果有sql查询组件就需要把他们存起来
|
|
@@ -1904,7 +1914,10 @@ export class Logic extends BaseNode {
|
|
|
1904
1914
|
* @param name 一般不用传,用于 rename
|
|
1905
1915
|
*/
|
|
1906
1916
|
getEmbeddedFilePath(name = this.name) {
|
|
1907
|
-
|
|
1917
|
+
let _path = this.module ? `/${this.module.parentKey}/${this.module.name}` : '';
|
|
1918
|
+
if (this.parentNode instanceof FrontendLibrary) {
|
|
1919
|
+
_path += `/frontends/${this.parentNode.type}`;
|
|
1920
|
+
}
|
|
1908
1921
|
return `/embedded/${this.app.name}${_path}/logics/${name}.ts`;
|
|
1909
1922
|
}
|
|
1910
1923
|
|
package/src/concepts/Module__.ts
CHANGED
|
@@ -24,6 +24,7 @@ import Interface from './Interface__';
|
|
|
24
24
|
import View from './View__';
|
|
25
25
|
import Variable from './Variable__';
|
|
26
26
|
import Process from './Process__';
|
|
27
|
+
import FrontendLibrary from './FrontendLibrary__';
|
|
27
28
|
import ViewComponent from './ViewComponent__';
|
|
28
29
|
import Configuration from './Configuration__';
|
|
29
30
|
import App from './App__';
|
|
@@ -130,10 +131,10 @@ export class Module extends BaseNode {
|
|
|
130
131
|
processes: Array<Process> = [];
|
|
131
132
|
|
|
132
133
|
/**
|
|
133
|
-
*
|
|
134
|
+
* 端包列表
|
|
134
135
|
*/
|
|
135
|
-
@property('
|
|
136
|
-
|
|
136
|
+
@property('FrontendLibrary')
|
|
137
|
+
frontends: Array<FrontendLibrary> = [];
|
|
137
138
|
|
|
138
139
|
/**
|
|
139
140
|
* 配置管理
|
|
@@ -172,9 +173,8 @@ export class Module extends BaseNode {
|
|
|
172
173
|
}
|
|
173
174
|
return params;
|
|
174
175
|
}
|
|
175
|
-
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
getDataSourceExistingNames(excludedList: Array<DataSource> = []) {
|
|
178
178
|
const excludedSet = new Set(excludedList);
|
|
179
179
|
return ((this.dataSources as DataSource[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
180
180
|
}
|
|
@@ -315,7 +315,6 @@ export class Module extends BaseNode {
|
|
|
315
315
|
return node;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
|
|
319
318
|
getStructureExistingNames(excludedList: Array<Structure> = []) {
|
|
320
319
|
const excludedSet = new Set(excludedList);
|
|
321
320
|
return ((this.structures as Structure[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -457,7 +456,6 @@ export class Module extends BaseNode {
|
|
|
457
456
|
return node;
|
|
458
457
|
}
|
|
459
458
|
|
|
460
|
-
|
|
461
459
|
getEnumExistingNames(excludedList: Array<Enum> = []) {
|
|
462
460
|
const excludedSet = new Set(excludedList);
|
|
463
461
|
return ((this.enums as Enum[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -599,7 +597,6 @@ export class Module extends BaseNode {
|
|
|
599
597
|
return node;
|
|
600
598
|
}
|
|
601
599
|
|
|
602
|
-
|
|
603
600
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
604
601
|
const excludedSet = new Set(excludedList);
|
|
605
602
|
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -741,7 +738,6 @@ export class Module extends BaseNode {
|
|
|
741
738
|
return node;
|
|
742
739
|
}
|
|
743
740
|
|
|
744
|
-
|
|
745
741
|
getInterfaceExistingNames(excludedList: Array<Interface> = []) {
|
|
746
742
|
const excludedSet = new Set(excludedList);
|
|
747
743
|
return ((this.interfaces as Interface[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -883,7 +879,6 @@ export class Module extends BaseNode {
|
|
|
883
879
|
return node;
|
|
884
880
|
}
|
|
885
881
|
|
|
886
|
-
|
|
887
882
|
getViewExistingNames(excludedList: Array<View> = []) {
|
|
888
883
|
const excludedSet = new Set(excludedList);
|
|
889
884
|
return ((this.views as View[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1025,7 +1020,6 @@ export class Module extends BaseNode {
|
|
|
1025
1020
|
return node;
|
|
1026
1021
|
}
|
|
1027
1022
|
|
|
1028
|
-
|
|
1029
1023
|
getVarExistingNames(excludedList: Array<Variable> = []) {
|
|
1030
1024
|
const excludedSet = new Set(excludedList);
|
|
1031
1025
|
return ((this.frontendVariables as Variable[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1167,7 +1161,6 @@ export class Module extends BaseNode {
|
|
|
1167
1161
|
return node;
|
|
1168
1162
|
}
|
|
1169
1163
|
|
|
1170
|
-
|
|
1171
1164
|
getProcessExistingNames(excludedList: Array<Process> = []) {
|
|
1172
1165
|
const excludedSet = new Set(excludedList);
|
|
1173
1166
|
return ((this.processes as Process[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -1309,151 +1302,147 @@ export class Module extends BaseNode {
|
|
|
1309
1302
|
return node;
|
|
1310
1303
|
}
|
|
1311
1304
|
|
|
1312
|
-
|
|
1313
|
-
getViewComponentExistingNames(excludedList: Array<ViewComponent> = []) {
|
|
1305
|
+
getFrontendLibraryExistingNames(excludedList: Array<FrontendLibrary> = []) {
|
|
1314
1306
|
const excludedSet = new Set(excludedList);
|
|
1315
|
-
return ((this.
|
|
1307
|
+
return ((this.frontends as FrontendLibrary[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1316
1308
|
}
|
|
1317
|
-
|
|
1318
|
-
return utils.unique(name, this.
|
|
1309
|
+
getFrontendLibraryUniqueName(name = 'frontendLibrary1') {
|
|
1310
|
+
return utils.unique(name, this.getFrontendLibraryExistingNames(), undefined, false);
|
|
1319
1311
|
}
|
|
1320
1312
|
|
|
1321
1313
|
/**
|
|
1322
|
-
*
|
|
1314
|
+
* 插入端包
|
|
1323
1315
|
* @internal
|
|
1324
|
-
* @param name
|
|
1316
|
+
* @param name 端包名称,如果不填会自动生成一个唯一名称
|
|
1325
1317
|
*/
|
|
1326
|
-
|
|
1318
|
+
_insertFrontendLibraryAt(name: string, index: number): FrontendLibrary;
|
|
1327
1319
|
|
|
1328
1320
|
/**
|
|
1329
|
-
*
|
|
1321
|
+
* 插入端包
|
|
1330
1322
|
* @internal
|
|
1331
|
-
* @param
|
|
1323
|
+
* @param frontendLibraryOptions 端包参数
|
|
1332
1324
|
*/
|
|
1333
|
-
|
|
1325
|
+
_insertFrontendLibraryAt(frontendLibraryOptions: Partial<FrontendLibrary>, index: number): FrontendLibrary;
|
|
1334
1326
|
|
|
1335
1327
|
/**
|
|
1336
|
-
*
|
|
1328
|
+
* 插入端包
|
|
1337
1329
|
* @internal
|
|
1338
|
-
* @param
|
|
1330
|
+
* @param frontendLibrary 已有的端包实例
|
|
1339
1331
|
*/
|
|
1340
|
-
|
|
1332
|
+
_insertFrontendLibraryAt(frontendLibrary: FrontendLibrary, index: number): FrontendLibrary;
|
|
1341
1333
|
|
|
1342
|
-
|
|
1343
|
-
const
|
|
1344
|
-
const relationOptions = { parentNode: this, parentKey: '
|
|
1345
|
-
let
|
|
1334
|
+
_insertFrontendLibraryAt(options: string | Partial<FrontendLibrary> | FrontendLibrary, index: number) {
|
|
1335
|
+
const frontendLibraryOptions: any = {};
|
|
1336
|
+
const relationOptions = { parentNode: this, parentKey: 'frontends' };
|
|
1337
|
+
let frontendLibrary: FrontendLibrary;
|
|
1346
1338
|
if (!options) {
|
|
1347
|
-
|
|
1348
|
-
...
|
|
1349
|
-
name: this.
|
|
1350
|
-
}, this, '
|
|
1339
|
+
frontendLibrary = FrontendLibrary.from({
|
|
1340
|
+
...frontendLibraryOptions,
|
|
1341
|
+
name: this.getFrontendLibraryUniqueName(),
|
|
1342
|
+
}, this, 'frontends');
|
|
1351
1343
|
} else if (typeof options === 'string') {
|
|
1352
|
-
|
|
1353
|
-
...
|
|
1344
|
+
frontendLibrary = FrontendLibrary.from({
|
|
1345
|
+
...frontendLibraryOptions,
|
|
1354
1346
|
name: options,
|
|
1355
|
-
}, this, '
|
|
1356
|
-
} else if (options instanceof
|
|
1347
|
+
}, this, 'frontends');
|
|
1348
|
+
} else if (options instanceof FrontendLibrary) {
|
|
1357
1349
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1358
|
-
|
|
1359
|
-
Object.assign(
|
|
1350
|
+
frontendLibrary = options;
|
|
1351
|
+
Object.assign(frontendLibrary, relationOptions);
|
|
1360
1352
|
} else {
|
|
1361
|
-
|
|
1362
|
-
...
|
|
1353
|
+
frontendLibrary = FrontendLibrary.from({
|
|
1354
|
+
...frontendLibraryOptions,
|
|
1363
1355
|
...options,
|
|
1364
|
-
}, this, '
|
|
1356
|
+
}, this, 'frontends');
|
|
1365
1357
|
}
|
|
1366
|
-
this.
|
|
1367
|
-
return
|
|
1358
|
+
this.frontends.splice(index, 0, frontendLibrary);
|
|
1359
|
+
return frontendLibrary;
|
|
1368
1360
|
}
|
|
1369
1361
|
|
|
1370
1362
|
/**
|
|
1371
|
-
*
|
|
1372
|
-
* @param name
|
|
1363
|
+
* 插入端包
|
|
1364
|
+
* @param name 端包名称,如果不填会自动生成一个唯一名称
|
|
1373
1365
|
*/
|
|
1374
|
-
|
|
1366
|
+
insertFrontendLibraryAt(name: string, index: number): FrontendLibrary;
|
|
1375
1367
|
|
|
1376
1368
|
/**
|
|
1377
|
-
*
|
|
1378
|
-
* @param
|
|
1369
|
+
* 插入端包
|
|
1370
|
+
* @param frontendLibraryOptions 端包参数
|
|
1379
1371
|
*/
|
|
1380
|
-
|
|
1372
|
+
insertFrontendLibraryAt(frontendLibraryOptions: Partial<FrontendLibrary>, index: number): FrontendLibrary;
|
|
1381
1373
|
|
|
1382
1374
|
/**
|
|
1383
|
-
*
|
|
1384
|
-
* @param
|
|
1375
|
+
* 插入端包
|
|
1376
|
+
* @param frontendLibrary 已有的端包实例
|
|
1385
1377
|
*/
|
|
1386
|
-
|
|
1378
|
+
insertFrontendLibraryAt(frontendLibrary: FrontendLibrary, index: number): FrontendLibrary;
|
|
1387
1379
|
|
|
1388
|
-
|
|
1389
|
-
const node = this.
|
|
1380
|
+
insertFrontendLibraryAt(options: string | Partial<FrontendLibrary> | FrontendLibrary, index: number) {
|
|
1381
|
+
const node = this._insertFrontendLibraryAt(options as any, index);
|
|
1390
1382
|
node.create({
|
|
1391
1383
|
index,
|
|
1392
1384
|
parentNode: this,
|
|
1393
|
-
parentKey: '
|
|
1385
|
+
parentKey: 'frontends',
|
|
1394
1386
|
});
|
|
1395
1387
|
return node;
|
|
1396
1388
|
}
|
|
1397
1389
|
|
|
1398
1390
|
/**
|
|
1399
|
-
*
|
|
1391
|
+
* 添加端包
|
|
1400
1392
|
* @internal
|
|
1401
|
-
* @param name
|
|
1393
|
+
* @param name 端包名称,如果不填会自动生成一个唯一名称
|
|
1402
1394
|
*/
|
|
1403
|
-
|
|
1395
|
+
_addFrontendLibrary(name?: string): FrontendLibrary;
|
|
1404
1396
|
|
|
1405
1397
|
/**
|
|
1406
|
-
*
|
|
1398
|
+
* 添加端包
|
|
1407
1399
|
* @internal
|
|
1408
|
-
* @param
|
|
1400
|
+
* @param frontendLibraryOptions 端包参数
|
|
1409
1401
|
*/
|
|
1410
|
-
|
|
1402
|
+
_addFrontendLibrary(frontendLibraryOptions: Partial<FrontendLibrary>): FrontendLibrary;
|
|
1411
1403
|
|
|
1412
1404
|
/**
|
|
1413
|
-
*
|
|
1405
|
+
* 添加端包
|
|
1414
1406
|
* @internal
|
|
1415
|
-
* @param
|
|
1407
|
+
* @param frontendLibrary 已有的端包实例
|
|
1416
1408
|
*/
|
|
1417
|
-
|
|
1409
|
+
_addFrontendLibrary(frontendLibrary: FrontendLibrary): FrontendLibrary;
|
|
1418
1410
|
|
|
1419
|
-
|
|
1420
|
-
const index = this.
|
|
1421
|
-
return this.
|
|
1411
|
+
_addFrontendLibrary(options?: string | Partial<FrontendLibrary> | FrontendLibrary) {
|
|
1412
|
+
const index = this.frontends.length;
|
|
1413
|
+
return this._insertFrontendLibraryAt(options as any, index);
|
|
1422
1414
|
}
|
|
1423
1415
|
|
|
1424
1416
|
/**
|
|
1425
|
-
*
|
|
1417
|
+
* 添加端包
|
|
1426
1418
|
* @internal
|
|
1427
|
-
* @param name
|
|
1419
|
+
* @param name 端包名称,如果不填会自动生成一个唯一名称
|
|
1428
1420
|
*/
|
|
1429
|
-
|
|
1421
|
+
addFrontendLibrary(name?: string): FrontendLibrary;
|
|
1430
1422
|
|
|
1431
1423
|
/**
|
|
1432
|
-
*
|
|
1433
|
-
* @param
|
|
1424
|
+
* 添加端包
|
|
1425
|
+
* @param frontendLibraryOptions 端包参数
|
|
1434
1426
|
*/
|
|
1435
|
-
|
|
1427
|
+
addFrontendLibrary(frontendLibraryOptions: Partial<FrontendLibrary>): FrontendLibrary;
|
|
1436
1428
|
|
|
1437
1429
|
/**
|
|
1438
|
-
*
|
|
1439
|
-
* @param
|
|
1430
|
+
* 添加端包
|
|
1431
|
+
* @param frontendLibrary 已有的端包实例
|
|
1440
1432
|
*/
|
|
1441
|
-
|
|
1433
|
+
addFrontendLibrary(frontendLibrary: FrontendLibrary): FrontendLibrary;
|
|
1442
1434
|
|
|
1443
|
-
|
|
1444
|
-
const node = this.
|
|
1445
|
-
const index = this.
|
|
1435
|
+
addFrontendLibrary(options?: string | Partial<FrontendLibrary> | FrontendLibrary) {
|
|
1436
|
+
const node = this._addFrontendLibrary(options as any);
|
|
1437
|
+
const index = this.frontends.indexOf(node);
|
|
1446
1438
|
node.create({
|
|
1447
1439
|
index,
|
|
1448
1440
|
parentNode: this,
|
|
1449
|
-
parentKey: '
|
|
1441
|
+
parentKey: 'frontends',
|
|
1450
1442
|
});
|
|
1451
1443
|
return node;
|
|
1452
1444
|
}
|
|
1453
1445
|
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
1446
|
/**
|
|
1458
1447
|
* 删除数据源
|
|
1459
1448
|
* @param name 数据源名称
|
|
@@ -1502,8 +1491,6 @@ export class Module extends BaseNode {
|
|
|
1502
1491
|
return params;
|
|
1503
1492
|
}
|
|
1504
1493
|
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
1494
|
/**
|
|
1508
1495
|
* 删除数据结构
|
|
1509
1496
|
* @param name 数据结构名称
|
|
@@ -1552,8 +1539,6 @@ export class Module extends BaseNode {
|
|
|
1552
1539
|
return params;
|
|
1553
1540
|
}
|
|
1554
1541
|
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
1542
|
/**
|
|
1558
1543
|
* 删除枚举
|
|
1559
1544
|
* @param name 枚举名称
|
|
@@ -1602,8 +1587,6 @@ export class Module extends BaseNode {
|
|
|
1602
1587
|
return params;
|
|
1603
1588
|
}
|
|
1604
1589
|
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
1590
|
/**
|
|
1608
1591
|
* 删除逻辑
|
|
1609
1592
|
* @param name 逻辑名称
|
|
@@ -1652,8 +1635,6 @@ export class Module extends BaseNode {
|
|
|
1652
1635
|
return params;
|
|
1653
1636
|
}
|
|
1654
1637
|
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
1638
|
/**
|
|
1658
1639
|
* 删除接口
|
|
1659
1640
|
* @param name 接口名称
|
|
@@ -1702,8 +1683,6 @@ export class Module extends BaseNode {
|
|
|
1702
1683
|
return params;
|
|
1703
1684
|
}
|
|
1704
1685
|
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
1686
|
/**
|
|
1708
1687
|
* 删除页面
|
|
1709
1688
|
* @param name 页面名称
|
|
@@ -1752,8 +1731,6 @@ export class Module extends BaseNode {
|
|
|
1752
1731
|
return params;
|
|
1753
1732
|
}
|
|
1754
1733
|
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
1734
|
/**
|
|
1758
1735
|
* 删除变量
|
|
1759
1736
|
* @param name 变量名称
|
|
@@ -1802,8 +1779,6 @@ export class Module extends BaseNode {
|
|
|
1802
1779
|
return params;
|
|
1803
1780
|
}
|
|
1804
1781
|
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
1782
|
/**
|
|
1808
1783
|
* 删除流程
|
|
1809
1784
|
* @param name 流程名称
|
|
@@ -1852,49 +1827,47 @@ export class Module extends BaseNode {
|
|
|
1852
1827
|
return params;
|
|
1853
1828
|
}
|
|
1854
1829
|
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
1830
|
/**
|
|
1858
|
-
*
|
|
1859
|
-
* @param name
|
|
1831
|
+
* 删除端包
|
|
1832
|
+
* @param name 端包名称
|
|
1860
1833
|
*/
|
|
1861
|
-
|
|
1834
|
+
removeFrontendLibrary(name: string): void;
|
|
1862
1835
|
|
|
1863
1836
|
/**
|
|
1864
|
-
*
|
|
1865
|
-
* @param
|
|
1837
|
+
* 删除端包
|
|
1838
|
+
* @param frontendLibrary 已有的端包实例
|
|
1866
1839
|
*/
|
|
1867
|
-
|
|
1840
|
+
removeFrontendLibrary(frontendLibrary: FrontendLibrary): void;
|
|
1868
1841
|
|
|
1869
|
-
|
|
1870
|
-
let
|
|
1842
|
+
removeFrontendLibrary(options: string | FrontendLibrary) {
|
|
1843
|
+
let frontendLibrary: FrontendLibrary;
|
|
1871
1844
|
if (typeof options === 'string') {
|
|
1872
|
-
|
|
1873
|
-
if (!
|
|
1874
|
-
throw new Error('
|
|
1845
|
+
frontendLibrary = (this.frontends as FrontendLibrary[]).find((item) => item.name === options);
|
|
1846
|
+
if (!frontendLibrary) {
|
|
1847
|
+
throw new Error('找不到端包 ' + options);
|
|
1875
1848
|
}
|
|
1876
1849
|
} else {
|
|
1877
|
-
|
|
1850
|
+
frontendLibrary = options;
|
|
1878
1851
|
}
|
|
1879
|
-
return
|
|
1852
|
+
return frontendLibrary.delete();
|
|
1880
1853
|
}
|
|
1881
1854
|
|
|
1882
|
-
|
|
1883
|
-
const parentKey =
|
|
1855
|
+
__removeFrontendLibrary(frontendLibrary: FrontendLibrary) {
|
|
1856
|
+
const parentKey = frontendLibrary.parentKey;
|
|
1884
1857
|
const params: Params = {
|
|
1885
1858
|
parentNode: this,
|
|
1886
1859
|
parentKey,
|
|
1887
1860
|
index: -1,
|
|
1888
1861
|
object: null,
|
|
1889
|
-
oldObject:
|
|
1862
|
+
oldObject: frontendLibrary,
|
|
1890
1863
|
};
|
|
1891
1864
|
if (parentKey) {
|
|
1892
1865
|
params.parentKey = parentKey;
|
|
1893
1866
|
if (Array.isArray((this as any)[parentKey])) {
|
|
1894
|
-
const index = (this as any)[parentKey].indexOf(
|
|
1867
|
+
const index = (this as any)[parentKey].indexOf(frontendLibrary);
|
|
1895
1868
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
1896
1869
|
params.index = index;
|
|
1897
|
-
} else if ((this as any)[parentKey] ===
|
|
1870
|
+
} else if ((this as any)[parentKey] === frontendLibrary) {
|
|
1898
1871
|
params.index = 0;
|
|
1899
1872
|
(this as any)[parentKey] = undefined;
|
|
1900
1873
|
}
|
|
@@ -1902,8 +1875,6 @@ export class Module extends BaseNode {
|
|
|
1902
1875
|
return params;
|
|
1903
1876
|
}
|
|
1904
1877
|
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
1878
|
/**
|
|
1908
1879
|
* 删除配置管理
|
|
1909
1880
|
* @param name 配置管理名称
|