@lcap/nasl 2.20.0-beta.2 → 2.20.0
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/index.d.ts +1 -1
- package/out/automate/engine/index.js +2 -3
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/uniqueName.d.ts +1 -1
- package/out/automate/engine/uniqueName.js +2 -2
- package/out/automate/engine/uniqueName.js.map +1 -1
- package/out/automate/engine/utils.js +4 -1
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/myProcess.d.ts +1 -1
- package/out/automate/template/myProcess.js +2 -2
- package/out/automate/template/myProcess.js.map +1 -1
- package/out/bak/translator.js +14 -22
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.js +4 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.d.ts +1 -0
- package/out/common/Command.js +5 -1
- package/out/common/Command.js.map +1 -1
- package/out/concepts/App__.d.ts +4 -0
- package/out/concepts/App__.js +30 -6
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Assignee__.js +4 -3
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +3 -3
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +7 -0
- package/out/concepts/BindAttribute__.js +270 -39
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +7 -0
- package/out/concepts/BindDirective__.js +215 -17
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +7 -0
- package/out/concepts/BindStyle__.js +194 -4
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/CallFunction__.js +22 -8
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +3 -2
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +3 -0
- package/out/concepts/CallLogic__.js +78 -89
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +20 -3
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +1 -0
- package/out/concepts/ConfigGroup__.js +13 -0
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +19 -0
- package/out/concepts/ConfigProperty__.js +61 -0
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +1 -0
- package/out/concepts/Configuration__.js +13 -0
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +1 -0
- package/out/concepts/Destination__.js +61 -7
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +9 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +5 -5
- package/out/concepts/EnumItem__.js +6 -6
- package/out/concepts/Enum__.d.ts +20 -19
- package/out/concepts/Enum__.js +28 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +1 -0
- package/out/concepts/ExternalDestination__.js +21 -3
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +2 -0
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +2 -1
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Identifier__.js +16 -5
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +9 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/JSBlock__.js +5 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +79 -79
- package/out/concepts/Logic__.js +16 -3
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Match__.d.ts +0 -3
- package/out/concepts/Match__.js +11 -66
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +9 -0
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +16 -0
- package/out/concepts/Module__.js +43 -0
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +2 -4
- package/out/concepts/NewComposite__.js +91 -126
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +1 -0
- package/out/concepts/NewList__.js +22 -2
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +1 -0
- package/out/concepts/NewMap__.js +43 -11
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +40 -12
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.js +10 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +2 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js +1 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js +1 -0
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/Return__.js +10 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +14 -2
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js +6 -6
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +9 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +6 -3
- package/out/concepts/TypeAnnotation__.js +67 -13
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +1 -0
- package/out/concepts/ValidationRule__.js +53 -0
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +9 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.js +17 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -3
- package/out/concepts/View__.js +22 -11
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.collection.js +6 -1
- package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js +3 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.core.d.ts +2 -0
- package/out/concepts/basics/stdlib/nasl.core.js +34 -0
- package/out/concepts/basics/stdlib/nasl.core.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +4 -2
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +1 -0
- package/out/concepts/basics/types/index.js +3 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/concepts/index__.d.ts +0 -1
- package/out/concepts/index__.js +0 -1
- package/out/concepts/index__.js.map +1 -1
- package/out/enums/KEYWORDS.js +8 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.js +24 -5
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +2 -3
- package/out/generator/genReleaseBody.js +97 -23
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/permission.d.ts +2 -10
- package/out/generator/permission.js +27 -14
- package/out/generator/permission.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +2 -20
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/extendBaseNode.js +16 -5
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +2 -1
- package/out/server/formatTsUtils.js +40 -10
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.d.ts +2 -2
- package/out/server/getLogics.js +3 -3
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +1 -0
- package/out/server/getMemberIdentifier.js +27 -1
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +7 -1
- package/out/server/naslServer.js +519 -46
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +109 -33
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +21 -1
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +1 -3
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +1 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +2 -4
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +2 -2
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +7 -1
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +1 -1
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +2 -2
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -3
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/utils/traverse.js +8 -2
- package/out/utils/traverse.js.map +1 -1
- package/package.json +2 -2
- package/sandbox/stdlib/dist/nasl.logging.js +0 -0
- package/sandbox/stdlib/dist/nasl.util.js +0 -0
- package/sandbox/stdlib/nasl.collection.ts +1 -0
- package/sandbox/stdlib/nasl.core.ts +34 -0
- package/sandbox/stdlib/nasl.oql.ts +71 -15
- package/sandbox/stdlib/nasl.util.ts +9 -3
- package/src/automate/engine/dist/index.dev.js +517 -0
- package/src/automate/engine/index.js +2 -3
- package/src/automate/engine/uniqueName.js +2 -2
- package/src/automate/engine/utils.js +4 -2
- package/src/automate/template/myProcess.js +2 -2
- package/src/bak/translator.js +16 -25
- package/src/common/BaseNode.ts +3 -1
- package/src/common/Command.ts +4 -0
- package/src/common/dist/BaseNode.js +1101 -0
- package/src/concepts/App__.ts +36 -7
- package/src/concepts/Assignee__.ts +4 -3
- package/src/concepts/BatchAssignment__.ts +3 -3
- package/src/concepts/BindAttribute__.ts +299 -38
- package/src/concepts/BindDirective__.ts +204 -31
- package/src/concepts/BindStyle__.ts +187 -24
- package/src/concepts/CallFunction__.ts +55 -10
- package/src/concepts/CallInterface__.ts +3 -2
- package/src/concepts/CallLogic__.ts +110 -90
- package/src/concepts/CallQueryComponent__.ts +18 -3
- package/src/concepts/ConfigGroup__.ts +17 -4
- package/src/concepts/ConfigProperty__.ts +70 -4
- package/src/concepts/Configuration__.ts +14 -5
- package/src/concepts/DataSource__.ts +4 -1
- package/src/concepts/Destination__.ts +61 -7
- package/src/concepts/EntityProperty__.ts +7 -1
- package/src/concepts/EnumItem__.ts +6 -6
- package/src/concepts/Enum__.ts +22 -19
- package/src/concepts/ExternalDestination__.ts +28 -8
- package/src/concepts/ForEachStatement__.ts +2 -0
- package/src/concepts/Frontend__.ts +2 -1
- package/src/concepts/Identifier__.ts +16 -5
- package/src/concepts/InterfaceParam__.ts +7 -1
- package/src/concepts/JSBlock__.ts +3 -2
- package/src/concepts/Logic__.ts +95 -83
- package/src/concepts/Match__.ts +31 -67
- package/src/concepts/MemberExpression__.ts +6 -0
- package/src/concepts/Module__.ts +57 -0
- package/src/concepts/NewComposite__.ts +95 -140
- package/src/concepts/NewList__.ts +23 -2
- package/src/concepts/NewMap__.ts +48 -24
- package/src/concepts/OqlQueryComponent__.ts +40 -20
- package/src/concepts/Param__.ts +178 -176
- package/src/concepts/ProcessElement__.ts +2 -1
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/ProcessOutcomes__.ts +1 -1
- package/src/concepts/Process__.ts +1 -0
- package/src/concepts/Return__.ts +8 -2
- package/src/concepts/StringInterpolation__.ts +19 -7
- package/src/concepts/StringLiteral__.ts +7 -6
- package/src/concepts/StructureProperty__.ts +7 -1
- package/src/concepts/TypeAnnotation__.ts +101 -14
- package/src/concepts/ValidationRule__.ts +58 -9
- package/src/concepts/Variable__.ts +11 -1
- package/src/concepts/ViewElement__.ts +39 -2
- package/src/concepts/View__.ts +26 -14
- package/src/concepts/basics/stdlib/dist/nasl.util.js +1602 -0
- package/src/concepts/basics/stdlib/dist/reference2TypeAnnotationList.js +24 -0
- package/src/concepts/basics/stdlib/nasl.collection.ts +6 -1
- package/src/concepts/basics/stdlib/nasl.configuration.ts +3 -0
- package/src/concepts/basics/stdlib/nasl.core.ts +33 -2
- package/src/concepts/basics/stdlib/nasl.util.ts +4 -2
- package/src/concepts/basics/types/index.ts +1 -0
- package/src/concepts/dist/BindAttribute__.js +795 -0
- package/src/concepts/dist/BindEvent__.js +732 -0
- package/src/concepts/dist/CallFunction__.js +527 -0
- package/src/concepts/dist/CallLogic__.js +932 -0
- package/src/concepts/dist/Destination__.js +708 -0
- package/src/concepts/dist/ExternalDestination__.js +298 -0
- package/src/concepts/dist/Identifier__.js +311 -0
- package/src/concepts/dist/StringInterpolation__.js +231 -0
- package/src/concepts/dist/TypeAnnotation__.js +834 -0
- package/src/concepts/dist/ViewElement__.js +1692 -0
- package/src/concepts/dist/View__.js +1601 -0
- package/src/concepts/index__.ts +0 -1
- package/src/enums/KEYWORDS.ts +8 -0
- package/src/generator/dist/genBundleFiles.js +261 -0
- package/src/generator/dist/genMetaData.js +245 -0
- package/src/generator/dist/permission.js +405 -0
- package/src/generator/genBundleFiles.ts +24 -5
- package/src/generator/genReleaseBody.ts +75 -30
- package/src/generator/permission.ts +31 -15
- package/src/server/entity2LogicNamespace.ts +2 -20
- package/src/server/extendBaseNode.ts +15 -5
- package/src/server/formatTsUtils.ts +41 -10
- package/src/server/getLogics.ts +4 -4
- package/src/server/getMemberIdentifier.ts +27 -1
- package/src/server/index.ts +2 -0
- package/src/server/naslServer.ts +520 -48
- package/src/server/translator.ts +96 -34
- package/src/service/storage/dist/init.js +579 -0
- package/src/service/storage/init.ts +22 -2
- package/src/templator/dist/genEditTableBlock.js +204 -0
- package/src/templator/dist/genGridViewBlock.js +265 -0
- package/src/templator/dist/genListViewBlock.js +84 -0
- package/src/templator/dist/genTableBlock.js +209 -0
- package/src/templator/dist/utils.js +527 -0
- package/src/templator/genCreateBlock.ts +1 -3
- package/src/templator/genCurdEditMultipleKeyBlock.ts +1 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +2 -4
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genGridViewBlock.ts +3 -4
- package/src/templator/genListViewBlock.ts +9 -3
- package/src/templator/genSelectBlock.ts +1 -1
- package/src/templator/genTableBlock.ts +3 -3
- package/src/templator/genUpdateBlock.ts +2 -3
- package/src/utils/traverse.ts +10 -2
- package/ts-worker/lib/tsserver.js +10 -2
- package/ts-worker/package.json +1 -0
- package/ts-worker/webpack.config.js +11 -2
- package/out/concepts/ConstructArgument__.d.ts +0 -40
- package/out/concepts/ConstructArgument__.js +0 -108
- package/out/concepts/ConstructArgument__.js.map +0 -1
- package/out/concepts/Construct__.d.ts +0 -189
- package/out/concepts/Construct__.js +0 -340
- package/out/concepts/Construct__.js.map +0 -1
- package/out/templator/sql-parser/index.d.ts +0 -1
- package/out/templator/sql-parser/index.js +0 -228
- package/out/templator/sql-parser/index.js.map +0 -1
- package/out/templator/sql-parser/parser.js +0 -26664
- package/out/templator/sql-parser/parser.js.map +0 -1
package/src/concepts/index__.ts
CHANGED
package/src/enums/KEYWORDS.ts
CHANGED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.genBundleFiles = void 0;
|
|
4
|
+
var utils = require("../utils");
|
|
5
|
+
var _1 = require(".");
|
|
6
|
+
var compileComponent_1 = require("./compileComponent");
|
|
7
|
+
var JSON5 = require("json5");
|
|
8
|
+
var prettier = require("prettier");
|
|
9
|
+
// @ts-ignore:next-line
|
|
10
|
+
var parserBabel = require("prettier/parser-babel");
|
|
11
|
+
var UglifyJS = require("uglify-js-export");
|
|
12
|
+
var genMetaData_1 = require("./genMetaData");
|
|
13
|
+
function genBundleFiles(app, config) {
|
|
14
|
+
var _a;
|
|
15
|
+
var _b, _c, _d;
|
|
16
|
+
var fnNuimsDomain = ((_b = config === null || config === void 0 ? void 0 : config.envNuimsDomain) === null || _b === void 0 ? void 0 : _b[config === null || config === void 0 ? void 0 : config.env]) || (config === null || config === void 0 ? void 0 : config.nuimsDomain);
|
|
17
|
+
var fnLowcodeDomain = ((_d = (_c = config === null || config === void 0 ? void 0 : config.envLcpDomain) === null || _c === void 0 ? void 0 : _c[config === null || config === void 0 ? void 0 : config.env]) === null || _d === void 0 ? void 0 : _d.lcpDomain) || (config === null || config === void 0 ? void 0 : config.lowcodeDomain);
|
|
18
|
+
var modules = [];
|
|
19
|
+
var views = [];
|
|
20
|
+
app.dependencies && modules.push.apply(modules, app.dependencies);
|
|
21
|
+
app.interfaceDependencies && modules.push.apply(modules, app.interfaceDependencies);
|
|
22
|
+
app.views && views.push.apply(views, app.views);
|
|
23
|
+
modules.forEach(function (module) {
|
|
24
|
+
module.views && views.push.apply(views, module.views);
|
|
25
|
+
});
|
|
26
|
+
var componentMap = {};
|
|
27
|
+
utils.traverse(function (current) {
|
|
28
|
+
if (current.node.toVueOptions)
|
|
29
|
+
componentMap[current.node.id] = current.node.toVueOptions();
|
|
30
|
+
}, {
|
|
31
|
+
node: {
|
|
32
|
+
children: views
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* vue.config.js page options
|
|
37
|
+
*/
|
|
38
|
+
var routes = [];
|
|
39
|
+
// 开启了权限的页面
|
|
40
|
+
var authResourceViews = [];
|
|
41
|
+
var baseResourcePaths = [];
|
|
42
|
+
var rootViewData = [];
|
|
43
|
+
var defaultRoute = '';
|
|
44
|
+
// 遍历页面
|
|
45
|
+
var traverseViews = function (view, isParentViewAuth) {
|
|
46
|
+
var parentNode = view.parentNode || {};
|
|
47
|
+
var isRootView = parentNode.concept !== 'View';
|
|
48
|
+
var viewName = view.name;
|
|
49
|
+
// 页面是否需要权限,如果父页面需要权限,子页面也一定需要
|
|
50
|
+
var isViewAuth = isParentViewAuth || view.auth;
|
|
51
|
+
// 路由地址
|
|
52
|
+
var routePath = viewName;
|
|
53
|
+
if (isRootView) {
|
|
54
|
+
rootViewData.push({ name: viewName, title: view.title || viewName, isIndex: view.isIndex });
|
|
55
|
+
routePath = "/" + viewName;
|
|
56
|
+
if (!isViewAuth) {
|
|
57
|
+
if (viewName === 'notFound') {
|
|
58
|
+
defaultRoute = routePath;
|
|
59
|
+
}
|
|
60
|
+
if (view.isIndex) {
|
|
61
|
+
if (!defaultRoute) {
|
|
62
|
+
defaultRoute = routePath;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
var route = {
|
|
68
|
+
path: routePath,
|
|
69
|
+
component: compileComponent_1.compileComponent(componentMap[view.id]),
|
|
70
|
+
children: []
|
|
71
|
+
};
|
|
72
|
+
var viewChildren = view.children;
|
|
73
|
+
if (Array.isArray(viewChildren) && viewChildren.length) {
|
|
74
|
+
for (var i = 0; i < viewChildren.length; i++) {
|
|
75
|
+
var subView = viewChildren[i];
|
|
76
|
+
var subViewRoute = traverseViews(subView, isViewAuth).route;
|
|
77
|
+
route.children.push(subViewRoute);
|
|
78
|
+
if (subView.isIndex) {
|
|
79
|
+
route.children.push({
|
|
80
|
+
path: '',
|
|
81
|
+
redirect: "'" + subView.name + "'"
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
var viewPath = view.path;
|
|
87
|
+
if (isViewAuth) {
|
|
88
|
+
authResourceViews.push(view);
|
|
89
|
+
}
|
|
90
|
+
if (!isViewAuth) {
|
|
91
|
+
baseResourcePaths.push(viewPath);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
route: route,
|
|
95
|
+
isViewAuth: isViewAuth
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
// 页面
|
|
99
|
+
views.forEach(function (view) {
|
|
100
|
+
var route = traverseViews(view).route;
|
|
101
|
+
routes.push(route);
|
|
102
|
+
if (view.isIndex) {
|
|
103
|
+
routes.push({
|
|
104
|
+
path: '/',
|
|
105
|
+
redirect: "'/" + view.name + "'"
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
var authResourcePathMap = {};
|
|
110
|
+
// 默认跳转子页面开启权限的情况,需要把父页面也都加入权限校验列表
|
|
111
|
+
if (Array.isArray(authResourceViews)) {
|
|
112
|
+
authResourceViews.forEach(function (authResourceView) {
|
|
113
|
+
if (authResourceView) {
|
|
114
|
+
authResourcePathMap[authResourceView.path] = true;
|
|
115
|
+
var viewNode = authResourceView;
|
|
116
|
+
while (viewNode.concept === 'View' && viewNode.isIndex) {
|
|
117
|
+
var parentViewNode = viewNode.parentNode;
|
|
118
|
+
if (parentViewNode.concept === 'View') {
|
|
119
|
+
authResourcePathMap[parentViewNode.path] = true;
|
|
120
|
+
}
|
|
121
|
+
else { // viewNode是根页面
|
|
122
|
+
authResourcePathMap['/'] = true;
|
|
123
|
+
}
|
|
124
|
+
viewNode = parentViewNode;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
var authResourcePaths = Object.keys(authResourcePathMap);
|
|
130
|
+
function routeToString(route) {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
var content = "{\n path: '" + route.path + "',\n";
|
|
133
|
+
if ((_a = route === null || route === void 0 ? void 0 : route.component) === null || _a === void 0 ? void 0 : _a.script) {
|
|
134
|
+
var template = route.component.template;
|
|
135
|
+
if (config.env !== 'dev') {
|
|
136
|
+
template = template.replace(/[\t\r\n]/g, '');
|
|
137
|
+
}
|
|
138
|
+
content += "component: (function(){\n var componentOptions = " + (route.component.script ? '(function(){\n' + route.component.script.trim().replace(/export default |module\.exports +=/, 'return ') + '\n})()' : '{}') + ";\n Object.assign(componentOptions, {\n template: `" + template.replace(/[`$]/g, function (m) { return '\\' + m; }) + "`,\n });\n return componentOptions;\n })(),\n";
|
|
139
|
+
}
|
|
140
|
+
if ((_b = route === null || route === void 0 ? void 0 : route.children) === null || _b === void 0 ? void 0 : _b.length) {
|
|
141
|
+
content += "children: [\n " + route.children.map(routeToString).join(',\n') + "\n ],\n";
|
|
142
|
+
}
|
|
143
|
+
if (route === null || route === void 0 ? void 0 : route.redirect) {
|
|
144
|
+
content += "redirect: " + (route === null || route === void 0 ? void 0 : route.redirect) + ",\n";
|
|
145
|
+
}
|
|
146
|
+
content += '}';
|
|
147
|
+
return content;
|
|
148
|
+
}
|
|
149
|
+
var routesStr = '[';
|
|
150
|
+
routes.forEach(function (route) {
|
|
151
|
+
routesStr += routeToString(route) + ",\n";
|
|
152
|
+
});
|
|
153
|
+
if (defaultRoute) {
|
|
154
|
+
routesStr += "{\n path: '*',\n redirect: '" + defaultRoute + "',\n }\n";
|
|
155
|
+
}
|
|
156
|
+
routesStr += ']';
|
|
157
|
+
var platformConfig = JSON5.stringify({
|
|
158
|
+
appConfig: {
|
|
159
|
+
project: app.name,
|
|
160
|
+
domainName: app.name,
|
|
161
|
+
nuimsDomain: fnNuimsDomain,
|
|
162
|
+
envNuimsDomain: config.envNuimsDomain,
|
|
163
|
+
tenantType: config.tenantType,
|
|
164
|
+
tenantLevel: config.tenantLevel,
|
|
165
|
+
extendedConfig: config.extendedConfig,
|
|
166
|
+
envConfig: {
|
|
167
|
+
lowcodeDomain: fnLowcodeDomain
|
|
168
|
+
},
|
|
169
|
+
tenant: config.tenant,
|
|
170
|
+
documentTitle: app.documentTitle,
|
|
171
|
+
rootViewData: rootViewData
|
|
172
|
+
},
|
|
173
|
+
dnsAddr: app.dnsAddr,
|
|
174
|
+
devDnsAddr: config.devDnsAddr,
|
|
175
|
+
tenant: config.tenant,
|
|
176
|
+
env: config.env,
|
|
177
|
+
hasUserCenter: app.hasUserCenter,
|
|
178
|
+
hasAuth: app.hasAuth,
|
|
179
|
+
authResourcePaths: authResourcePaths,
|
|
180
|
+
baseResourcePaths: baseResourcePaths,
|
|
181
|
+
miniEnable: config.miniEnable
|
|
182
|
+
}, null, 4);
|
|
183
|
+
var metaData = genMetaData_1.genMetaData(app);
|
|
184
|
+
var metaDataStr = JSON5.stringify(metaData);
|
|
185
|
+
var assetsInfo = app.genAllAssetsInfo(config.STATIC_URL);
|
|
186
|
+
var customNames = JSON5.stringify(assetsInfo.custom.names);
|
|
187
|
+
var content = "(function(){\n ";
|
|
188
|
+
var themeCSS = app.genThemeCSS();
|
|
189
|
+
if (themeCSS) {
|
|
190
|
+
content += "{\n const el = document.createElement('style');\n el.id = 'theme';\n el.innerHTML = `" + themeCSS + "`;\n document.head.appendChild(el);\n }\n ";
|
|
191
|
+
}
|
|
192
|
+
if (app.documentIcon) {
|
|
193
|
+
content += "{\n const link = document.createElement('link');\n link.rel = 'shortcut icon';\n link.href = `" + app.documentIcon + "`;\n document.head.appendChild(link);\n }";
|
|
194
|
+
}
|
|
195
|
+
content += "\n var customNames = " + customNames + ";\n for(var i=0;i<customNames.length;i++){\n var name = window.kebab2Camel(customNames[i]);\n if(window[name]){\n window.CloudUI.install(window.Vue, window[name]);\n }\n }";
|
|
196
|
+
content += "\n var platformConfig = " + platformConfig + ";\n var metaData = " + metaDataStr + ";\n var routes = " + routesStr + ";\n\n window.createLcapApp = () => window.appVM = window.cloudAdminDesigner.init(platformConfig.appConfig, platformConfig, routes, metaData);\n window.createLcapApp();\n })();";
|
|
197
|
+
if (config.env === 'dev') {
|
|
198
|
+
// 加载资源js
|
|
199
|
+
// const domain = fnLowcodeDomain.slice(fnLowcodeDomain.indexOf('.') + 1);
|
|
200
|
+
// const targetUrl = `${typeof location !== 'undefined' ? location.origin : `http://${config.tenant}.${fnLowcodeDomain}`}/empty?url=${domain}&appid=${config.appid}`;
|
|
201
|
+
// if(!document.querySelector("iframe[name='iframeEmpty']")){
|
|
202
|
+
// var el = document.createElement('iframe');
|
|
203
|
+
// el.setAttribute('src', "${targetUrl}");
|
|
204
|
+
// el.setAttribute('name', 'iframeEmpty');
|
|
205
|
+
// el.setAttribute('width', 0);
|
|
206
|
+
// el.setAttribute('height', 0);
|
|
207
|
+
// el.style.borderWidth = 0
|
|
208
|
+
// el.style.display= "block"
|
|
209
|
+
// document.getElementsByTagName('body')[0].appendChild(el);
|
|
210
|
+
// document.domain = '${domain}'
|
|
211
|
+
var str = "\n var _div = document.createElement('div');\n _div.classList = \"div-load\"\n _div.innerHTML = \"<div class='loading-container'></div><div>\u6B63\u5728\u66F4\u65B0\u6700\u65B0\u53D1\u5E03\u5185\u5BB9...</div>\"\n document.getElementsByTagName('body')[0].appendChild(_div);\n window.showLoading = function(){\n document.querySelector(\".div-load\").style.display =\"flex\"\n }\n window.hideLoading = function(){\n document.querySelector(\".div-load\").style.display =\"none\"\n }\n var style = document.createElement('style');\n style.innerHTML=`.div-load{\n width: 208px;\n height: 40px;\n background: rgba(48, 48, 48, 0.8);\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);\n border-radius: 4px;\n position: fixed;\n top: 120px;\n left: 50%;\n margin-left: -104px;\n color: #FFFFFF;\n font-size: 14px;\n display: none;\n justify-content: center;\n align-items: center;\n }\n\n .loading-container{\n width: 12px;\n height: 12px;\n margin-right: 10px;\n animation: loading-animation 0.8s infinite linear;\n border: 2px solid #f3f3f3;\n border-top: 2px solid rgb(109, 108, 108);\n border-right: 2px solid rgb(109, 108, 108);\n border-bottom: 2px solid rgb(109, 108, 108);\n border-radius: 50%;\n }\n\n @keyframes loading-animation{\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }`\n document.getElementsByTagName('body')[0].appendChild(style);\n window.addEventListener('message', function (e) {\n console.log('message:',e)\n if(e.data ===\"release-start\"){\n showLoading()\n }\n if(e.data===\"release-end\"){\n hideLoading()\n window.location.reload();\n }\n })\n ";
|
|
212
|
+
content += str;
|
|
213
|
+
}
|
|
214
|
+
var bundlePath = config.USER_STATIC_URL + "/" + config.tenant + "/" + app.id + "/" + config.env + "/bundle." + _1.genHash(content) + ".js";
|
|
215
|
+
var bundleSourceMapPath = bundlePath + ".map";
|
|
216
|
+
var bundleMinPath = config.USER_STATIC_URL + "/" + config.tenant + "/" + app.id + "/" + config.env + "/bundle." + _1.genHash(content) + ".min.js";
|
|
217
|
+
var otherJsList = config.miniEnable ? ['//res.wx.qq.com/open/js/jweixin-1.3.2.js'] : [];
|
|
218
|
+
var assetsContent = "(function() {\n LazyLoad.js(" + JSON5.stringify(assetsInfo.basic.js.concat(assetsInfo.custom.js, otherJsList).concat([bundleMinPath])) + ");\n LazyLoad.css(" + JSON5.stringify(assetsInfo.basic.css.concat(assetsInfo.custom.css)) + ");\n})()\n";
|
|
219
|
+
var minifyObj;
|
|
220
|
+
// 开发环境加上sourceMap
|
|
221
|
+
if (config.env === 'dev') {
|
|
222
|
+
content = prettier.format(content, {
|
|
223
|
+
parser: 'babel',
|
|
224
|
+
plugins: [parserBabel],
|
|
225
|
+
tabWidth: 4
|
|
226
|
+
});
|
|
227
|
+
minifyObj = UglifyJS.minify((_a = {},
|
|
228
|
+
_a[bundlePath] = content,
|
|
229
|
+
_a), {
|
|
230
|
+
sourceMap: {
|
|
231
|
+
url: bundleSourceMapPath
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
minifyObj = UglifyJS.minify(content);
|
|
237
|
+
}
|
|
238
|
+
var outputs = [
|
|
239
|
+
{
|
|
240
|
+
name: bundleMinPath,
|
|
241
|
+
content: minifyObj.code
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: config.USER_STATIC_URL + "/" + config.tenant + "/" + app.id + "/" + config.env + "/client.js",
|
|
245
|
+
content: assetsContent
|
|
246
|
+
},
|
|
247
|
+
];
|
|
248
|
+
// 开发环境加上sourceMap
|
|
249
|
+
if (config.env === 'dev') {
|
|
250
|
+
// map和源文件
|
|
251
|
+
outputs.push({
|
|
252
|
+
name: bundlePath,
|
|
253
|
+
content: content
|
|
254
|
+
}, {
|
|
255
|
+
name: bundleSourceMapPath,
|
|
256
|
+
content: minifyObj.map
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
return outputs;
|
|
260
|
+
}
|
|
261
|
+
exports.genBundleFiles = genBundleFiles;
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.genMetaData = void 0;
|
|
4
|
+
var concepts_1 = require("../concepts");
|
|
5
|
+
var utils = require("../utils");
|
|
6
|
+
// 生成typeKey
|
|
7
|
+
function genSortedTypeKey(typeAnnotation) {
|
|
8
|
+
var _a = typeAnnotation || {}, typeKind = _a.typeKind, typeNamespace = _a.typeNamespace, typeName = _a.typeName, typeArguments = _a.typeArguments, properties = _a.properties;
|
|
9
|
+
var typeKeyArr = [];
|
|
10
|
+
if (typeKind === 'union') { // 联合类型
|
|
11
|
+
if (Array.isArray(typeArguments)) {
|
|
12
|
+
// 按返回的每个具体项排序
|
|
13
|
+
var childTypeArgs = typeArguments.map(function (typeArg) { return genSortedTypeKey(typeArg); }).sort(function (name1, name2) { return name1 > name2 ? 1 : -1; });
|
|
14
|
+
typeKeyArr.push(childTypeArgs.join(' | '));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
else if (typeKind === 'anonymousStructure') { // 匿名数据结构
|
|
18
|
+
typeKeyArr.push('{');
|
|
19
|
+
if (Array.isArray(properties)) {
|
|
20
|
+
// 按匿名数据结构的key排序
|
|
21
|
+
var childTypeArgs = properties.sort(function (_a, _b) {
|
|
22
|
+
var name1 = _a.name;
|
|
23
|
+
var name2 = _b.name;
|
|
24
|
+
return name1 > name2 ? 1 : -1;
|
|
25
|
+
}).map(function (typeArg) {
|
|
26
|
+
var _a = typeArg || {}, typeArgName = _a.name, typeArgTypeAnnotation = _a.typeAnnotation;
|
|
27
|
+
return typeArgName + ": " + genSortedTypeKey(typeArgTypeAnnotation);
|
|
28
|
+
});
|
|
29
|
+
typeKeyArr.push(childTypeArgs.join(', '));
|
|
30
|
+
}
|
|
31
|
+
typeKeyArr.push('}');
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
var typeArr = [];
|
|
35
|
+
typeNamespace && typeArr.push(typeNamespace);
|
|
36
|
+
typeName && typeArr.push(typeName);
|
|
37
|
+
var typeKey = typeArr.join('.');
|
|
38
|
+
typeKey && typeKeyArr.push(typeKey);
|
|
39
|
+
if (typeKind === 'generic') {
|
|
40
|
+
typeKeyArr.push('<');
|
|
41
|
+
if (Array.isArray(typeArguments)) {
|
|
42
|
+
// 必须按typeArguments定义的顺序,否则实参位置不对
|
|
43
|
+
var childTypeArgs = typeArguments.map(function (typeArg) { return genSortedTypeKey(typeArg); });
|
|
44
|
+
typeKeyArr.push(childTypeArgs.join(', '));
|
|
45
|
+
}
|
|
46
|
+
typeKeyArr.push('>');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return typeKeyArr.join('');
|
|
50
|
+
}
|
|
51
|
+
function genMetaData(app) {
|
|
52
|
+
var modules = [];
|
|
53
|
+
var views = [];
|
|
54
|
+
var entities = [];
|
|
55
|
+
var structures = [];
|
|
56
|
+
var enums = [];
|
|
57
|
+
var logics = [];
|
|
58
|
+
var interfaces = [];
|
|
59
|
+
var processes = [];
|
|
60
|
+
app.views && views.push.apply(views, app.views);
|
|
61
|
+
if (Array.isArray(app.dataSources)) {
|
|
62
|
+
app.dataSources.forEach(function (dataSource) {
|
|
63
|
+
if (Array.isArray(dataSource.entities)) {
|
|
64
|
+
entities.push.apply(entities, dataSource.entities);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
app.structures && structures.push.apply(structures, app.structures);
|
|
69
|
+
app.enums && enums.push.apply(enums, app.enums);
|
|
70
|
+
app.logics && logics.push.apply(logics, app.logics);
|
|
71
|
+
app.processes && processes.push.apply(processes, app.processes);
|
|
72
|
+
app.dependencies && modules.push.apply(modules, app.dependencies);
|
|
73
|
+
app.interfaceDependencies && modules.push.apply(modules, app.interfaceDependencies);
|
|
74
|
+
modules.forEach(function (module) {
|
|
75
|
+
module.views && views.push.apply(views, module.views);
|
|
76
|
+
module.structures && structures.push.apply(structures, module.structures);
|
|
77
|
+
module.enums && enums.push.apply(enums, module.enums);
|
|
78
|
+
module.logics && logics.push.apply(logics, module.logics);
|
|
79
|
+
module.interfaces && interfaces.push.apply(interfaces, module.interfaces);
|
|
80
|
+
if (Array.isArray(module.dataSources)) {
|
|
81
|
+
module.dataSources.forEach(function (dataSource) {
|
|
82
|
+
if (Array.isArray(dataSource.entities)) {
|
|
83
|
+
entities.push.apply(entities, dataSource.entities);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
var dataTypes = [];
|
|
89
|
+
var dataTypesMap = {};
|
|
90
|
+
var frontendVariables = app.frontendVariables;
|
|
91
|
+
var enumsMap = {};
|
|
92
|
+
var logicsMap = {};
|
|
93
|
+
var _custom = {};
|
|
94
|
+
var allLogics = [];
|
|
95
|
+
if (Array.isArray(enums)) {
|
|
96
|
+
dataTypes.push.apply(dataTypes, enums);
|
|
97
|
+
enums.forEach(function (node) {
|
|
98
|
+
var _a = node || {}, name = _a.name, enumItems = _a.enumItems;
|
|
99
|
+
if (node.module) {
|
|
100
|
+
name = "extensions." + node.module.name + ".enums." + name;
|
|
101
|
+
}
|
|
102
|
+
var enumObj = {};
|
|
103
|
+
enumItems.forEach(function (_a) {
|
|
104
|
+
var label = _a.label, value = _a.value;
|
|
105
|
+
enumObj[value] = label;
|
|
106
|
+
});
|
|
107
|
+
enumsMap[name] = enumObj;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (Array.isArray(entities)) {
|
|
111
|
+
dataTypes.push.apply(dataTypes, entities);
|
|
112
|
+
entities.forEach(function (entity) {
|
|
113
|
+
var ns = entity.ns;
|
|
114
|
+
if (Array.isArray(ns === null || ns === void 0 ? void 0 : ns.logics)) {
|
|
115
|
+
allLogics.push.apply(allLogics, ns.logics);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (Array.isArray(structures)) {
|
|
120
|
+
dataTypes.push.apply(dataTypes, structures);
|
|
121
|
+
}
|
|
122
|
+
dataTypes.forEach(function (node) {
|
|
123
|
+
var _a;
|
|
124
|
+
var namespace = node.getNamespace();
|
|
125
|
+
var id = namespace + "." + node.name;
|
|
126
|
+
dataTypesMap[id] = (_a = node.toJSON) === null || _a === void 0 ? void 0 : _a.call(node);
|
|
127
|
+
var properties = (node).properties;
|
|
128
|
+
if (Array.isArray(properties)) {
|
|
129
|
+
properties.forEach(function (property) {
|
|
130
|
+
collectTypeAnnotation(property === null || property === void 0 ? void 0 : property.typeAnnotation);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
[
|
|
135
|
+
{
|
|
136
|
+
namespace: 'nasl.ui',
|
|
137
|
+
list: concepts_1.uiStructures
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
namespace: 'nasl.collection',
|
|
141
|
+
list: concepts_1.collectionStructures
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
namespace: 'nasl.interface',
|
|
145
|
+
list: concepts_1.interfaceStructures
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
namespace: 'nasl.process',
|
|
149
|
+
list: concepts_1.processStructures
|
|
150
|
+
},
|
|
151
|
+
].forEach(function (item) {
|
|
152
|
+
var _a = item || {}, namespace = _a.namespace, list = _a.list;
|
|
153
|
+
if (Array.isArray(list)) {
|
|
154
|
+
list.forEach(function (node) {
|
|
155
|
+
var _a;
|
|
156
|
+
var id = namespace + "." + node.name;
|
|
157
|
+
dataTypesMap[id] = (_a = node.toJSON) === null || _a === void 0 ? void 0 : _a.call(node);
|
|
158
|
+
var properties = (node).properties;
|
|
159
|
+
if (Array.isArray(properties)) {
|
|
160
|
+
properties.forEach(function (property) {
|
|
161
|
+
collectTypeAnnotation(property === null || property === void 0 ? void 0 : property.typeAnnotation);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
if (Array.isArray(logics)) {
|
|
168
|
+
allLogics.push.apply(allLogics, logics);
|
|
169
|
+
}
|
|
170
|
+
allLogics.forEach(function (node) {
|
|
171
|
+
var namespace = node.getNamespace();
|
|
172
|
+
var id = namespace ? namespace + "." + node.name : node.name;
|
|
173
|
+
logicsMap[id] = node.toService();
|
|
174
|
+
});
|
|
175
|
+
processes.forEach(function (process) {
|
|
176
|
+
if (Array.isArray(process.logics)) {
|
|
177
|
+
process.logics.forEach(function (node) {
|
|
178
|
+
var namespace = node.getNamespace();
|
|
179
|
+
var id = namespace ? namespace + "." + node.name : node.name;
|
|
180
|
+
logicsMap[id] = node.toProcessService();
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
interfaces.forEach(function (interfaceItem) {
|
|
185
|
+
_custom[interfaceItem.getNamespace() + "." + interfaceItem.name] = interfaceItem.toService();
|
|
186
|
+
});
|
|
187
|
+
utils.traverse(function (current) {
|
|
188
|
+
var node = (current || {}).node;
|
|
189
|
+
var typeAnnotation = (node === null || node === void 0 ? void 0 : node.typeAnnotation) || (node === null || node === void 0 ? void 0 : node.__TypeAnnotation);
|
|
190
|
+
collectTypeAnnotation(typeAnnotation);
|
|
191
|
+
}, {
|
|
192
|
+
node: {
|
|
193
|
+
children: views
|
|
194
|
+
}
|
|
195
|
+
}, {
|
|
196
|
+
mode: 'anyObject',
|
|
197
|
+
excludedKeySet: new Set([
|
|
198
|
+
'parentNode',
|
|
199
|
+
'sourceMap',
|
|
200
|
+
'storageJSON',
|
|
201
|
+
'tsErrorDetail',
|
|
202
|
+
'NaslAnnotatedJSON',
|
|
203
|
+
'calledFrom',
|
|
204
|
+
'_events',
|
|
205
|
+
'_collectingList',
|
|
206
|
+
'_historyList',
|
|
207
|
+
])
|
|
208
|
+
});
|
|
209
|
+
if (Array.isArray(frontendVariables)) {
|
|
210
|
+
frontendVariables.forEach(function (frontendVariable) {
|
|
211
|
+
var typeAnnotation = frontendVariable.typeAnnotation || frontendVariable.__TypeAnnotation;
|
|
212
|
+
collectTypeAnnotation(typeAnnotation);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function collectTypeAnnotation(typeAnnotation) {
|
|
216
|
+
var _a, _b;
|
|
217
|
+
if (typeAnnotation) {
|
|
218
|
+
var sortedTypeKey = genSortedTypeKey(typeAnnotation);
|
|
219
|
+
if (!dataTypesMap[sortedTypeKey]) {
|
|
220
|
+
dataTypesMap[sortedTypeKey] = (_b = (_a = typeAnnotation === null || typeAnnotation === void 0 ? void 0 : typeAnnotation.toJSON) === null || _a === void 0 ? void 0 : _a.call(typeAnnotation)) !== null && _b !== void 0 ? _b : typeAnnotation;
|
|
221
|
+
var _c = (dataTypesMap[sortedTypeKey] || {}), properties = _c.properties, typeArguments = _c.typeArguments;
|
|
222
|
+
if (Array.isArray(properties)) {
|
|
223
|
+
properties.forEach(function (property) {
|
|
224
|
+
collectTypeAnnotation(property === null || property === void 0 ? void 0 : property.typeAnnotation);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
if (Array.isArray(typeArguments)) {
|
|
228
|
+
typeArguments.forEach(function (typeArg) {
|
|
229
|
+
collectTypeAnnotation(typeArg);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
frontendVariables: frontendVariables,
|
|
237
|
+
dataTypesMap: dataTypesMap,
|
|
238
|
+
enumsMap: enumsMap,
|
|
239
|
+
logicsMap: logicsMap,
|
|
240
|
+
servicesMap: {
|
|
241
|
+
_custom: _custom
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
exports.genMetaData = genMetaData;
|