@lcap/nasl 4.5.0-beta.1 → 4.5.0-beta.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/automate/upgrader/2.12.d.ts.map +1 -1
- package/out/automate/upgrader/2.12.js +1 -0
- package/out/automate/upgrader/2.12.js.map +1 -1
- package/out/automate/upgrader/2.14.d.ts.map +1 -1
- package/out/automate/upgrader/2.14.js +1 -0
- package/out/automate/upgrader/2.14.js.map +1 -1
- package/out/automate/upgrader/2.16.d.ts.map +1 -1
- package/out/automate/upgrader/2.16.js +1 -0
- package/out/automate/upgrader/2.16.js.map +1 -1
- package/out/automate/upgrader/2.17.d.ts.map +1 -1
- package/out/automate/upgrader/2.17.js +1 -0
- package/out/automate/upgrader/2.17.js.map +1 -1
- package/out/automate/upgrader/2.18.d.ts.map +1 -1
- package/out/automate/upgrader/2.18.js +1 -0
- package/out/automate/upgrader/2.18.js.map +1 -1
- package/out/automate/upgrader/2.20.d.ts.map +1 -1
- package/out/automate/upgrader/2.20.js +1 -0
- package/out/automate/upgrader/2.20.js.map +1 -1
- package/out/concepts/index.mini.d.ts +10 -0
- package/out/concepts/index.mini.d.ts.map +1 -0
- package/out/concepts/index.mini.js +26 -0
- package/out/concepts/index.mini.js.map +1 -0
- package/out/generator/genBundleFiles.js +1 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/permission.js +2 -2
- package/out/generator/permission.js.map +1 -1
- package/out/generator/ui-library-declaration/dependency.d.ts +20 -0
- package/out/generator/ui-library-declaration/dependency.d.ts.map +1 -1
- package/out/generator/ui-library-declaration/dependency.js +3 -2
- package/out/generator/ui-library-declaration/dependency.js.map +1 -1
- package/out/generator/ui-library-declaration/index.d.ts +1 -0
- package/out/generator/ui-library-declaration/index.d.ts.map +1 -1
- package/out/generator/ui-library-declaration/index.js +1 -0
- package/out/generator/ui-library-declaration/index.js.map +1 -1
- package/out/generator/ui-library-declaration/material.d.ts +2 -2
- package/out/generator/ui-library-declaration/material.d.ts.map +1 -1
- package/out/generator/ui-library-declaration/material.js +6 -3
- package/out/generator/ui-library-declaration/material.js.map +1 -1
- package/out/index.d.ts +2 -2
- package/out/index.d.ts.map +1 -1
- package/out/index.js +7 -1
- package/out/index.js.map +1 -1
- package/out/index.mini.d.ts +42 -0
- package/out/index.mini.d.ts.map +1 -0
- package/out/index.mini.js +89 -0
- package/out/index.mini.js.map +1 -0
- package/out/manager/diagnostic.d.ts +5 -5
- package/out/manager/diagnostic.d.ts.map +1 -1
- package/out/natural/exports/doctor/doctorView.d.ts +24 -0
- package/out/natural/exports/doctor/doctorView.d.ts.map +1 -0
- package/out/natural/exports/doctor/doctorView.js +333 -0
- package/out/natural/exports/doctor/doctorView.js.map +1 -0
- package/out/natural/exports/doctor/index.d.ts +4 -0
- package/out/natural/exports/doctor/index.d.ts.map +1 -0
- package/out/natural/exports/doctor/index.js +10 -0
- package/out/natural/exports/doctor/index.js.map +1 -0
- package/out/natural/exports/doctor/types.d.ts +95 -0
- package/out/natural/exports/doctor/types.d.ts.map +1 -0
- package/out/natural/exports/doctor/types.js +6 -0
- package/out/natural/exports/doctor/types.js.map +1 -0
- package/out/natural/exports/doctor/viewGraph.d.ts +20 -0
- package/out/natural/exports/doctor/viewGraph.d.ts.map +1 -0
- package/out/natural/exports/doctor/viewGraph.js +415 -0
- package/out/natural/exports/doctor/viewGraph.js.map +1 -0
- package/out/natural/exports/nasl2Files.d.ts.map +1 -1
- package/out/natural/exports/nasl2Files.js +35 -1
- package/out/natural/exports/nasl2Files.js.map +1 -1
- package/out/natural/exports/transform2BatchActions/apply.d.ts +11 -0
- package/out/natural/exports/transform2BatchActions/apply.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/apply.js +68 -0
- package/out/natural/exports/transform2BatchActions/apply.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/directories.d.ts +17 -0
- package/out/natural/exports/transform2BatchActions/diff/directories.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/directories.js +215 -0
- package/out/natural/exports/transform2BatchActions/diff/directories.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/index.d.ts +21 -0
- package/out/natural/exports/transform2BatchActions/diff/index.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/index.js +20 -0
- package/out/natural/exports/transform2BatchActions/diff/index.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/nodes.d.ts +162 -0
- package/out/natural/exports/transform2BatchActions/diff/nodes.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/nodes.js +464 -0
- package/out/natural/exports/transform2BatchActions/diff/nodes.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/roles.d.ts +18 -0
- package/out/natural/exports/transform2BatchActions/diff/roles.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/roles.js +61 -0
- package/out/natural/exports/transform2BatchActions/diff/roles.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/index.d.ts +41 -0
- package/out/natural/exports/transform2BatchActions/index.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/index.js +61 -0
- package/out/natural/exports/transform2BatchActions/index.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/parse.d.ts +24 -0
- package/out/natural/exports/transform2BatchActions/parse.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/parse.js +234 -0
- package/out/natural/exports/transform2BatchActions/parse.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/types.d.ts +147 -0
- package/out/natural/exports/transform2BatchActions/types.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/types.js +7 -0
- package/out/natural/exports/transform2BatchActions/types.js.map +1 -0
- package/out/natural/index.d.ts +1 -0
- package/out/natural/index.d.ts.map +1 -1
- package/out/natural/index.js +1 -0
- package/out/natural/index.js.map +1 -1
- package/out/natural/old/parser/transformTS2UI.d.ts.map +1 -1
- package/out/natural/old/parser/transformTS2UI.js +4 -1
- package/out/natural/old/parser/transformTS2UI.js.map +1 -1
- package/out/natural/old/parser/transformTSCode.js +1 -1
- package/out/natural/old/parser/transformTSCode.js.map +1 -1
- package/out/natural/parser/parseNaturalTS.d.ts.map +1 -1
- package/out/natural/parser/parseNaturalTS.js +61 -1
- package/out/natural/parser/parseNaturalTS.js.map +1 -1
- package/out/natural/parser/parseNaturalTSXView.d.ts.map +1 -1
- package/out/natural/parser/parseNaturalTSXView.js +37 -7
- package/out/natural/parser/parseNaturalTSXView.js.map +1 -1
- package/out/natural/transforms/checker/checkIdentifierName.d.ts +6 -0
- package/out/natural/transforms/checker/checkIdentifierName.d.ts.map +1 -0
- package/out/natural/transforms/checker/checkIdentifierName.js +15 -0
- package/out/natural/transforms/checker/checkIdentifierName.js.map +1 -0
- package/out/natural/transforms/checker/checkKeywords.d.ts +33 -0
- package/out/natural/transforms/checker/checkKeywords.d.ts.map +1 -0
- package/out/natural/transforms/checker/checkKeywords.js +85 -0
- package/out/natural/transforms/checker/checkKeywords.js.map +1 -0
- package/out/natural/transforms/checker/checkViewElement.d.ts +10 -0
- package/out/natural/transforms/checker/checkViewElement.d.ts.map +1 -1
- package/out/natural/transforms/checker/checkViewElement.js +28 -1
- package/out/natural/transforms/checker/checkViewElement.js.map +1 -1
- package/out/natural/transforms/checker/index.d.ts +3 -1
- package/out/natural/transforms/checker/index.d.ts.map +1 -1
- package/out/natural/transforms/checker/index.js +10 -1
- package/out/natural/transforms/checker/index.js.map +1 -1
- package/out/natural/transforms/transform2Config.d.ts +17 -0
- package/out/natural/transforms/transform2Config.d.ts.map +1 -0
- package/out/natural/transforms/transform2Config.js +114 -0
- package/out/natural/transforms/transform2Config.js.map +1 -0
- package/out/natural/transforms/transform2Entity.d.ts +2 -2
- package/out/natural/transforms/transform2Entity.d.ts.map +1 -1
- package/out/natural/transforms/transform2Entity.js +11 -2
- package/out/natural/transforms/transform2Entity.js.map +1 -1
- package/out/natural/transforms/transform2Enum.d.ts.map +1 -1
- package/out/natural/transforms/transform2Enum.js +3 -0
- package/out/natural/transforms/transform2Enum.js.map +1 -1
- package/out/natural/transforms/transform2GlobalLogicDeclaration.d.ts.map +1 -1
- package/out/natural/transforms/transform2GlobalLogicDeclaration.js +4 -1
- package/out/natural/transforms/transform2GlobalLogicDeclaration.js.map +1 -1
- package/out/natural/transforms/transform2Logic.d.ts.map +1 -1
- package/out/natural/transforms/transform2Logic.js +6 -12
- package/out/natural/transforms/transform2Logic.js.map +1 -1
- package/out/natural/transforms/transform2LogicItem.d.ts +2 -0
- package/out/natural/transforms/transform2LogicItem.d.ts.map +1 -1
- package/out/natural/transforms/transform2LogicItem.js +110 -53
- package/out/natural/transforms/transform2LogicItem.js.map +1 -1
- package/out/natural/transforms/transform2Param.d.ts +1 -1
- package/out/natural/transforms/transform2Param.d.ts.map +1 -1
- package/out/natural/transforms/transform2Param.js +19 -1
- package/out/natural/transforms/transform2Param.js.map +1 -1
- package/out/natural/transforms/transform2Roles.d.ts +3 -0
- package/out/natural/transforms/transform2Roles.d.ts.map +1 -0
- package/out/natural/transforms/transform2Roles.js +34 -0
- package/out/natural/transforms/transform2Roles.js.map +1 -0
- package/out/natural/transforms/transform2Structure.d.ts.map +1 -1
- package/out/natural/transforms/transform2Structure.js +2 -0
- package/out/natural/transforms/transform2Structure.js.map +1 -1
- package/out/natural/transforms/transform2TypeAnnotation.d.ts.map +1 -1
- package/out/natural/transforms/transform2TypeAnnotation.js +8 -4
- package/out/natural/transforms/transform2TypeAnnotation.js.map +1 -1
- package/out/natural/transforms/transform2Variable.d.ts.map +1 -1
- package/out/natural/transforms/transform2Variable.js +4 -0
- package/out/natural/transforms/transform2Variable.js.map +1 -1
- package/out/natural/transforms/utils/createComponentLookupMap.js +3 -3
- package/out/natural/transforms/utils/createComponentLookupMap.js.map +1 -1
- package/out/natural/transforms/utils/ensureBindRoles.d.ts +9 -0
- package/out/natural/transforms/utils/ensureBindRoles.d.ts.map +1 -0
- package/out/natural/transforms/utils/ensureBindRoles.js +25 -0
- package/out/natural/transforms/utils/ensureBindRoles.js.map +1 -0
- package/out/natural/transforms/utils/flattenStatementsWithComments.d.ts +11 -0
- package/out/natural/transforms/utils/flattenStatementsWithComments.d.ts.map +1 -0
- package/out/natural/transforms/utils/flattenStatementsWithComments.js +36 -0
- package/out/natural/transforms/utils/flattenStatementsWithComments.js.map +1 -0
- package/out/natural/transforms/utils/parseDecorator.d.ts +4 -4
- package/out/natural/transforms/utils/parseDecorator.d.ts.map +1 -1
- package/out/natural/transforms/utils/parseDecorator.js +29 -25
- package/out/natural/transforms/utils/parseDecorator.js.map +1 -1
- package/out/natural/utils/index.d.ts +5 -0
- package/out/natural/utils/index.d.ts.map +1 -1
- package/out/natural/utils/index.js +11 -1
- package/out/natural/utils/index.js.map +1 -1
- package/out/natural/utils/nasl-file-types.d.ts +6 -1
- package/out/natural/utils/nasl-file-types.d.ts.map +1 -1
- package/out/natural/utils/nasl-file-types.js +49 -2
- package/out/natural/utils/nasl-file-types.js.map +1 -1
- package/out/server/extendBaseNode.d.ts.map +1 -1
- package/out/server/extendBaseNode.js +9 -3
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/naslServer.d.ts +18 -0
- package/out/server/naslServer.d.ts.map +1 -1
- package/out/server/naslServer.js +88 -0
- package/out/server/naslServer.js.map +1 -1
- package/out/server/naslUiComponentTs.d.ts +1 -2
- package/out/server/naslUiComponentTs.d.ts.map +1 -1
- package/out/server/naslUiComponentTs.default.d.ts +47 -0
- package/out/server/naslUiComponentTs.js +25 -49
- package/out/server/naslUiComponentTs.js.map +1 -1
- package/out/service/autofix/types.d.ts +2 -2
- package/out/service/autofix/types.d.ts.map +1 -1
- package/out/service/instruct-ruler/ruler.d.ts +3 -1
- package/out/service/instruct-ruler/ruler.d.ts.map +1 -1
- package/out/service/instruct-ruler/ruler.js +2 -1
- package/out/service/instruct-ruler/ruler.js.map +1 -1
- package/out/service/storage/init.d.ts +6 -0
- package/out/service/storage/init.d.ts.map +1 -1
- package/out/service/storage/init.js +22 -9
- package/out/service/storage/init.js.map +1 -1
- package/out/service/storage/operation.d.ts +9 -1
- package/out/service/storage/operation.d.ts.map +1 -1
- package/out/service/storage/operation.js +220 -100
- package/out/service/storage/operation.js.map +1 -1
- package/out/service/storage/specTools.d.ts.map +1 -1
- package/out/service/storage/specTools.js +15 -6
- package/out/service/storage/specTools.js.map +1 -1
- package/out/templator/genQueryComponent.d.ts +13 -1
- package/out/templator/genQueryComponent.d.ts.map +1 -1
- package/out/templator/genQueryComponent.js +18 -14
- package/out/templator/genQueryComponent.js.map +1 -1
- package/package.json +11 -10
- package/sandbox/stdlib/nasl.util.ts +16 -15
- package/out/natural/exports/transform2BatchActions.d.ts +0 -114
- package/out/natural/exports/transform2BatchActions.d.ts.map +0 -1
- package/out/natural/exports/transform2BatchActions.js +0 -1233
- package/out/natural/exports/transform2BatchActions.js.map +0 -1
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.doctorViewJson = exports.doctorView = void 0;
|
|
4
|
+
const viewGraph_1 = require("./viewGraph");
|
|
5
|
+
/**
|
|
6
|
+
* Generate a diagnostic report for the App's view navigation structure.
|
|
7
|
+
*
|
|
8
|
+
* @param app - NASL App instance (from BaseNode.from(parseNaturalTS(content).toJSON()))
|
|
9
|
+
* @param options - Control which report sections to include
|
|
10
|
+
* @returns Formatted markdown report string
|
|
11
|
+
*/
|
|
12
|
+
function doctorView(app, options) {
|
|
13
|
+
const includeRoots = !!options?.unrefViewsIncludesRoots;
|
|
14
|
+
const graphResult = doctorViewJson(app, { unrefViewsIncludesRoots: includeRoots });
|
|
15
|
+
const hideCode = !!options?.hideCode;
|
|
16
|
+
// Determine which sections to output.
|
|
17
|
+
const hasExplicitSection = options?.viewTree !== undefined
|
|
18
|
+
|| options?.reverseRefs !== undefined
|
|
19
|
+
|| options?.unrefViews !== undefined
|
|
20
|
+
|| (options?.roleAccess !== undefined);
|
|
21
|
+
const showViewTree = hasExplicitSection ? !!options?.viewTree : true;
|
|
22
|
+
const showReverseRefs = hasExplicitSection ? !!options?.reverseRefs : true;
|
|
23
|
+
const showUnrefViews = hasExplicitSection ? !!options?.unrefViews : true;
|
|
24
|
+
const roles = options?.roleAccess || [];
|
|
25
|
+
const showRoleAccess = hasExplicitSection ? roles.length > 0 : false;
|
|
26
|
+
const parts = [];
|
|
27
|
+
if (showViewTree) {
|
|
28
|
+
parts.push(renderViewTree(graphResult, hideCode));
|
|
29
|
+
}
|
|
30
|
+
if (showReverseRefs) {
|
|
31
|
+
parts.push(renderReverseReferences(graphResult, hideCode));
|
|
32
|
+
}
|
|
33
|
+
if (showUnrefViews) {
|
|
34
|
+
parts.push(renderUnreferencedViews(graphResult));
|
|
35
|
+
}
|
|
36
|
+
if (showRoleAccess && roles.length > 0) {
|
|
37
|
+
parts.push(renderRoleAccessTrees(graphResult, roles, hideCode));
|
|
38
|
+
}
|
|
39
|
+
return parts.join('\n\n');
|
|
40
|
+
}
|
|
41
|
+
exports.doctorView = doctorView;
|
|
42
|
+
/**
|
|
43
|
+
* Generate a DoctorViewResult for the App's view navigation structure.
|
|
44
|
+
* Result extends ViewGraph with computed unrefViews.
|
|
45
|
+
*/
|
|
46
|
+
function doctorViewJson(app, options) {
|
|
47
|
+
const graph = (0, viewGraph_1.buildViewGraph)(app);
|
|
48
|
+
const includeRoots = !!options?.unrefViewsIncludesRoots;
|
|
49
|
+
const unreferenced = findUnreferencedPages(graph, !includeRoots);
|
|
50
|
+
return {
|
|
51
|
+
...graph,
|
|
52
|
+
unrefViews: unreferenced.map((n) => n.path),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
exports.doctorViewJson = doctorViewJson;
|
|
56
|
+
// ============================================================================
|
|
57
|
+
// Section 1: View Tree
|
|
58
|
+
// ============================================================================
|
|
59
|
+
function renderViewTree(graph, hideCode) {
|
|
60
|
+
const lines = ['## 页面树\n'];
|
|
61
|
+
for (const rootPath of graph.rootPaths) {
|
|
62
|
+
renderViewSubtree(graph, rootPath, lines, 0, { abbreviateRoles: false }, hideCode);
|
|
63
|
+
}
|
|
64
|
+
return lines.join('\n');
|
|
65
|
+
}
|
|
66
|
+
// ============================================================================
|
|
67
|
+
// Section 2: Reverse References
|
|
68
|
+
// ============================================================================
|
|
69
|
+
function renderReverseReferences(graph, hideCode) {
|
|
70
|
+
const lines = ['## 反向引用\n'];
|
|
71
|
+
for (const rootPath of graph.rootPaths) {
|
|
72
|
+
renderReverseSubtree(graph, rootPath, lines, 0, hideCode);
|
|
73
|
+
}
|
|
74
|
+
return lines.join('\n');
|
|
75
|
+
}
|
|
76
|
+
// ============================================================================
|
|
77
|
+
// Section 3: Unreferenced Views
|
|
78
|
+
// ============================================================================
|
|
79
|
+
function renderUnreferencedViews(graphResult) {
|
|
80
|
+
const lines = ['## 没有默认跳转且没有被引用的页面\n'];
|
|
81
|
+
if (graphResult.unrefViews.length) {
|
|
82
|
+
lines.push('**注意:以下页面没有默认跳转且没有被引用,可能实现存在问题。**\n');
|
|
83
|
+
for (const path of graphResult.unrefViews) {
|
|
84
|
+
const node = graphResult.flatRouteMap.get(path);
|
|
85
|
+
if (!node)
|
|
86
|
+
continue;
|
|
87
|
+
const title = node.levels[node.levels.length - 1] || '';
|
|
88
|
+
lines.push(`- (${title})${node.path}(${node.params || ''})${formatTags(node, { abbreviateRoles: false })}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
lines.push('链路通畅,没有问题。\n');
|
|
93
|
+
}
|
|
94
|
+
return lines.join('\n');
|
|
95
|
+
}
|
|
96
|
+
// ============================================================================
|
|
97
|
+
// Section 4: Per-Role Access Analysis
|
|
98
|
+
// ============================================================================
|
|
99
|
+
function renderRoleAccessTrees(graph, roles, hideCode) {
|
|
100
|
+
const lines = ['## 各角色可访问分析\n'];
|
|
101
|
+
for (const role of roles) {
|
|
102
|
+
lines.push(`### 角色 ${role} 可访问的页面树\n`);
|
|
103
|
+
lines.push('<!-- 下面树中没有出现的,表示该角色无法访问(包括页面鉴权不允许、没有跳转链路或跳转链接鉴权不允许到该页面,不包括逻辑中的动态鉴权) -->\n');
|
|
104
|
+
const reachable = computeReachablePages(graph, role);
|
|
105
|
+
for (const rootPath of graph.rootPaths) {
|
|
106
|
+
renderRoleSubtree(graph, rootPath, lines, 0, role, reachable, hideCode);
|
|
107
|
+
}
|
|
108
|
+
lines.push('');
|
|
109
|
+
}
|
|
110
|
+
return lines.join('\n');
|
|
111
|
+
}
|
|
112
|
+
function renderViewSubtree(graph, path, lines, indent, opts, hideCode) {
|
|
113
|
+
const node = graph.flatRouteMap.get(path);
|
|
114
|
+
if (!node)
|
|
115
|
+
return;
|
|
116
|
+
const title = node.levels[node.levels.length - 1] || '';
|
|
117
|
+
const prefix = makeTreePrefix(indent);
|
|
118
|
+
lines.push(`${prefix}(${title})${node.alias}(${node.params || ''})${formatTags(node, opts)}`);
|
|
119
|
+
// Show forward edges (outgoing navigation)
|
|
120
|
+
const edges = graph.forwardEdgeMap.get(path) || [];
|
|
121
|
+
for (const edge of edges) {
|
|
122
|
+
const edgePrefix = makeEdgePrefix(indent + 1);
|
|
123
|
+
if (hideCode) {
|
|
124
|
+
lines.push(`${edgePrefix}跳转到:${edge.toPath}()`);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
lines.push(`${edgePrefix}跳转到:${edge.toPath}(),相关代码:\`${edge.codeSnippet}\``);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
// Recurse children
|
|
131
|
+
for (const childPath of node.childrenPaths) {
|
|
132
|
+
renderViewSubtree(graph, childPath, lines, indent + 1, opts, hideCode);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function renderReverseSubtree(graph, path, lines, indent, hideCode) {
|
|
136
|
+
const node = graph.flatRouteMap.get(path);
|
|
137
|
+
if (!node)
|
|
138
|
+
return;
|
|
139
|
+
const title = node.levels[node.levels.length - 1] || '';
|
|
140
|
+
const prefix = makeTreePrefix(indent);
|
|
141
|
+
lines.push(`${prefix}(${title})${node.alias}(${node.params || ''})${formatTags(node, { abbreviateRoles: false })}`);
|
|
142
|
+
// Show reverse edges (incoming navigation)
|
|
143
|
+
const edges = graph.reverseEdgeMap.get(path) || [];
|
|
144
|
+
for (const edge of edges) {
|
|
145
|
+
const edgePrefix = makeReverseEdgePrefix(indent + 1);
|
|
146
|
+
if (hideCode) {
|
|
147
|
+
lines.push(`${edgePrefix}被 ${edge.fromPath} 跳转引用`);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
lines.push(`${edgePrefix}被 ${edge.fromPath} 跳转引用,相关代码:\`${edge.codeSnippet}\``);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Recurse children
|
|
154
|
+
for (const childPath of node.childrenPaths) {
|
|
155
|
+
renderReverseSubtree(graph, childPath, lines, indent + 1, hideCode);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
function renderRoleSubtree(graph, path, lines, indent, role, reachable, hideCode) {
|
|
159
|
+
if (!reachable.has(path))
|
|
160
|
+
return;
|
|
161
|
+
const node = graph.flatRouteMap.get(path);
|
|
162
|
+
if (!node)
|
|
163
|
+
return;
|
|
164
|
+
const title = node.levels[node.levels.length - 1] || '';
|
|
165
|
+
const prefix = makeTreePrefix(indent);
|
|
166
|
+
lines.push(`${prefix}(${title})${node.alias}(${node.params || ''})${formatTags(node, { abbreviateRoles: true })}`);
|
|
167
|
+
// Show forward edges only if the role can use them
|
|
168
|
+
const edges = graph.forwardEdgeMap.get(path) || [];
|
|
169
|
+
for (const edge of edges) {
|
|
170
|
+
if (reachable.has(edge.toPath) && canRoleUseEdge(edge, role)) {
|
|
171
|
+
const edgePrefix = makeEdgePrefix(indent + 1);
|
|
172
|
+
if (hideCode) {
|
|
173
|
+
lines.push(`${edgePrefix}跳转到:${edge.toPath}()`);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
lines.push(`${edgePrefix}跳转到:${edge.toPath}(),相关代码:\`${edge.codeSnippet}\``);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// Recurse children
|
|
181
|
+
for (const childPath of node.childrenPaths) {
|
|
182
|
+
renderRoleSubtree(graph, childPath, lines, indent + 1, role, reachable, hideCode);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// ============================================================================
|
|
186
|
+
// Role Reachability Analysis (BFS on navigation graph)
|
|
187
|
+
// ============================================================================
|
|
188
|
+
/**
|
|
189
|
+
* Compute the set of view paths reachable by a given role.
|
|
190
|
+
*/
|
|
191
|
+
function computeReachablePages(graph, role) {
|
|
192
|
+
const reachable = new Set();
|
|
193
|
+
const queue = [];
|
|
194
|
+
for (const rootPath of graph.rootPaths) {
|
|
195
|
+
const node = graph.flatRouteMap.get(rootPath);
|
|
196
|
+
if (node && isPageAccessibleToRole(node, role)) {
|
|
197
|
+
reachable.add(rootPath);
|
|
198
|
+
queue.push(rootPath);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
while (queue.length > 0) {
|
|
202
|
+
const currentPath = queue.shift();
|
|
203
|
+
const node = graph.flatRouteMap.get(currentPath);
|
|
204
|
+
for (const childPath of node.childrenPaths) {
|
|
205
|
+
if (reachable.has(childPath))
|
|
206
|
+
continue;
|
|
207
|
+
const child = graph.flatRouteMap.get(childPath);
|
|
208
|
+
if (!child)
|
|
209
|
+
continue;
|
|
210
|
+
if (child.isIndex && isPageAccessibleToRole(child, role)) {
|
|
211
|
+
reachable.add(childPath);
|
|
212
|
+
queue.push(childPath);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const edges = graph.forwardEdgeMap.get(currentPath) || [];
|
|
216
|
+
for (const edge of edges) {
|
|
217
|
+
if (reachable.has(edge.toPath))
|
|
218
|
+
continue;
|
|
219
|
+
if (!canRoleUseEdge(edge, role))
|
|
220
|
+
continue;
|
|
221
|
+
const target = graph.flatRouteMap.get(edge.toPath);
|
|
222
|
+
if (!target)
|
|
223
|
+
continue;
|
|
224
|
+
if (isPageAccessibleToRole(target, role)) {
|
|
225
|
+
reachable.add(edge.toPath);
|
|
226
|
+
queue.push(edge.toPath);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// Post-pass: mark ancestors as reachable (nested routing)
|
|
231
|
+
const toAdd = [];
|
|
232
|
+
for (const path of reachable) {
|
|
233
|
+
let node = graph.flatRouteMap.get(path);
|
|
234
|
+
while (node && node.parentPath) {
|
|
235
|
+
if (reachable.has(node.parentPath))
|
|
236
|
+
break;
|
|
237
|
+
const parent = graph.flatRouteMap.get(node.parentPath);
|
|
238
|
+
if (parent && isPageAccessibleToRole(parent, role)) {
|
|
239
|
+
toAdd.push(node.parentPath);
|
|
240
|
+
}
|
|
241
|
+
node = parent;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
for (const p of toAdd) {
|
|
245
|
+
reachable.add(p);
|
|
246
|
+
}
|
|
247
|
+
return reachable;
|
|
248
|
+
}
|
|
249
|
+
function isPageAccessibleToRole(node, role) {
|
|
250
|
+
if (!node.auth)
|
|
251
|
+
return true;
|
|
252
|
+
return (node.bindRoles || []).includes(role);
|
|
253
|
+
}
|
|
254
|
+
function canRoleUseEdge(edge, role) {
|
|
255
|
+
if (!edge.elementAuth && edge.elementBindRoles.length === 0)
|
|
256
|
+
return true;
|
|
257
|
+
if (edge.elementBindRoles.length > 0) {
|
|
258
|
+
return edge.elementBindRoles.includes(role);
|
|
259
|
+
}
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
// ============================================================================
|
|
263
|
+
// Formatting Utilities
|
|
264
|
+
// ============================================================================
|
|
265
|
+
function formatTags(node, opts) {
|
|
266
|
+
const tags = [];
|
|
267
|
+
if (node.isIndex)
|
|
268
|
+
tags.push('#默认跳转');
|
|
269
|
+
if (!node.auth) {
|
|
270
|
+
tags.push('#不鉴权');
|
|
271
|
+
}
|
|
272
|
+
else if (node.bindRoles && node.bindRoles.length > 0) {
|
|
273
|
+
if (opts.abbreviateRoles) {
|
|
274
|
+
tags.push('#鉴权角色:略');
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
tags.push(`#鉴权角色:${JSON.stringify(node.bindRoles)}`);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
tags.push('#鉴权(未配置角色)');
|
|
282
|
+
}
|
|
283
|
+
return tags.length ? ' ' + tags.join(' ') : '';
|
|
284
|
+
}
|
|
285
|
+
function makeTreePrefix(indent) {
|
|
286
|
+
if (indent === 0)
|
|
287
|
+
return '├── ';
|
|
288
|
+
return ' '.repeat(indent) + '├── ';
|
|
289
|
+
}
|
|
290
|
+
function makeEdgePrefix(indent) {
|
|
291
|
+
return ' '.repeat(indent) + '└─► ';
|
|
292
|
+
}
|
|
293
|
+
function makeReverseEdgePrefix(indent) {
|
|
294
|
+
return ' '.repeat(indent) + '◄── ';
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Find pages that are not isIndex AND not referenced (no incoming edges).
|
|
298
|
+
* If ignoreRootView is true, root-level views are excluded.
|
|
299
|
+
* If a child is referenced, its ancestors are considered implicitly referenced.
|
|
300
|
+
*/
|
|
301
|
+
function findUnreferencedPages(graph, ignoreRootView) {
|
|
302
|
+
const referenced = new Set();
|
|
303
|
+
for (const [path, node] of graph.flatRouteMap) {
|
|
304
|
+
if (node.isIndex) {
|
|
305
|
+
referenced.add(path);
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
const incoming = graph.reverseEdgeMap.get(path) || [];
|
|
309
|
+
if (incoming.length > 0) {
|
|
310
|
+
referenced.add(path);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
// Propagate: if a child is referenced, mark all ancestors as implicitly referenced
|
|
314
|
+
for (const path of [...referenced]) {
|
|
315
|
+
let node = graph.flatRouteMap.get(path);
|
|
316
|
+
while (node && node.parentPath) {
|
|
317
|
+
if (referenced.has(node.parentPath))
|
|
318
|
+
break;
|
|
319
|
+
referenced.add(node.parentPath);
|
|
320
|
+
node = graph.flatRouteMap.get(node.parentPath);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
const result = [];
|
|
324
|
+
for (const [path, node] of graph.flatRouteMap) {
|
|
325
|
+
if (referenced.has(path))
|
|
326
|
+
continue;
|
|
327
|
+
if (ignoreRootView && node.parentPath === null)
|
|
328
|
+
continue;
|
|
329
|
+
result.push(node);
|
|
330
|
+
}
|
|
331
|
+
return result;
|
|
332
|
+
}
|
|
333
|
+
//# sourceMappingURL=doctorView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctorView.js","sourceRoot":"","sources":["../../../../src/natural/exports/doctor/doctorView.ts"],"names":[],"mappings":";;;AAUA,2CAA6C;AAE7C;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,GAAQ,EAAE,OAA2B;IAC9D,MAAM,YAAY,GAAG,CAAC,CAAC,OAAO,EAAE,uBAAuB,CAAC;IACxD,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,EAAE,EAAE,uBAAuB,EAAE,YAAY,EAAE,CAAC,CAAC;IACnF,MAAM,QAAQ,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC;IAErC,sCAAsC;IACtC,MAAM,kBAAkB,GAAG,OAAO,EAAE,QAAQ,KAAK,SAAS;WACrD,OAAO,EAAE,WAAW,KAAK,SAAS;WAClC,OAAO,EAAE,UAAU,KAAK,SAAS;WACjC,CAAC,OAAO,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC;IAEzC,MAAM,YAAY,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IACrE,MAAM,eAAe,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3E,MAAM,cAAc,GAAG,kBAAkB,CAAC,CA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C,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACtD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IAED,mFAAmF;IACnF,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC;QACnC,IAAI,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxC,OAAO,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YAC/B,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC;gBAAE,MAAM;YAC3C,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAChC,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAoB,EAAE,CAAC;IACnC,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QAC9C,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QACnC,IAAI,cAAc,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI;YAAE,SAAS;QACzD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { doctorView, doctorViewJson } from './doctorView';
|
|
2
|
+
export { buildViewGraph, buildViewRoutes } from './viewGraph';
|
|
3
|
+
export type { DoctorViewOptions, DoctorViewResult, RouteItem, RouteItemTemp, ViewGraph, NavigationEdge } from './types';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/natural/exports/doctor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildViewRoutes = exports.buildViewGraph = exports.doctorViewJson = exports.doctorView = void 0;
|
|
4
|
+
var doctorView_1 = require("./doctorView");
|
|
5
|
+
Object.defineProperty(exports, "doctorView", { enumerable: true, get: function () { return doctorView_1.doctorView; } });
|
|
6
|
+
Object.defineProperty(exports, "doctorViewJson", { enumerable: true, get: function () { return doctorView_1.doctorViewJson; } });
|
|
7
|
+
var viewGraph_1 = require("./viewGraph");
|
|
8
|
+
Object.defineProperty(exports, "buildViewGraph", { enumerable: true, get: function () { return viewGraph_1.buildViewGraph; } });
|
|
9
|
+
Object.defineProperty(exports, "buildViewRoutes", { enumerable: true, get: function () { return viewGraph_1.buildViewRoutes; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/natural/exports/doctor/index.ts"],"names":[],"mappings":";;;AAAA,2CAA0D;AAAjD,wGAAA,UAAU,OAAA;AAAE,4GAAA,cAAc,OAAA;AACnC,yCAA8D;AAArD,2GAAA,cAAc,OAAA;AAAE,4GAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DoctorView - View topology analysis types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Base route item - can be used standalone for simpler route listing scenarios.
|
|
6
|
+
*/
|
|
7
|
+
export interface RouteItem {
|
|
8
|
+
/** View titles from root parent to current view (Chinese display name) */
|
|
9
|
+
levels: string[];
|
|
10
|
+
/** View type */
|
|
11
|
+
type: 'layout' | 'crud' | 'overview_with_chart' | 'list' | 'form' | 'detail' | 'router_container' | 'other' | 'login' | '';
|
|
12
|
+
/** View name (used as route segment, alias) */
|
|
13
|
+
alias: string;
|
|
14
|
+
/** Full path from root, e.g. "/dashboard/customerManagement/customerList" */
|
|
15
|
+
path: string;
|
|
16
|
+
/** View description */
|
|
17
|
+
description: string;
|
|
18
|
+
/** Whether this is the default/index page */
|
|
19
|
+
isIndex?: boolean;
|
|
20
|
+
/** Whether auth is required (false means no auth) */
|
|
21
|
+
auth?: boolean;
|
|
22
|
+
/** Serialized params string, e.g. "id: Integer" */
|
|
23
|
+
params?: string;
|
|
24
|
+
/** Roles that can access this page (only meaningful when auth=true) */
|
|
25
|
+
bindRoles?: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Extended route item with tree navigation info.
|
|
29
|
+
* Used internally during graph building.
|
|
30
|
+
*/
|
|
31
|
+
export interface RouteItemTemp extends RouteItem {
|
|
32
|
+
/** Parent view's path (null for root views) */
|
|
33
|
+
parentPath: string | null;
|
|
34
|
+
/** Children paths (ordered) */
|
|
35
|
+
childrenPaths: string[];
|
|
36
|
+
/** Depth in the tree (0 = root) */
|
|
37
|
+
depth: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Represents a navigation edge (a link/destination from one view to another)
|
|
41
|
+
*/
|
|
42
|
+
export interface NavigationEdge {
|
|
43
|
+
/** Path of the source view containing this navigation */
|
|
44
|
+
fromPath: string;
|
|
45
|
+
/** Path of the target view */
|
|
46
|
+
toPath: string;
|
|
47
|
+
/** Code snippet showing the navigation element (single line, trimmed) */
|
|
48
|
+
codeSnippet: string;
|
|
49
|
+
/** Roles restriction on the element containing this destination (empty = no restriction) */
|
|
50
|
+
elementBindRoles: string[];
|
|
51
|
+
/** Whether the element has $auth=true */
|
|
52
|
+
elementAuth: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The complete topology graph for view navigation analysis.
|
|
56
|
+
* This is the reusable intermediate structure.
|
|
57
|
+
*/
|
|
58
|
+
export interface ViewGraph {
|
|
59
|
+
/** All view nodes indexed by path */
|
|
60
|
+
flatRouteMap: Map<string, RouteItemTemp>;
|
|
61
|
+
/** Ordered list of root view paths */
|
|
62
|
+
rootPaths: string[];
|
|
63
|
+
/** Forward edges: from path -> list of edges going OUT of that view */
|
|
64
|
+
forwardEdgeMap: Map<string, NavigationEdge[]>;
|
|
65
|
+
/** Reverse edges: to path -> list of edges coming IN to that view */
|
|
66
|
+
reverseEdgeMap: Map<string, NavigationEdge[]>;
|
|
67
|
+
/** All roles found across all views */
|
|
68
|
+
allRoleSet: Set<string>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Result of doctorView JSON analysis.
|
|
72
|
+
* Extends ViewGraph with computed unreferenced views.
|
|
73
|
+
*/
|
|
74
|
+
export interface DoctorViewResult extends ViewGraph {
|
|
75
|
+
/** Paths of unreferenced views */
|
|
76
|
+
unrefViews: string[];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Options for doctorView report generation
|
|
80
|
+
*/
|
|
81
|
+
export interface DoctorViewOptions {
|
|
82
|
+
/** Output view tree section. Default: true (when no specific options given) */
|
|
83
|
+
viewTree?: boolean;
|
|
84
|
+
/** Output reverse references section. Default: true (when no specific options given) */
|
|
85
|
+
reverseRefs?: boolean;
|
|
86
|
+
/** Output unreferenced views section. Default: true (when no specific options given) */
|
|
87
|
+
unrefViews?: boolean;
|
|
88
|
+
/** Roles to analyze accessibility for. Empty/undefined = skip role access section */
|
|
89
|
+
roleAccess?: string[];
|
|
90
|
+
/** Include root views in unreferenced analysis. Default: false */
|
|
91
|
+
unrefViewsIncludesRoots?: boolean;
|
|
92
|
+
/** Hide code snippets in report. Default: false */
|
|
93
|
+
hideCode?: boolean;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/natural/exports/doctor/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gBAAgB;IAChB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,qBAAqB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC;IAC3H,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qDAAqD;IACrD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,+CAA+C;IAC/C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,+BAA+B;IAC/B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,WAAW,EAAE,MAAM,CAAC;IACpB,4FAA4F;IAC5F,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,yCAAyC;IACzC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,qCAAqC;IACrC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACzC,sCAAsC;IACtC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,uEAAuE;IACvE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAC9C,qEAAqE;IACrE,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAC9C,uCAAuC;IACvC,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,kCAAkC;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wFAAwF;IACxF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wFAAwF;IACxF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,kEAAkE;IAClE,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/natural/exports/doctor/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ViewGraph, RouteItem } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Build a ViewGraph from a NASL App instance.
|
|
4
|
+
* Single traversal over the view tree + element trees.
|
|
5
|
+
*/
|
|
6
|
+
export declare function buildViewGraph(app: any): ViewGraph;
|
|
7
|
+
/**
|
|
8
|
+
* Summarize TSX code: keep essential attrs, simplify children, collapse to one line.
|
|
9
|
+
*/
|
|
10
|
+
export declare function summarizeTSXCode(code: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Collapse multi-line string to single line
|
|
13
|
+
*/
|
|
14
|
+
export declare function collapseToOneLine(code: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Build a flat list of RouteItem from a NASL App instance.
|
|
17
|
+
* Lightweight version that only collects route metadata without edges.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildViewRoutes(app: any): RouteItem[];
|
|
20
|
+
//# sourceMappingURL=viewGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewGraph.d.ts","sourceRoot":"","sources":["../../../../src/natural/exports/doctor/viewGraph.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAiC,SAAS,EAAE,MAAM,SAAS,CAAC;AAOnF;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,CA0KlD;AAsGD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAoBrD;AA0ED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,SAAS,EAAE,CAuCrD"}
|