@lcap/nasl 3.6.0-alpha.1 → 3.6.0-alpha.2
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/bak/translator.js +119 -39
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.d.ts +3 -0
- package/out/breakpoint/generator/BreakpointNode.js +9 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/shared/constants.js +1 -0
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/utils.js +12 -6
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/breakpoint/store/core.js +1 -1
- package/out/breakpoint/store/core.js.map +1 -1
- package/out/common/BaseNode.d.ts +1 -4
- package/out/common/BaseNode.js +23 -37
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +6 -1
- package/out/concepts/AnonymousFunction__.js +34 -16
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +55 -51
- package/out/concepts/App__.js +76 -80
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +10 -2
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +16 -6
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +1 -0
- package/out/concepts/BindDirective__.js +19 -4
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +3 -1
- package/out/concepts/BindEvent__.js +39 -14
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BusinessComponent__.d.ts +641 -0
- package/out/concepts/BusinessComponent__.js +1921 -0
- package/out/concepts/BusinessComponent__.js.map +1 -0
- package/out/concepts/BusinessLogic__.d.ts +38 -0
- package/out/concepts/BusinessLogic__.js +358 -0
- package/out/concepts/BusinessLogic__.js.map +1 -0
- package/out/concepts/CallEvent__.d.ts +101 -0
- package/out/concepts/CallEvent__.js +280 -0
- package/out/concepts/CallEvent__.js.map +1 -0
- package/out/concepts/CallFunction__.d.ts +0 -1
- package/out/concepts/CallFunction__.js +10 -10
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +2 -0
- package/out/concepts/CallLogic__.js +38 -27
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Constant__.js +7 -6
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +1 -1
- package/out/concepts/Destination__.js +7 -5
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +2 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/Event__.d.ts +14 -0
- package/out/concepts/Event__.js +61 -0
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/FrontendType__.d.ts +308 -0
- package/out/concepts/FrontendType__.js +605 -0
- package/out/concepts/FrontendType__.js.map +1 -0
- package/out/concepts/Frontend__.d.ts +0 -88
- package/out/concepts/Frontend__.js +1 -143
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +5 -0
- package/out/concepts/Identifier__.js +19 -9
- 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 +3 -1
- package/out/concepts/Logic__.js +31 -21
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Match__.d.ts +1 -1
- package/out/concepts/MemberExpression__.d.ts +1 -1
- package/out/concepts/MemberExpression__.js +3 -3
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/ParamWithGroup__.d.ts +39 -0
- package/out/concepts/ParamWithGroup__.js +85 -0
- package/out/concepts/ParamWithGroup__.js.map +1 -0
- package/out/concepts/Param__.js +11 -3
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +9 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Return__.js +17 -9
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +2 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +17 -8
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +17 -1
- package/out/concepts/ViewElement__.js +145 -16
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +21 -20
- package/out/concepts/View__.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/concepts/utils/asserts.d.ts +258 -3
- package/out/concepts/utils/asserts.js +351 -13
- package/out/concepts/utils/asserts.js.map +1 -1
- package/out/concepts/utils/types.d.ts +20 -3
- package/out/generator/genBundleFiles.js +25 -11
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +12 -3
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/permission.js +3 -3
- package/out/generator/permission.js.map +1 -1
- package/out/natural/transformTSCode.js +1 -1
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/extendBaseNode.js +6 -4
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/getLogics.js +62 -27
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +6 -1
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.js +3 -3
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.js +40 -19
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +6 -1
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +1 -2
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -6
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +16 -16
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +36 -36
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +6 -5
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +12 -12
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +4 -4
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +3 -3
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +10 -10
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +10 -9
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +2 -2
- package/out/templator/utils.js.map +1 -1
- package/out/translator/utils.js +12 -1
- package/out/translator/utils.js.map +1 -1
- package/out/utils/i18nInfo.js +7 -2
- package/out/utils/i18nInfo.js.map +1 -1
- package/out/utils/index.d.ts +17 -0
- package/out/utils/index.js +184 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +2 -2
- package/src/bak/translator.js +121 -43
- package/src/breakpoint/generator/BreakpointNode.ts +12 -0
- package/src/breakpoint/shared/constants.ts +1 -0
- package/src/breakpoint/shared/utils.ts +13 -8
- package/src/breakpoint/store/core.ts +1 -1
- package/src/common/BaseNode.ts +22 -41
- package/src/concepts/AnonymousFunction__.ts +36 -18
- package/src/concepts/App__.ts +129 -130
- package/src/concepts/BackendVariable__.ts +10 -2
- package/src/concepts/BindAttribute__.ts +14 -6
- package/src/concepts/BindDirective__.ts +19 -4
- package/src/concepts/BindEvent__.ts +41 -13
- package/src/concepts/BusinessComponent__.ts +2693 -0
- package/src/concepts/BusinessLogic__.ts +376 -0
- package/src/concepts/CallEvent__.ts +351 -0
- package/src/concepts/CallFunction__.ts +10 -13
- package/src/concepts/CallLogic__.ts +45 -32
- package/src/concepts/Constant__.ts +5 -7
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/Event__.ts +70 -0
- package/src/concepts/FrontendType__.ts +919 -0
- package/src/concepts/Frontend__.ts +3 -251
- package/src/concepts/Identifier__.ts +29 -13
- package/src/concepts/LogicItem__.ts +1 -0
- package/src/concepts/Logic__.ts +36 -23
- package/src/concepts/MemberExpression__.ts +3 -3
- package/src/concepts/NewComposite__.ts +4 -6
- package/src/concepts/ParamWithGroup__.ts +101 -0
- package/src/concepts/Param__.ts +11 -3
- package/src/concepts/ProcessElement__.ts +8 -1
- package/src/concepts/Return__.ts +15 -12
- package/src/concepts/ValidationRule__.ts +6 -1
- package/src/concepts/Variable__.ts +17 -9
- package/src/concepts/ViewElement__.ts +168 -33
- package/src/concepts/View__.ts +23 -20
- package/src/concepts/index__.ts +5 -0
- package/src/concepts/utils/asserts.ts +367 -4
- package/src/concepts/utils/types.ts +28 -0
- package/src/generator/genBundleFiles.ts +33 -15
- package/src/generator/genReleaseBody.ts +14 -3
- package/src/generator/permission.ts +8 -6
- package/src/natural/transformTSCode.ts +1 -1
- package/src/server/extendBaseNode.ts +22 -20
- package/src/server/getLogics.ts +79 -41
- package/src/server/getMemberIdentifier.ts +7 -1
- package/src/server/getProcesses.ts +3 -3
- package/src/server/naslServer.ts +44 -20
- package/src/server/translator.ts +7 -1
- package/src/service/storage/init.ts +1 -2
- package/src/templator/genCreateBlock.ts +6 -6
- package/src/templator/genCurdEditMultipleKeyBlock.ts +16 -16
- package/src/templator/genCurdMultipleKeyBlock.ts +36 -36
- package/src/templator/genGetBlock.ts +6 -5
- package/src/templator/genGridViewBlock.ts +12 -12
- package/src/templator/genListViewBlock.ts +4 -4
- package/src/templator/genSelectBlock.ts +3 -3
- package/src/templator/genTableBlock.ts +10 -10
- package/src/templator/genUpdateBlock.ts +10 -9
- package/src/templator/utils.ts +2 -2
- package/src/translator/utils.ts +12 -1
- package/src/utils/i18nInfo.ts +7 -2
- package/src/utils/index.ts +211 -1
- package/test/concepts/call-function/fixtures/from-string.json +68 -59
- package/test/concepts/call-function/fixtures/to-string-global-tz.json +67 -58
- package/test/concepts/call-function/fixtures/to-string-no-tz.json +57 -48
- package/test/concepts/call-function/fixtures/to-string-user-tz.json +69 -60
- package/test/concepts/call-function/fixtures/to-string-utc-tz.json +69 -60
- package/test/concepts/call-interface/fixtures/only-interface.json +81 -72
- package/test/concepts/call-interface/fixtures/with-body-complex-argument.json +223 -214
- package/test/concepts/call-interface/fixtures/with-body-no-argument.json +85 -76
- package/test/concepts/call-interface/fixtures/with-body-simple-argument.json +100 -91
- package/test/concepts/call-interface/fixtures/with-headers-no-argument.json +88 -79
- package/test/concepts/call-interface/fixtures/with-headers.json +90 -81
- package/test/concepts/call-interface/fixtures/with-query-no-argument.json +88 -79
- package/test/concepts/call-interface/fixtures/with-query.json +90 -81
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +4 -2
- package/test/concepts/call-logic/fixtures/entries-get-with-arguments.json +104 -95
- package/test/concepts/call-logic/fixtures/entries-update-with-arguments.json +209 -200
- package/test/concepts/call-logic/fixtures/global-logic-argument-no-expression.json +97 -88
- package/test/concepts/call-logic/fixtures/global-logic-argument-some-expression.json +124 -115
- package/test/concepts/call-logic/fixtures/json-deserialize.json +120 -111
- package/test/concepts/call-logic/fixtures/json-serialize-with-string.json +124 -115
- package/test/concepts/call-logic/fixtures/json-serialize.json +124 -115
- package/test/concepts/call-logic/fixtures/view-buildin-logic-with-argument.json +91 -82
- package/test/concepts/call-logic/fixtures/view-component-logic-no-argument.json +88 -79
- package/test/concepts/call-logic/fixtures/view-component-with-validation.json +144 -135
- package/test/concepts/identifier/fixtures/view-variable.json +145 -136
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +1 -1
- package/test/concepts/view-element/fixtures/default-login.json +221 -212
- package/test/concepts/view-element/fixtures/default-not-found.json +183 -174
- package/test/concepts/view-element/fixtures/with-role-auth.json +91 -82
- package/test/concepts/view-element/fixtures/with-table.json +1894 -1885
- package/test/concepts/view-element/toVue.spec.ts +1 -0
- package/ts-worker/package.json +1 -1
- package/ts-worker/src/index.js +1 -0
package/out/concepts/App__.js
CHANGED
|
@@ -78,9 +78,9 @@ let App = App_1 = class App extends BaseNode_1.default {
|
|
|
78
78
|
*/
|
|
79
79
|
this.interfaces = [];
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* 端类型列表
|
|
82
82
|
*/
|
|
83
|
-
this.
|
|
83
|
+
this.frontendTypes = [];
|
|
84
84
|
/**
|
|
85
85
|
* 后端
|
|
86
86
|
*/
|
|
@@ -625,64 +625,66 @@ let App = App_1 = class App extends BaseNode_1.default {
|
|
|
625
625
|
getAbstractInterfaceUniqueName(name = 'Interface1') {
|
|
626
626
|
return utils.unique(name, this.getAbstractInterfaceExistingNames(), undefined, true);
|
|
627
627
|
}
|
|
628
|
-
|
|
628
|
+
getFrontendTypeExistingNames(excludedList = []) {
|
|
629
629
|
const excludedSet = new Set(excludedList);
|
|
630
|
-
return (this.
|
|
630
|
+
return (this.frontendTypes || [])
|
|
631
|
+
.filter((item) => !excludedSet.has(item))
|
|
632
|
+
.map((item) => item?.name);
|
|
631
633
|
}
|
|
632
|
-
|
|
633
|
-
return utils.unique(name, this.
|
|
634
|
+
getFrontendTypeUniqueName(name = 'frontendType1') {
|
|
635
|
+
return utils.unique(name, this.getFrontendTypeExistingNames(), undefined, true);
|
|
634
636
|
}
|
|
635
|
-
|
|
636
|
-
const
|
|
637
|
-
const relationOptions = { parentNode: this, parentKey: '
|
|
638
|
-
const
|
|
639
|
-
let
|
|
637
|
+
_insertFrontendTypeAt(options, index) {
|
|
638
|
+
const frontendTypeOptions = {};
|
|
639
|
+
const relationOptions = { parentNode: this, parentKey: 'frontendTypes' };
|
|
640
|
+
const FrontendType = (0, decorators_1.getConceptConstructor)('FrontendType');
|
|
641
|
+
let frontendType;
|
|
640
642
|
if (!options) {
|
|
641
|
-
|
|
642
|
-
...
|
|
643
|
-
name: this.
|
|
644
|
-
}, this, '
|
|
643
|
+
frontendType = FrontendType.from({
|
|
644
|
+
...frontendTypeOptions,
|
|
645
|
+
name: this.getFrontendTypeUniqueName(),
|
|
646
|
+
}, this, 'frontendTypes');
|
|
645
647
|
}
|
|
646
648
|
else if (typeof options === 'string') {
|
|
647
|
-
|
|
648
|
-
...
|
|
649
|
+
frontendType = FrontendType.from({
|
|
650
|
+
...frontendTypeOptions,
|
|
649
651
|
name: options,
|
|
650
|
-
}, this, '
|
|
652
|
+
}, this, 'frontendTypes');
|
|
651
653
|
}
|
|
652
|
-
else if (asserts.
|
|
654
|
+
else if (asserts.isFrontendType(options)) {
|
|
653
655
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
654
|
-
|
|
655
|
-
Object.assign(
|
|
656
|
+
frontendType = options;
|
|
657
|
+
Object.assign(frontendType, relationOptions);
|
|
656
658
|
}
|
|
657
659
|
else {
|
|
658
|
-
|
|
659
|
-
...
|
|
660
|
+
frontendType = FrontendType.from({
|
|
661
|
+
...frontendTypeOptions,
|
|
660
662
|
...options,
|
|
661
|
-
}, this, '
|
|
663
|
+
}, this, 'frontendTypes');
|
|
662
664
|
}
|
|
663
|
-
this.
|
|
664
|
-
return
|
|
665
|
+
this.frontendTypes.splice(index, 0, frontendType);
|
|
666
|
+
return frontendType;
|
|
665
667
|
}
|
|
666
|
-
|
|
667
|
-
const node = this.
|
|
668
|
+
insertFrontendTypeAt(options, index) {
|
|
669
|
+
const node = this._insertFrontendTypeAt(options, index);
|
|
668
670
|
node.create({
|
|
669
671
|
index,
|
|
670
672
|
parentNode: this,
|
|
671
|
-
parentKey: '
|
|
673
|
+
parentKey: 'frontendTypes',
|
|
672
674
|
});
|
|
673
675
|
return node;
|
|
674
676
|
}
|
|
675
|
-
|
|
676
|
-
const index = this.
|
|
677
|
-
return this.
|
|
677
|
+
_addFrontendType(options) {
|
|
678
|
+
const index = this.frontendTypes.length;
|
|
679
|
+
return this._insertFrontendTypeAt(options, index);
|
|
678
680
|
}
|
|
679
|
-
|
|
680
|
-
const node = this.
|
|
681
|
-
const index = this.
|
|
681
|
+
addFrontendType(options) {
|
|
682
|
+
const node = this._addFrontendType(options);
|
|
683
|
+
const index = this.frontendTypes.indexOf(node);
|
|
682
684
|
node.create({
|
|
683
685
|
index,
|
|
684
686
|
parentNode: this,
|
|
685
|
-
parentKey: '
|
|
687
|
+
parentKey: 'frontendTypes',
|
|
686
688
|
});
|
|
687
689
|
return node;
|
|
688
690
|
}
|
|
@@ -1456,34 +1458,34 @@ let App = App_1 = class App extends BaseNode_1.default {
|
|
|
1456
1458
|
}
|
|
1457
1459
|
return params;
|
|
1458
1460
|
}
|
|
1459
|
-
|
|
1460
|
-
let
|
|
1461
|
+
removeFrontendType(options) {
|
|
1462
|
+
let frontendType;
|
|
1461
1463
|
if (typeof options === 'string') {
|
|
1462
|
-
|
|
1463
|
-
if (!
|
|
1464
|
-
throw new Error('
|
|
1464
|
+
frontendType = this.frontendTypes.find((item) => item.name === options);
|
|
1465
|
+
if (!frontendType) {
|
|
1466
|
+
throw new Error('找不到端类型 ' + options);
|
|
1465
1467
|
}
|
|
1466
1468
|
}
|
|
1467
1469
|
else {
|
|
1468
|
-
|
|
1470
|
+
frontendType = options;
|
|
1469
1471
|
}
|
|
1470
|
-
return
|
|
1472
|
+
return frontendType.delete();
|
|
1471
1473
|
}
|
|
1472
|
-
|
|
1473
|
-
const parentKey =
|
|
1474
|
+
__removeFrontendType(frontendType) {
|
|
1475
|
+
const parentKey = frontendType.parentKey;
|
|
1474
1476
|
const params = {
|
|
1475
1477
|
parentNode: this,
|
|
1476
1478
|
parentKey,
|
|
1477
1479
|
index: -1,
|
|
1478
1480
|
object: null,
|
|
1479
|
-
oldObject:
|
|
1481
|
+
oldObject: frontendType,
|
|
1480
1482
|
};
|
|
1481
1483
|
if (parentKey) {
|
|
1482
1484
|
params.parentKey = parentKey;
|
|
1483
1485
|
// @ts-ignore
|
|
1484
1486
|
const t = this.__v_raw || this;
|
|
1485
1487
|
// @ts-ignore
|
|
1486
|
-
const n =
|
|
1488
|
+
const n = frontendType.__v_raw || frontendType;
|
|
1487
1489
|
if (Array.isArray(t[parentKey])) {
|
|
1488
1490
|
// @ts-ignore
|
|
1489
1491
|
const index = t[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
@@ -1941,6 +1943,16 @@ let App = App_1 = class App extends BaseNode_1.default {
|
|
|
1941
1943
|
findLogicByName(name) {
|
|
1942
1944
|
return this.logics.find((logic) => logic.name === name);
|
|
1943
1945
|
}
|
|
1946
|
+
/**
|
|
1947
|
+
* 获取组合节点
|
|
1948
|
+
*/
|
|
1949
|
+
getCompose(path) {
|
|
1950
|
+
let compose = this.composeCache;
|
|
1951
|
+
path.forEach((key) => {
|
|
1952
|
+
compose = compose?.[key];
|
|
1953
|
+
});
|
|
1954
|
+
return compose || null;
|
|
1955
|
+
}
|
|
1944
1956
|
/**
|
|
1945
1957
|
* 获取组合节点
|
|
1946
1958
|
*/
|
|
@@ -2153,10 +2165,10 @@ let App = App_1 = class App extends BaseNode_1.default {
|
|
|
2153
2165
|
names: [],
|
|
2154
2166
|
},
|
|
2155
2167
|
};
|
|
2156
|
-
const
|
|
2168
|
+
const frontendTypes = this.frontendTypes.filter((frontendType) => frontendType.kind === scope);
|
|
2157
2169
|
const existingSet = new Set();
|
|
2158
|
-
|
|
2159
|
-
|
|
2170
|
+
frontendTypes.forEach((frontendType) => {
|
|
2171
|
+
frontendType.componentDependencies.forEach((dep) => {
|
|
2160
2172
|
const { name, version } = dep;
|
|
2161
2173
|
const jsName = `${prefix}/packages/${name}@${version}/dist-theme/index.js`;
|
|
2162
2174
|
if (!existingSet.has(jsName)) {
|
|
@@ -2256,7 +2268,7 @@ let App = App_1 = class App extends BaseNode_1.default {
|
|
|
2256
2268
|
structureCount: this.structures.length,
|
|
2257
2269
|
enumCount: this.enums.length,
|
|
2258
2270
|
logicCount: this.logics.length,
|
|
2259
|
-
viewCount: sum(this.frontends.map((frontend) => countView(frontend.views))),
|
|
2271
|
+
viewCount: sum(this.frontendTypes.map((frontendType) => sum(frontendType.frontends.map((frontend) => countView(frontend.views))))),
|
|
2260
2272
|
processCount: this.processes.length,
|
|
2261
2273
|
};
|
|
2262
2274
|
}
|
|
@@ -2426,33 +2438,18 @@ let App = App_1 = class App extends BaseNode_1.default {
|
|
|
2426
2438
|
});
|
|
2427
2439
|
return errorList;
|
|
2428
2440
|
}
|
|
2429
|
-
addFrontendForType(options) {
|
|
2430
|
-
let insertIndex = -1;
|
|
2431
|
-
this.frontends.forEach((frontend, index) => {
|
|
2432
|
-
if (frontend.type === options.type) {
|
|
2433
|
-
insertIndex = index;
|
|
2434
|
-
}
|
|
2435
|
-
});
|
|
2436
|
-
if (options.type === 'h5' && insertIndex === -1) {
|
|
2437
|
-
insertIndex = this.frontends.length;
|
|
2438
|
-
}
|
|
2439
|
-
const node = this._insertFrontendAt(options, insertIndex + 1);
|
|
2440
|
-
const index = this.frontends.indexOf(node);
|
|
2441
|
-
node.create({
|
|
2442
|
-
index,
|
|
2443
|
-
parentNode: this,
|
|
2444
|
-
parentKey: 'frontends',
|
|
2445
|
-
});
|
|
2446
|
-
return node;
|
|
2447
|
-
}
|
|
2448
2441
|
getFrontendExistingTitles(excludedList = []) {
|
|
2449
2442
|
const excludedSet = new Set(excludedList);
|
|
2450
|
-
return (this.
|
|
2443
|
+
return (this.frontendTypes || [])
|
|
2444
|
+
.map((frontendType) => frontendType.frontends?.filter((item) => !excludedSet.has(item)).map((item) => item.title))
|
|
2445
|
+
.flat(2);
|
|
2451
2446
|
}
|
|
2452
2447
|
getExtensionsCallbackLogics() {
|
|
2453
2448
|
let resultLogics = [];
|
|
2454
|
-
this.
|
|
2455
|
-
|
|
2449
|
+
this.frontendTypes.forEach((frontendType) => {
|
|
2450
|
+
frontendType?.frontends?.forEach((frontend) => {
|
|
2451
|
+
resultLogics = [...resultLogics, ...frontend.getExtensionsCallbackLogics()];
|
|
2452
|
+
});
|
|
2456
2453
|
});
|
|
2457
2454
|
return Array.from(new Set(resultLogics));
|
|
2458
2455
|
}
|
|
@@ -2463,18 +2460,17 @@ let App = App_1 = class App extends BaseNode_1.default {
|
|
|
2463
2460
|
return `${utils.unique(name, this.getLogicExistingNames(), undefined, true)}Service`;
|
|
2464
2461
|
}
|
|
2465
2462
|
genAllCustomComponents() {
|
|
2466
|
-
const { frontends } = this;
|
|
2467
2463
|
const compMap = {
|
|
2468
2464
|
pc: [],
|
|
2469
2465
|
h5: [],
|
|
2470
2466
|
};
|
|
2471
2467
|
const existingSet = new Set();
|
|
2472
|
-
|
|
2473
|
-
if (
|
|
2474
|
-
|
|
2468
|
+
this.frontendTypes.forEach((frontendType) => {
|
|
2469
|
+
if (frontendType.componentDependencies) {
|
|
2470
|
+
frontendType.componentDependencies.forEach((dep) => {
|
|
2475
2471
|
const { name } = dep;
|
|
2476
2472
|
if (!existingSet.has(name)) {
|
|
2477
|
-
compMap[
|
|
2473
|
+
compMap[frontendType.kind].push(dep);
|
|
2478
2474
|
}
|
|
2479
2475
|
});
|
|
2480
2476
|
}
|
|
@@ -2770,11 +2766,11 @@ __decorate([
|
|
|
2770
2766
|
], App.prototype, "interfaces", void 0);
|
|
2771
2767
|
__decorate([
|
|
2772
2768
|
(0, decorators_1.property)({
|
|
2773
|
-
objectRef: '
|
|
2769
|
+
objectRef: 'FrontendType',
|
|
2774
2770
|
isArray: true,
|
|
2775
2771
|
defaultValue: [],
|
|
2776
2772
|
})
|
|
2777
|
-
], App.prototype, "
|
|
2773
|
+
], App.prototype, "frontendTypes", void 0);
|
|
2778
2774
|
__decorate([
|
|
2779
2775
|
(0, decorators_1.property)({
|
|
2780
2776
|
objectRef: 'Backend',
|