@grafema/core 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +76 -0
- package/dist/Orchestrator.d.ts +142 -0
- package/dist/Orchestrator.d.ts.map +1 -0
- package/dist/Orchestrator.js +481 -0
- package/dist/api/GraphAPI.d.ts +87 -0
- package/dist/api/GraphAPI.d.ts.map +1 -0
- package/dist/api/GraphAPI.js +210 -0
- package/dist/api/GuaranteeAPI.d.ts +147 -0
- package/dist/api/GuaranteeAPI.d.ts.map +1 -0
- package/dist/api/GuaranteeAPI.js +288 -0
- package/dist/core/ASTWorker.d.ts +133 -0
- package/dist/core/ASTWorker.d.ts.map +1 -0
- package/dist/core/ASTWorker.js +352 -0
- package/dist/core/ASTWorkerPool.d.ts +85 -0
- package/dist/core/ASTWorkerPool.d.ts.map +1 -0
- package/dist/core/ASTWorkerPool.js +207 -0
- package/dist/core/AnalysisQueue.d.ts +104 -0
- package/dist/core/AnalysisQueue.d.ts.map +1 -0
- package/dist/core/AnalysisQueue.js +299 -0
- package/dist/core/AnalysisWorker.d.ts +14 -0
- package/dist/core/AnalysisWorker.d.ts.map +1 -0
- package/dist/core/AnalysisWorker.js +307 -0
- package/dist/core/GraphBackend.d.ts +156 -0
- package/dist/core/GraphBackend.d.ts.map +1 -0
- package/dist/core/GraphBackend.js +85 -0
- package/dist/core/GuaranteeManager.d.ts +230 -0
- package/dist/core/GuaranteeManager.d.ts.map +1 -0
- package/dist/core/GuaranteeManager.js +352 -0
- package/dist/core/ManifestStore.d.ts +71 -0
- package/dist/core/ManifestStore.d.ts.map +1 -0
- package/dist/core/ManifestStore.js +146 -0
- package/dist/core/NodeFactory.d.ts +160 -0
- package/dist/core/NodeFactory.d.ts.map +1 -0
- package/dist/core/NodeFactory.js +137 -0
- package/dist/core/NodeId.d.ts +88 -0
- package/dist/core/NodeId.d.ts.map +1 -0
- package/dist/core/NodeId.js +170 -0
- package/dist/core/ParallelAnalyzer.d.ts +120 -0
- package/dist/core/ParallelAnalyzer.d.ts.map +1 -0
- package/dist/core/ParallelAnalyzer.js +331 -0
- package/dist/core/PriorityQueue.d.ts +106 -0
- package/dist/core/PriorityQueue.d.ts.map +1 -0
- package/dist/core/PriorityQueue.js +168 -0
- package/dist/core/Profiler.d.ts +75 -0
- package/dist/core/Profiler.d.ts.map +1 -0
- package/dist/core/Profiler.js +149 -0
- package/dist/core/QueueWorker.d.ts +12 -0
- package/dist/core/QueueWorker.d.ts.map +1 -0
- package/dist/core/QueueWorker.js +567 -0
- package/dist/core/RFDBClient.d.ts +179 -0
- package/dist/core/RFDBClient.d.ts.map +1 -0
- package/dist/core/RFDBClient.js +429 -0
- package/dist/core/Task.d.ts +56 -0
- package/dist/core/Task.d.ts.map +1 -0
- package/dist/core/Task.js +85 -0
- package/dist/core/TaskTypes.d.ts +20 -0
- package/dist/core/TaskTypes.d.ts.map +1 -0
- package/dist/core/TaskTypes.js +10 -0
- package/dist/core/VersionManager.d.ts +166 -0
- package/dist/core/VersionManager.d.ts.map +1 -0
- package/dist/core/VersionManager.js +237 -0
- package/dist/core/WorkerPool.d.ts +82 -0
- package/dist/core/WorkerPool.d.ts.map +1 -0
- package/dist/core/WorkerPool.js +109 -0
- package/dist/core/nodes/CallSiteNode.d.ts +26 -0
- package/dist/core/nodes/CallSiteNode.d.ts.map +1 -0
- package/dist/core/nodes/CallSiteNode.js +44 -0
- package/dist/core/nodes/ClassNode.d.ts +25 -0
- package/dist/core/nodes/ClassNode.d.ts.map +1 -0
- package/dist/core/nodes/ClassNode.js +40 -0
- package/dist/core/nodes/ConstantNode.d.ts +24 -0
- package/dist/core/nodes/ConstantNode.d.ts.map +1 -0
- package/dist/core/nodes/ConstantNode.js +39 -0
- package/dist/core/nodes/DatabaseQueryNode.d.ts +22 -0
- package/dist/core/nodes/DatabaseQueryNode.d.ts.map +1 -0
- package/dist/core/nodes/DatabaseQueryNode.js +37 -0
- package/dist/core/nodes/EntrypointNode.d.ts +102 -0
- package/dist/core/nodes/EntrypointNode.d.ts.map +1 -0
- package/dist/core/nodes/EntrypointNode.js +119 -0
- package/dist/core/nodes/EventListenerNode.d.ts +25 -0
- package/dist/core/nodes/EventListenerNode.d.ts.map +1 -0
- package/dist/core/nodes/EventListenerNode.js +39 -0
- package/dist/core/nodes/ExportNode.d.ts +26 -0
- package/dist/core/nodes/ExportNode.d.ts.map +1 -0
- package/dist/core/nodes/ExportNode.js +40 -0
- package/dist/core/nodes/ExternalStdioNode.d.ts +17 -0
- package/dist/core/nodes/ExternalStdioNode.d.ts.map +1 -0
- package/dist/core/nodes/ExternalStdioNode.js +26 -0
- package/dist/core/nodes/FunctionNode.d.ts +27 -0
- package/dist/core/nodes/FunctionNode.d.ts.map +1 -0
- package/dist/core/nodes/FunctionNode.js +53 -0
- package/dist/core/nodes/GuaranteeNode.d.ts +76 -0
- package/dist/core/nodes/GuaranteeNode.d.ts.map +1 -0
- package/dist/core/nodes/GuaranteeNode.js +117 -0
- package/dist/core/nodes/HttpRequestNode.d.ts +24 -0
- package/dist/core/nodes/HttpRequestNode.d.ts.map +1 -0
- package/dist/core/nodes/HttpRequestNode.js +38 -0
- package/dist/core/nodes/ImportNode.d.ts +27 -0
- package/dist/core/nodes/ImportNode.d.ts.map +1 -0
- package/dist/core/nodes/ImportNode.js +43 -0
- package/dist/core/nodes/LiteralNode.d.ts +26 -0
- package/dist/core/nodes/LiteralNode.d.ts.map +1 -0
- package/dist/core/nodes/LiteralNode.js +40 -0
- package/dist/core/nodes/MethodCallNode.d.ts +29 -0
- package/dist/core/nodes/MethodCallNode.d.ts.map +1 -0
- package/dist/core/nodes/MethodCallNode.js +47 -0
- package/dist/core/nodes/MethodNode.d.ts +29 -0
- package/dist/core/nodes/MethodNode.d.ts.map +1 -0
- package/dist/core/nodes/MethodNode.js +44 -0
- package/dist/core/nodes/ModuleNode.d.ts +29 -0
- package/dist/core/nodes/ModuleNode.d.ts.map +1 -0
- package/dist/core/nodes/ModuleNode.js +49 -0
- package/dist/core/nodes/NodeKind.d.ts +91 -0
- package/dist/core/nodes/NodeKind.d.ts.map +1 -0
- package/dist/core/nodes/NodeKind.js +146 -0
- package/dist/core/nodes/ParameterNode.d.ts +26 -0
- package/dist/core/nodes/ParameterNode.d.ts.map +1 -0
- package/dist/core/nodes/ParameterNode.js +43 -0
- package/dist/core/nodes/ScopeNode.d.ts +32 -0
- package/dist/core/nodes/ScopeNode.d.ts.map +1 -0
- package/dist/core/nodes/ScopeNode.js +47 -0
- package/dist/core/nodes/ServiceNode.d.ts +44 -0
- package/dist/core/nodes/ServiceNode.d.ts.map +1 -0
- package/dist/core/nodes/ServiceNode.js +49 -0
- package/dist/core/nodes/VariableDeclarationNode.d.ts +22 -0
- package/dist/core/nodes/VariableDeclarationNode.d.ts.map +1 -0
- package/dist/core/nodes/VariableDeclarationNode.js +38 -0
- package/dist/core/nodes/index.d.ts +25 -0
- package/dist/core/nodes/index.d.ts.map +1 -0
- package/dist/core/nodes/index.js +30 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/plugins/Plugin.d.ts +44 -0
- package/dist/plugins/Plugin.d.ts.map +1 -0
- package/dist/plugins/Plugin.js +46 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts +23 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/DatabaseAnalyzer.js +260 -0
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts +19 -0
- package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/ExpressAnalyzer.js +306 -0
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts +17 -0
- package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/ExpressRouteAnalyzer.js +308 -0
- package/dist/plugins/analysis/FetchAnalyzer.d.ts +38 -0
- package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/FetchAnalyzer.js +344 -0
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts +65 -0
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.d.ts.map +1 -0
- package/dist/plugins/analysis/IncrementalAnalysisPlugin.js +472 -0
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts +84 -0
- package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/JSASTAnalyzer.js +1378 -0
- package/dist/plugins/analysis/ReactAnalyzer.d.ts +90 -0
- package/dist/plugins/analysis/ReactAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/ReactAnalyzer.js +1153 -0
- package/dist/plugins/analysis/RustAnalyzer.d.ts +13 -0
- package/dist/plugins/analysis/RustAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/RustAnalyzer.js +259 -0
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts +21 -0
- package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/SQLiteAnalyzer.js +317 -0
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts +35 -0
- package/dist/plugins/analysis/ServiceLayerAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/ServiceLayerAnalyzer.js +303 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts +33 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/SocketIOAnalyzer.js +283 -0
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts +27 -0
- package/dist/plugins/analysis/SystemDbAnalyzer.d.ts.map +1 -0
- package/dist/plugins/analysis/SystemDbAnalyzer.js +211 -0
- package/dist/plugins/analysis/ast/ConditionParser.d.ts +85 -0
- package/dist/plugins/analysis/ast/ConditionParser.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/ConditionParser.js +277 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.d.ts +15 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/ExpressionEvaluator.js +91 -0
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts +77 -0
- package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/GraphBuilder.js +1077 -0
- package/dist/plugins/analysis/ast/OxcAdapter.d.ts +41 -0
- package/dist/plugins/analysis/ast/OxcAdapter.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/OxcAdapter.js +40 -0
- package/dist/plugins/analysis/ast/types.d.ts +346 -0
- package/dist/plugins/analysis/ast/types.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/types.js +4 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts +93 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ASTVisitor.js +24 -0
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +77 -0
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +377 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts +27 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ClassVisitor.js +232 -0
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts +25 -0
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +172 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.d.ts +29 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +180 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts +14 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/TypeScriptVisitor.js +200 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts +45 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +150 -0
- package/dist/plugins/analysis/ast/visitors/index.d.ts +17 -0
- package/dist/plugins/analysis/ast/visitors/index.d.ts.map +1 -0
- package/dist/plugins/analysis/ast/visitors/index.js +13 -0
- package/dist/plugins/discovery/DiscoveryPlugin.d.ts +34 -0
- package/dist/plugins/discovery/DiscoveryPlugin.d.ts.map +1 -0
- package/dist/plugins/discovery/DiscoveryPlugin.js +26 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts +26 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.d.ts.map +1 -0
- package/dist/plugins/discovery/MonorepoServiceDiscovery.js +79 -0
- package/dist/plugins/discovery/SimpleProjectDiscovery.d.ts +14 -0
- package/dist/plugins/discovery/SimpleProjectDiscovery.d.ts.map +1 -0
- package/dist/plugins/discovery/SimpleProjectDiscovery.js +65 -0
- package/dist/plugins/discovery/ZonServiceDiscovery.d.ts +19 -0
- package/dist/plugins/discovery/ZonServiceDiscovery.d.ts.map +1 -0
- package/dist/plugins/discovery/ZonServiceDiscovery.js +204 -0
- package/dist/plugins/enrichment/AliasTracker.d.ts +40 -0
- package/dist/plugins/enrichment/AliasTracker.d.ts.map +1 -0
- package/dist/plugins/enrichment/AliasTracker.js +290 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts +30 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/HTTPConnectionEnricher.js +135 -0
- package/dist/plugins/enrichment/ImportExportLinker.d.ts +30 -0
- package/dist/plugins/enrichment/ImportExportLinker.d.ts.map +1 -0
- package/dist/plugins/enrichment/ImportExportLinker.js +176 -0
- package/dist/plugins/enrichment/InstanceOfResolver.d.ts +21 -0
- package/dist/plugins/enrichment/InstanceOfResolver.d.ts.map +1 -0
- package/dist/plugins/enrichment/InstanceOfResolver.js +117 -0
- package/dist/plugins/enrichment/MethodCallResolver.d.ts +41 -0
- package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -0
- package/dist/plugins/enrichment/MethodCallResolver.js +252 -0
- package/dist/plugins/enrichment/MountPointResolver.d.ts +26 -0
- package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -0
- package/dist/plugins/enrichment/MountPointResolver.js +189 -0
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts +89 -0
- package/dist/plugins/enrichment/PrefixEvaluator.d.ts.map +1 -0
- package/dist/plugins/enrichment/PrefixEvaluator.js +415 -0
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts +25 -0
- package/dist/plugins/enrichment/RustFFIEnricher.d.ts.map +1 -0
- package/dist/plugins/enrichment/RustFFIEnricher.js +170 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts +114 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -0
- package/dist/plugins/enrichment/ValueDomainAnalyzer.js +464 -0
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts +27 -0
- package/dist/plugins/indexing/IncrementalModuleIndexer.d.ts.map +1 -0
- package/dist/plugins/indexing/IncrementalModuleIndexer.js +238 -0
- package/dist/plugins/indexing/JSModuleIndexer.d.ts +33 -0
- package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -0
- package/dist/plugins/indexing/JSModuleIndexer.js +299 -0
- package/dist/plugins/indexing/RustModuleIndexer.d.ts +28 -0
- package/dist/plugins/indexing/RustModuleIndexer.d.ts.map +1 -0
- package/dist/plugins/indexing/RustModuleIndexer.js +140 -0
- package/dist/plugins/indexing/ServiceDetector.d.ts +46 -0
- package/dist/plugins/indexing/ServiceDetector.d.ts.map +1 -0
- package/dist/plugins/indexing/ServiceDetector.js +164 -0
- package/dist/plugins/validation/CallResolverValidator.d.ts +23 -0
- package/dist/plugins/validation/CallResolverValidator.d.ts.map +1 -0
- package/dist/plugins/validation/CallResolverValidator.js +108 -0
- package/dist/plugins/validation/DataFlowValidator.d.ts +24 -0
- package/dist/plugins/validation/DataFlowValidator.d.ts.map +1 -0
- package/dist/plugins/validation/DataFlowValidator.js +148 -0
- package/dist/plugins/validation/EvalBanValidator.d.ts +25 -0
- package/dist/plugins/validation/EvalBanValidator.d.ts.map +1 -0
- package/dist/plugins/validation/EvalBanValidator.js +123 -0
- package/dist/plugins/validation/GraphConnectivityValidator.d.ts +11 -0
- package/dist/plugins/validation/GraphConnectivityValidator.d.ts.map +1 -0
- package/dist/plugins/validation/GraphConnectivityValidator.js +135 -0
- package/dist/plugins/validation/SQLInjectionValidator.d.ts +43 -0
- package/dist/plugins/validation/SQLInjectionValidator.d.ts.map +1 -0
- package/dist/plugins/validation/SQLInjectionValidator.js +251 -0
- package/dist/plugins/validation/ShadowingDetector.d.ts +26 -0
- package/dist/plugins/validation/ShadowingDetector.d.ts.map +1 -0
- package/dist/plugins/validation/ShadowingDetector.js +119 -0
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.d.ts +21 -0
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.d.ts.map +1 -0
- package/dist/plugins/validation/TypeScriptDeadCodeValidator.js +151 -0
- package/dist/plugins/vcs/GitPlugin.d.ts +84 -0
- package/dist/plugins/vcs/GitPlugin.d.ts.map +1 -0
- package/dist/plugins/vcs/GitPlugin.js +295 -0
- package/dist/plugins/vcs/VCSPlugin.d.ts +133 -0
- package/dist/plugins/vcs/VCSPlugin.d.ts.map +1 -0
- package/dist/plugins/vcs/VCSPlugin.js +82 -0
- package/dist/plugins/vcs/index.d.ts +10 -0
- package/dist/plugins/vcs/index.d.ts.map +1 -0
- package/dist/plugins/vcs/index.js +18 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +258 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -0
- package/dist/storage/backends/RFDBServerBackend.js +565 -0
- package/dist/storage/backends/typeValidation.d.ts +47 -0
- package/dist/storage/backends/typeValidation.d.ts.map +1 -0
- package/dist/storage/backends/typeValidation.js +137 -0
- package/dist/validation/PathValidator.d.ts +81 -0
- package/dist/validation/PathValidator.d.ts.map +1 -0
- package/dist/validation/PathValidator.js +251 -0
- package/package.json +57 -0
- package/src/.rfguard/current-session.txt +1 -0
- package/src/Orchestrator.ts +673 -0
- package/src/api/GraphAPI.ts +305 -0
- package/src/api/GuaranteeAPI.ts +401 -0
- package/src/core/ASTWorker.ts +567 -0
- package/src/core/ASTWorkerPool.ts +299 -0
- package/src/core/AnalysisQueue.ts +447 -0
- package/src/core/AnalysisWorker.ts +410 -0
- package/src/core/GraphBackend.ts +265 -0
- package/src/core/GuaranteeManager.ts +581 -0
- package/src/core/ManifestStore.ts +196 -0
- package/src/core/NodeFactory.ts +274 -0
- package/src/core/NodeId.ts +257 -0
- package/src/core/ParallelAnalyzer.ts +476 -0
- package/src/core/PriorityQueue.ts +227 -0
- package/src/core/Profiler.ts +188 -0
- package/src/core/QueueWorker.ts +780 -0
- package/src/core/Task.ts +107 -0
- package/src/core/TaskTypes.ts +40 -0
- package/src/core/VersionManager.ts +404 -0
- package/src/core/WorkerPool.ts +180 -0
- package/src/core/nodes/CallSiteNode.ts +72 -0
- package/src/core/nodes/ClassNode.ts +69 -0
- package/src/core/nodes/ConstantNode.ts +63 -0
- package/src/core/nodes/DatabaseQueryNode.ts +60 -0
- package/src/core/nodes/EntrypointNode.ts +164 -0
- package/src/core/nodes/EventListenerNode.ts +64 -0
- package/src/core/nodes/ExportNode.ts +71 -0
- package/src/core/nodes/ExternalStdioNode.ts +36 -0
- package/src/core/nodes/FunctionNode.ts +78 -0
- package/src/core/nodes/GuaranteeNode.ts +162 -0
- package/src/core/nodes/HttpRequestNode.ts +63 -0
- package/src/core/nodes/ImportNode.ts +75 -0
- package/src/core/nodes/LiteralNode.ts +67 -0
- package/src/core/nodes/MethodCallNode.ts +79 -0
- package/src/core/nodes/MethodNode.ts +78 -0
- package/src/core/nodes/ModuleNode.ts +74 -0
- package/src/core/nodes/NodeKind.ts +171 -0
- package/src/core/nodes/ParameterNode.ts +73 -0
- package/src/core/nodes/ScopeNode.ts +80 -0
- package/src/core/nodes/ServiceNode.ts +86 -0
- package/src/core/nodes/VariableDeclarationNode.ts +60 -0
- package/src/core/nodes/index.ts +49 -0
- package/src/index.ts +93 -0
- package/src/plugins/Plugin.ts +74 -0
- package/src/plugins/analysis/DatabaseAnalyzer.ts +322 -0
- package/src/plugins/analysis/ExpressAnalyzer.ts +401 -0
- package/src/plugins/analysis/ExpressRouteAnalyzer.ts +414 -0
- package/src/plugins/analysis/FetchAnalyzer.ts +441 -0
- package/src/plugins/analysis/IncrementalAnalysisPlugin.ts +686 -0
- package/src/plugins/analysis/JSASTAnalyzer.ts +1680 -0
- package/src/plugins/analysis/ReactAnalyzer.ts +1368 -0
- package/src/plugins/analysis/RustAnalyzer.ts +438 -0
- package/src/plugins/analysis/SQLiteAnalyzer.ts +388 -0
- package/src/plugins/analysis/ServiceLayerAnalyzer.ts +429 -0
- package/src/plugins/analysis/SocketIOAnalyzer.ts +395 -0
- package/src/plugins/analysis/SystemDbAnalyzer.ts +284 -0
- package/src/plugins/analysis/ast/ConditionParser.ts +333 -0
- package/src/plugins/analysis/ast/ExpressionEvaluator.ts +117 -0
- package/src/plugins/analysis/ast/GraphBuilder.ts +1371 -0
- package/src/plugins/analysis/ast/OxcAdapter.ts +63 -0
- package/src/plugins/analysis/ast/types.ts +400 -0
- package/src/plugins/analysis/ast/visitors/ASTVisitor.ts +137 -0
- package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +528 -0
- package/src/plugins/analysis/ast/visitors/ClassVisitor.ts +339 -0
- package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +273 -0
- package/src/plugins/analysis/ast/visitors/ImportExportVisitor.ts +259 -0
- package/src/plugins/analysis/ast/visitors/TypeScriptVisitor.ts +235 -0
- package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +268 -0
- package/src/plugins/analysis/ast/visitors/index.ts +36 -0
- package/src/plugins/discovery/DiscoveryPlugin.ts +50 -0
- package/src/plugins/discovery/MonorepoServiceDiscovery.ts +117 -0
- package/src/plugins/discovery/SimpleProjectDiscovery.ts +102 -0
- package/src/plugins/enrichment/AliasTracker.ts +399 -0
- package/src/plugins/enrichment/HTTPConnectionEnricher.ts +192 -0
- package/src/plugins/enrichment/ImportExportLinker.ts +221 -0
- package/src/plugins/enrichment/InstanceOfResolver.ts +165 -0
- package/src/plugins/enrichment/MethodCallResolver.ts +333 -0
- package/src/plugins/enrichment/MountPointResolver.ts +264 -0
- package/src/plugins/enrichment/PrefixEvaluator.ts +527 -0
- package/src/plugins/enrichment/RustFFIEnricher.ts +218 -0
- package/src/plugins/enrichment/ValueDomainAnalyzer.ts +682 -0
- package/src/plugins/indexing/IncrementalModuleIndexer.ts +287 -0
- package/src/plugins/indexing/JSModuleIndexer.ts +374 -0
- package/src/plugins/indexing/RustModuleIndexer.ts +160 -0
- package/src/plugins/indexing/ServiceDetector.ts +230 -0
- package/src/plugins/validation/CallResolverValidator.ts +170 -0
- package/src/plugins/validation/DataFlowValidator.ts +233 -0
- package/src/plugins/validation/EvalBanValidator.ts +175 -0
- package/src/plugins/validation/GraphConnectivityValidator.ts +201 -0
- package/src/plugins/validation/SQLInjectionValidator.ts +363 -0
- package/src/plugins/validation/ShadowingDetector.ts +173 -0
- package/src/plugins/validation/TypeScriptDeadCodeValidator.ts +203 -0
- package/src/plugins/vcs/GitPlugin.ts +344 -0
- package/src/plugins/vcs/VCSPlugin.ts +190 -0
- package/src/plugins/vcs/index.ts +32 -0
- package/src/storage/backends/RFDBServerBackend.ts +687 -0
- package/src/storage/backends/typeValidation.ts +151 -0
- package/src/validation/PathValidator.ts +342 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ImportExportLinker - создаёт IMPORTS_FROM edges между IMPORT и EXPORT нодами
|
|
3
|
+
*
|
|
4
|
+
* Этот enrichment plugin работает ПОСЛЕ JSASTAnalyzer и связывает:
|
|
5
|
+
* - IMPORT (default) -> IMPORTS_FROM -> EXPORT (default)
|
|
6
|
+
* - IMPORT (named) -> IMPORTS_FROM -> EXPORT (named, matching name)
|
|
7
|
+
*
|
|
8
|
+
* ОПТИМИЗАЦИЯ:
|
|
9
|
+
* Вместо O(n) итерации по всем EXPORT нодам для каждого импорта,
|
|
10
|
+
* строим индекс один раз и используем O(1) lookup.
|
|
11
|
+
*
|
|
12
|
+
* Индекс: Map<file, Map<exportKey, exportNode>>
|
|
13
|
+
* где exportKey = "default" | "named:functionName" | "all"
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { dirname, resolve } from 'path';
|
|
17
|
+
import { Plugin, createSuccessResult } from '../Plugin.js';
|
|
18
|
+
import type { PluginContext, PluginResult, PluginMetadata } from '../Plugin.js';
|
|
19
|
+
import type { BaseNodeRecord } from '@grafema/types';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Import node with import-specific properties
|
|
23
|
+
*/
|
|
24
|
+
interface ImportNode extends BaseNodeRecord {
|
|
25
|
+
source?: string;
|
|
26
|
+
importType?: string;
|
|
27
|
+
imported?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Export node with export-specific properties
|
|
32
|
+
*/
|
|
33
|
+
interface ExportNode extends BaseNodeRecord {
|
|
34
|
+
exportType?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class ImportExportLinker extends Plugin {
|
|
38
|
+
get metadata(): PluginMetadata {
|
|
39
|
+
return {
|
|
40
|
+
name: 'ImportExportLinker',
|
|
41
|
+
phase: 'ENRICHMENT',
|
|
42
|
+
priority: 90, // Run early in enrichment, after analysis
|
|
43
|
+
creates: {
|
|
44
|
+
nodes: [],
|
|
45
|
+
edges: ['IMPORTS_FROM']
|
|
46
|
+
},
|
|
47
|
+
dependencies: ['JSASTAnalyzer'] // Requires IMPORT and EXPORT nodes
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async execute(context: PluginContext): Promise<PluginResult> {
|
|
52
|
+
const { graph, onProgress } = context;
|
|
53
|
+
|
|
54
|
+
console.log('[ImportExportLinker] Starting import-export linking...');
|
|
55
|
+
|
|
56
|
+
const startTime = Date.now();
|
|
57
|
+
|
|
58
|
+
// Step 1: Build EXPORT index - Map<file, Map<exportKey, exportNode>>
|
|
59
|
+
const exportIndex = await this.buildExportIndex(graph);
|
|
60
|
+
const indexTime = Date.now() - startTime;
|
|
61
|
+
console.log(`[ImportExportLinker] Indexed exports from ${exportIndex.size} files in ${indexTime}ms`);
|
|
62
|
+
|
|
63
|
+
// Step 2: Build MODULE lookup - Map<file, moduleNode>
|
|
64
|
+
const modulesByFile = await this.buildModuleLookup(graph);
|
|
65
|
+
console.log(`[ImportExportLinker] Indexed ${modulesByFile.size} modules`);
|
|
66
|
+
|
|
67
|
+
// Step 3: Process all IMPORT nodes
|
|
68
|
+
const imports: ImportNode[] = [];
|
|
69
|
+
for await (const node of graph.queryNodes({ nodeType: 'IMPORT' })) {
|
|
70
|
+
imports.push(node as ImportNode);
|
|
71
|
+
}
|
|
72
|
+
console.log(`[ImportExportLinker] Found ${imports.length} imports to link`);
|
|
73
|
+
|
|
74
|
+
let edgesCreated = 0;
|
|
75
|
+
let skipped = 0;
|
|
76
|
+
let notFound = 0;
|
|
77
|
+
|
|
78
|
+
for (let i = 0; i < imports.length; i++) {
|
|
79
|
+
const imp = imports[i];
|
|
80
|
+
|
|
81
|
+
// Progress reporting
|
|
82
|
+
if (onProgress && i % 100 === 0) {
|
|
83
|
+
onProgress({
|
|
84
|
+
phase: 'enrichment',
|
|
85
|
+
currentPlugin: 'ImportExportLinker',
|
|
86
|
+
message: `Linking imports ${i}/${imports.length}`,
|
|
87
|
+
totalFiles: imports.length,
|
|
88
|
+
processedFiles: i
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Skip external modules (non-relative imports)
|
|
93
|
+
const isRelative = imp.source && (imp.source.startsWith('./') || imp.source.startsWith('../'));
|
|
94
|
+
if (!isRelative) {
|
|
95
|
+
skipped++;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Resolve target file path
|
|
100
|
+
const currentDir = dirname(imp.file!);
|
|
101
|
+
const basePath = resolve(currentDir, imp.source!);
|
|
102
|
+
|
|
103
|
+
// Try different extensions
|
|
104
|
+
const extensions = ['', '.js', '.ts', '.jsx', '.tsx', '/index.js', '/index.ts'];
|
|
105
|
+
let targetFile: string | null = null;
|
|
106
|
+
let targetExports: Map<string, ExportNode> | null = null;
|
|
107
|
+
|
|
108
|
+
for (const ext of extensions) {
|
|
109
|
+
const testPath = basePath + ext;
|
|
110
|
+
if (exportIndex.has(testPath)) {
|
|
111
|
+
targetFile = testPath;
|
|
112
|
+
targetExports = exportIndex.get(testPath)!;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
// Also check modulesByFile in case exports haven't been indexed yet
|
|
116
|
+
if (!targetFile && modulesByFile.has(testPath)) {
|
|
117
|
+
targetFile = testPath;
|
|
118
|
+
targetExports = exportIndex.get(testPath) || new Map();
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (!targetFile || !targetExports) {
|
|
124
|
+
notFound++;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Find matching export based on import type
|
|
129
|
+
const importType = imp.importType; // 'default', 'named', or 'namespace'
|
|
130
|
+
let targetExport: ExportNode | undefined;
|
|
131
|
+
|
|
132
|
+
if (importType === 'namespace') {
|
|
133
|
+
// import * as foo - already linked to MODULE in GraphBuilder
|
|
134
|
+
skipped++;
|
|
135
|
+
continue;
|
|
136
|
+
} else if (importType === 'default') {
|
|
137
|
+
// import foo from './bar' -> find default export
|
|
138
|
+
targetExport = targetExports.get('default');
|
|
139
|
+
} else {
|
|
140
|
+
// import { foo } from './bar' -> find named export 'foo'
|
|
141
|
+
const exportKey = `named:${imp.imported}`;
|
|
142
|
+
targetExport = targetExports.get(exportKey);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (targetExport) {
|
|
146
|
+
await graph.addEdge({
|
|
147
|
+
type: 'IMPORTS_FROM',
|
|
148
|
+
src: imp.id,
|
|
149
|
+
dst: targetExport.id
|
|
150
|
+
});
|
|
151
|
+
edgesCreated++;
|
|
152
|
+
} else {
|
|
153
|
+
notFound++;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const totalTime = ((Date.now() - startTime) / 1000).toFixed(2);
|
|
158
|
+
console.log(`[ImportExportLinker] Complete: ${edgesCreated} edges created, ${skipped} skipped, ${notFound} not found (${totalTime}s)`);
|
|
159
|
+
|
|
160
|
+
return createSuccessResult(
|
|
161
|
+
{ nodes: 0, edges: edgesCreated },
|
|
162
|
+
{
|
|
163
|
+
importsProcessed: imports.length,
|
|
164
|
+
edgesCreated,
|
|
165
|
+
skipped,
|
|
166
|
+
notFound,
|
|
167
|
+
timeMs: Date.now() - startTime
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Build index of all EXPORT nodes: Map<file, Map<exportKey, exportNode>>
|
|
174
|
+
* exportKey = "default" | "named:functionName" | "all"
|
|
175
|
+
*/
|
|
176
|
+
private async buildExportIndex(graph: PluginContext['graph']): Promise<Map<string, Map<string, ExportNode>>> {
|
|
177
|
+
const index = new Map<string, Map<string, ExportNode>>();
|
|
178
|
+
|
|
179
|
+
for await (const node of graph.queryNodes({ nodeType: 'EXPORT' })) {
|
|
180
|
+
const exportNode = node as ExportNode;
|
|
181
|
+
if (!exportNode.file) continue;
|
|
182
|
+
|
|
183
|
+
if (!index.has(exportNode.file)) {
|
|
184
|
+
index.set(exportNode.file, new Map());
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const fileExports = index.get(exportNode.file)!;
|
|
188
|
+
|
|
189
|
+
// Build export key based on type
|
|
190
|
+
let exportKey: string;
|
|
191
|
+
if (exportNode.exportType === 'default') {
|
|
192
|
+
exportKey = 'default';
|
|
193
|
+
} else if (exportNode.exportType === 'named') {
|
|
194
|
+
exportKey = `named:${exportNode.name}`;
|
|
195
|
+
} else if (exportNode.exportType === 'all') {
|
|
196
|
+
exportKey = 'all';
|
|
197
|
+
} else {
|
|
198
|
+
exportKey = `unknown:${exportNode.name || 'anonymous'}`;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
fileExports.set(exportKey, exportNode);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return index;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Build MODULE lookup: Map<file, moduleNode>
|
|
209
|
+
*/
|
|
210
|
+
private async buildModuleLookup(graph: PluginContext['graph']): Promise<Map<string, BaseNodeRecord>> {
|
|
211
|
+
const lookup = new Map<string, BaseNodeRecord>();
|
|
212
|
+
|
|
213
|
+
for await (const node of graph.queryNodes({ nodeType: 'MODULE' })) {
|
|
214
|
+
if (node.file) {
|
|
215
|
+
lookup.set(node.file, node);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return lookup;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InstanceOfResolver - резолвит INSTANCE_OF edges к правильным CLASS нодам
|
|
3
|
+
*
|
|
4
|
+
* Проблема: При параллельном анализе модулей, CLASS ноды для импортированных
|
|
5
|
+
* классов создаются как "заглушки" (isInstantiationRef: true) потому что
|
|
6
|
+
* исходный модуль может ещё не быть проанализирован.
|
|
7
|
+
*
|
|
8
|
+
* Решение: После анализа всех модулей этот плагин:
|
|
9
|
+
* 1. Находит все INSTANCE_OF edges
|
|
10
|
+
* 2. Для edges указывающих на "заглушки" (CLASS с isInstantiationRef)
|
|
11
|
+
* 3. Ищет настоящую CLASS декларацию через IMPORT → MODULE → CLASS
|
|
12
|
+
* 4. Перенаправляет INSTANCE_OF edge на настоящий CLASS
|
|
13
|
+
* 5. Удаляет "заглушку" CLASS ноду
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { dirname, resolve } from 'path';
|
|
17
|
+
import { Plugin, createSuccessResult } from '../Plugin.js';
|
|
18
|
+
import type { PluginContext, PluginResult, PluginMetadata } from '../Plugin.js';
|
|
19
|
+
import type { NodeRecord } from '@grafema/types';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Stub info
|
|
23
|
+
*/
|
|
24
|
+
interface StubInfo {
|
|
25
|
+
name: string;
|
|
26
|
+
file: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Import info
|
|
31
|
+
*/
|
|
32
|
+
interface ImportInfo {
|
|
33
|
+
source: string;
|
|
34
|
+
imported: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Edge update info
|
|
39
|
+
*/
|
|
40
|
+
interface EdgeUpdate {
|
|
41
|
+
src: string;
|
|
42
|
+
oldDst: string;
|
|
43
|
+
newDst: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class InstanceOfResolver extends Plugin {
|
|
47
|
+
get metadata(): PluginMetadata {
|
|
48
|
+
return {
|
|
49
|
+
name: 'InstanceOfResolver',
|
|
50
|
+
phase: 'ENRICHMENT',
|
|
51
|
+
priority: 100, // Высокий приоритет - должен выполняться перед другими enrichment плагинами
|
|
52
|
+
creates: {
|
|
53
|
+
nodes: [],
|
|
54
|
+
edges: ['INSTANCE_OF'] // Пере-создаёт INSTANCE_OF edges
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async execute(context: PluginContext): Promise<PluginResult> {
|
|
60
|
+
const { graph } = context;
|
|
61
|
+
let resolvedCount = 0;
|
|
62
|
+
let removedStubs = 0;
|
|
63
|
+
|
|
64
|
+
// 1. Собираем все CLASS ноды (декларации и заглушки)
|
|
65
|
+
const classDeclarations = new Map<string, string>(); // file:name → classId (только настоящие декларации)
|
|
66
|
+
const classStubs = new Map<string, StubInfo>(); // classId → { name, file }
|
|
67
|
+
|
|
68
|
+
for await (const node of graph.queryNodes({ type: 'CLASS' })) {
|
|
69
|
+
if ((node as NodeRecord & { isInstantiationRef?: boolean }).isInstantiationRef) {
|
|
70
|
+
classStubs.set(node.id, { name: node.name as string, file: node.file! });
|
|
71
|
+
} else {
|
|
72
|
+
// Настоящая декларация
|
|
73
|
+
const key = `${node.file}:${node.name}`;
|
|
74
|
+
classDeclarations.set(key, node.id);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (classStubs.size === 0) {
|
|
79
|
+
return createSuccessResult({ nodes: 0, edges: 0 }, { resolvedInstanceOf: 0, removedStubs: 0 });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// 2. Собираем импорты для резолва
|
|
83
|
+
const importMap = new Map<string, ImportInfo>(); // file:localName → { source, imported }
|
|
84
|
+
for await (const node of graph.queryNodes({ type: 'IMPORT' })) {
|
|
85
|
+
const importNode = node as NodeRecord & { local?: string; source?: string; imported?: string };
|
|
86
|
+
const key = `${node.file}:${importNode.local}`;
|
|
87
|
+
importMap.set(key, { source: importNode.source!, imported: importNode.imported! });
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 3. Для каждой заглушки пытаемся найти настоящую декларацию
|
|
91
|
+
const edgesToUpdate: EdgeUpdate[] = [];
|
|
92
|
+
const stubsToRemove: string[] = [];
|
|
93
|
+
|
|
94
|
+
for (const [stubId, stubInfo] of classStubs) {
|
|
95
|
+
const { name, file } = stubInfo;
|
|
96
|
+
|
|
97
|
+
// Проверяем есть ли импорт для этого класса
|
|
98
|
+
const importKey = `${file}:${name}`;
|
|
99
|
+
const importInfo = importMap.get(importKey);
|
|
100
|
+
|
|
101
|
+
if (!importInfo) continue;
|
|
102
|
+
|
|
103
|
+
const { source, imported } = importInfo;
|
|
104
|
+
|
|
105
|
+
// Только относительные импорты (локальные модули)
|
|
106
|
+
if (!source.startsWith('./') && !source.startsWith('../')) continue;
|
|
107
|
+
|
|
108
|
+
// Резолвим путь к исходному модулю
|
|
109
|
+
const moduleDir = dirname(file);
|
|
110
|
+
let resolvedPath = resolve(moduleDir, source);
|
|
111
|
+
if (!resolvedPath.endsWith('.js') && !resolvedPath.endsWith('.ts') && !resolvedPath.endsWith('.mjs')) {
|
|
112
|
+
resolvedPath += '.js';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Ищем CLASS декларацию в исходном модуле
|
|
116
|
+
const importedClassName = imported === 'default' ? name : imported;
|
|
117
|
+
const declarationKey = `${resolvedPath}:${importedClassName}`;
|
|
118
|
+
const realClassId = classDeclarations.get(declarationKey);
|
|
119
|
+
|
|
120
|
+
if (realClassId) {
|
|
121
|
+
// Нашли настоящий класс!
|
|
122
|
+
// Собираем INSTANCE_OF edges указывающие на заглушку
|
|
123
|
+
const incomingEdges = await graph.getIncomingEdges(stubId, ['INSTANCE_OF']);
|
|
124
|
+
for (const edge of incomingEdges) {
|
|
125
|
+
edgesToUpdate.push({
|
|
126
|
+
src: edge.src,
|
|
127
|
+
oldDst: stubId,
|
|
128
|
+
newDst: realClassId
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
stubsToRemove.push(stubId);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// 4. Обновляем edges (удаляем старые, создаём новые)
|
|
136
|
+
for (const update of edgesToUpdate) {
|
|
137
|
+
// Удаляем старый edge (if supported)
|
|
138
|
+
if (graph.deleteEdge) {
|
|
139
|
+
await graph.deleteEdge(update.src, update.oldDst, 'INSTANCE_OF');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Создаём новый edge
|
|
143
|
+
await graph.addEdge({
|
|
144
|
+
type: 'INSTANCE_OF',
|
|
145
|
+
src: update.src,
|
|
146
|
+
dst: update.newDst
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
resolvedCount++;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// 5. Удаляем заглушки (if supported)
|
|
153
|
+
for (const stubId of stubsToRemove) {
|
|
154
|
+
if (graph.deleteNode) {
|
|
155
|
+
await graph.deleteNode(stubId);
|
|
156
|
+
removedStubs++;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return createSuccessResult(
|
|
161
|
+
{ nodes: 0, edges: resolvedCount },
|
|
162
|
+
{ resolvedInstanceOf: resolvedCount, removedStubs: removedStubs }
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
}
|