@grafema/core 0.1.1-alpha → 0.2.0-beta

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.
Files changed (319) hide show
  1. package/dist/Orchestrator.d.ts +7 -0
  2. package/dist/Orchestrator.d.ts.map +1 -1
  3. package/dist/Orchestrator.js +25 -3
  4. package/dist/config/ConfigLoader.d.ts +18 -0
  5. package/dist/config/ConfigLoader.d.ts.map +1 -1
  6. package/dist/config/ConfigLoader.js +65 -3
  7. package/dist/core/FileExplainer.d.ts +101 -0
  8. package/dist/core/FileExplainer.d.ts.map +1 -0
  9. package/dist/core/FileExplainer.js +139 -0
  10. package/dist/core/NodeFactory.d.ts +44 -5
  11. package/dist/core/NodeFactory.d.ts.map +1 -1
  12. package/dist/core/NodeFactory.js +52 -7
  13. package/dist/core/nodes/ArrayLiteralNode.d.ts.map +1 -1
  14. package/dist/core/nodes/ArrayLiteralNode.js +4 -2
  15. package/dist/core/nodes/BranchNode.d.ts +41 -0
  16. package/dist/core/nodes/BranchNode.d.ts.map +1 -0
  17. package/dist/core/nodes/BranchNode.js +82 -0
  18. package/dist/core/nodes/CallSiteNode.d.ts +2 -2
  19. package/dist/core/nodes/CallSiteNode.d.ts.map +1 -1
  20. package/dist/core/nodes/CallSiteNode.js +9 -5
  21. package/dist/core/nodes/CaseNode.d.ts +43 -0
  22. package/dist/core/nodes/CaseNode.d.ts.map +1 -0
  23. package/dist/core/nodes/CaseNode.js +81 -0
  24. package/dist/core/nodes/ClassNode.d.ts +2 -2
  25. package/dist/core/nodes/ClassNode.d.ts.map +1 -1
  26. package/dist/core/nodes/ClassNode.js +8 -4
  27. package/dist/core/nodes/ConstantNode.d.ts +2 -2
  28. package/dist/core/nodes/ConstantNode.d.ts.map +1 -1
  29. package/dist/core/nodes/ConstantNode.js +6 -4
  30. package/dist/core/nodes/ConstructorCallNode.d.ts +51 -0
  31. package/dist/core/nodes/ConstructorCallNode.d.ts.map +1 -0
  32. package/dist/core/nodes/ConstructorCallNode.js +171 -0
  33. package/dist/core/nodes/DatabaseQueryNode.d.ts +3 -2
  34. package/dist/core/nodes/DatabaseQueryNode.d.ts.map +1 -1
  35. package/dist/core/nodes/DatabaseQueryNode.js +5 -2
  36. package/dist/core/nodes/DecoratorNode.d.ts +2 -2
  37. package/dist/core/nodes/DecoratorNode.d.ts.map +1 -1
  38. package/dist/core/nodes/DecoratorNode.js +5 -3
  39. package/dist/core/nodes/EnumNode.d.ts +2 -2
  40. package/dist/core/nodes/EnumNode.d.ts.map +1 -1
  41. package/dist/core/nodes/EnumNode.js +5 -3
  42. package/dist/core/nodes/EventListenerNode.d.ts +4 -4
  43. package/dist/core/nodes/EventListenerNode.d.ts.map +1 -1
  44. package/dist/core/nodes/EventListenerNode.js +7 -4
  45. package/dist/core/nodes/ExportNode.d.ts +2 -2
  46. package/dist/core/nodes/ExportNode.d.ts.map +1 -1
  47. package/dist/core/nodes/ExportNode.js +8 -4
  48. package/dist/core/nodes/ExpressionNode.d.ts +2 -2
  49. package/dist/core/nodes/ExpressionNode.d.ts.map +1 -1
  50. package/dist/core/nodes/ExpressionNode.js +6 -4
  51. package/dist/core/nodes/ExternalModuleNode.d.ts +4 -0
  52. package/dist/core/nodes/ExternalModuleNode.d.ts.map +1 -1
  53. package/dist/core/nodes/ExternalModuleNode.js +10 -2
  54. package/dist/core/nodes/HttpRequestNode.d.ts +4 -4
  55. package/dist/core/nodes/HttpRequestNode.d.ts.map +1 -1
  56. package/dist/core/nodes/HttpRequestNode.js +7 -4
  57. package/dist/core/nodes/ImportNode.d.ts +10 -2
  58. package/dist/core/nodes/ImportNode.d.ts.map +1 -1
  59. package/dist/core/nodes/ImportNode.js +21 -4
  60. package/dist/core/nodes/InterfaceNode.d.ts +2 -2
  61. package/dist/core/nodes/InterfaceNode.d.ts.map +1 -1
  62. package/dist/core/nodes/InterfaceNode.js +5 -3
  63. package/dist/core/nodes/LiteralNode.d.ts +2 -2
  64. package/dist/core/nodes/LiteralNode.d.ts.map +1 -1
  65. package/dist/core/nodes/LiteralNode.js +6 -4
  66. package/dist/core/nodes/MethodCallNode.d.ts +2 -2
  67. package/dist/core/nodes/MethodCallNode.d.ts.map +1 -1
  68. package/dist/core/nodes/MethodCallNode.js +9 -5
  69. package/dist/core/nodes/MethodNode.d.ts +2 -2
  70. package/dist/core/nodes/MethodNode.d.ts.map +1 -1
  71. package/dist/core/nodes/MethodNode.js +8 -4
  72. package/dist/core/nodes/ObjectLiteralNode.d.ts.map +1 -1
  73. package/dist/core/nodes/ObjectLiteralNode.js +4 -2
  74. package/dist/core/nodes/ParameterNode.d.ts +2 -2
  75. package/dist/core/nodes/ParameterNode.d.ts.map +1 -1
  76. package/dist/core/nodes/ParameterNode.js +5 -3
  77. package/dist/core/nodes/TypeNode.d.ts +2 -2
  78. package/dist/core/nodes/TypeNode.d.ts.map +1 -1
  79. package/dist/core/nodes/TypeNode.js +5 -3
  80. package/dist/core/nodes/VariableDeclarationNode.d.ts +2 -2
  81. package/dist/core/nodes/VariableDeclarationNode.d.ts.map +1 -1
  82. package/dist/core/nodes/VariableDeclarationNode.js +9 -5
  83. package/dist/core/nodes/index.d.ts +3 -0
  84. package/dist/core/nodes/index.d.ts.map +1 -1
  85. package/dist/core/nodes/index.js +3 -0
  86. package/dist/data/builtins/BuiltinRegistry.d.ts +78 -0
  87. package/dist/data/builtins/BuiltinRegistry.d.ts.map +1 -0
  88. package/dist/data/builtins/BuiltinRegistry.js +110 -0
  89. package/dist/data/builtins/definitions.d.ts +28 -0
  90. package/dist/data/builtins/definitions.d.ts.map +1 -0
  91. package/dist/data/builtins/definitions.js +250 -0
  92. package/dist/data/builtins/index.d.ts +10 -0
  93. package/dist/data/builtins/index.d.ts.map +1 -0
  94. package/dist/data/builtins/index.js +8 -0
  95. package/dist/data/builtins/jsGlobals.d.ts +18 -0
  96. package/dist/data/builtins/jsGlobals.d.ts.map +1 -0
  97. package/dist/data/builtins/jsGlobals.js +26 -0
  98. package/dist/data/builtins/types.d.ts +34 -0
  99. package/dist/data/builtins/types.d.ts.map +1 -0
  100. package/dist/data/builtins/types.js +7 -0
  101. package/dist/data/globals/definitions.d.ts +27 -0
  102. package/dist/data/globals/definitions.d.ts.map +1 -0
  103. package/dist/data/globals/definitions.js +117 -0
  104. package/dist/data/globals/index.d.ts +36 -0
  105. package/dist/data/globals/index.d.ts.map +1 -0
  106. package/dist/data/globals/index.js +52 -0
  107. package/dist/diagnostics/DiagnosticReporter.d.ts +23 -0
  108. package/dist/diagnostics/DiagnosticReporter.d.ts.map +1 -1
  109. package/dist/diagnostics/DiagnosticReporter.js +88 -0
  110. package/dist/diagnostics/index.d.ts +1 -1
  111. package/dist/diagnostics/index.d.ts.map +1 -1
  112. package/dist/errors/GrafemaError.d.ts +43 -0
  113. package/dist/errors/GrafemaError.d.ts.map +1 -1
  114. package/dist/errors/GrafemaError.js +50 -0
  115. package/dist/index.d.ts +17 -1
  116. package/dist/index.d.ts.map +1 -1
  117. package/dist/index.js +17 -1
  118. package/dist/plugins/analysis/DatabaseAnalyzer.d.ts.map +1 -1
  119. package/dist/plugins/analysis/DatabaseAnalyzer.js +3 -2
  120. package/dist/plugins/analysis/ExpressAnalyzer.d.ts.map +1 -1
  121. package/dist/plugins/analysis/ExpressAnalyzer.js +3 -1
  122. package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts +148 -0
  123. package/dist/plugins/analysis/ExpressResponseAnalyzer.d.ts.map +1 -0
  124. package/dist/plugins/analysis/ExpressResponseAnalyzer.js +495 -0
  125. package/dist/plugins/analysis/ExpressRouteAnalyzer.d.ts.map +1 -1
  126. package/dist/plugins/analysis/ExpressRouteAnalyzer.js +53 -18
  127. package/dist/plugins/analysis/FetchAnalyzer.d.ts +40 -0
  128. package/dist/plugins/analysis/FetchAnalyzer.d.ts.map +1 -1
  129. package/dist/plugins/analysis/FetchAnalyzer.js +163 -15
  130. package/dist/plugins/analysis/JSASTAnalyzer.d.ts +157 -26
  131. package/dist/plugins/analysis/JSASTAnalyzer.d.ts.map +1 -1
  132. package/dist/plugins/analysis/JSASTAnalyzer.js +2418 -191
  133. package/dist/plugins/analysis/RustAnalyzer.js +4 -4
  134. package/dist/plugins/analysis/SQLiteAnalyzer.d.ts.map +1 -1
  135. package/dist/plugins/analysis/SQLiteAnalyzer.js +4 -2
  136. package/dist/plugins/analysis/SocketIOAnalyzer.d.ts +9 -0
  137. package/dist/plugins/analysis/SocketIOAnalyzer.d.ts.map +1 -1
  138. package/dist/plugins/analysis/SocketIOAnalyzer.js +91 -7
  139. package/dist/plugins/analysis/ast/GraphBuilder.d.ts +173 -0
  140. package/dist/plugins/analysis/ast/GraphBuilder.d.ts.map +1 -1
  141. package/dist/plugins/analysis/ast/GraphBuilder.js +1256 -65
  142. package/dist/plugins/analysis/ast/types.d.ts +294 -0
  143. package/dist/plugins/analysis/ast/types.d.ts.map +1 -1
  144. package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts +5 -1
  145. package/dist/plugins/analysis/ast/visitors/ASTVisitor.d.ts.map +1 -1
  146. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts +1 -0
  147. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.d.ts.map +1 -1
  148. package/dist/plugins/analysis/ast/visitors/CallExpressionVisitor.js +12 -1
  149. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts +10 -0
  150. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.d.ts.map +1 -1
  151. package/dist/plugins/analysis/ast/visitors/FunctionVisitor.js +62 -0
  152. package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.d.ts +4 -0
  153. package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.d.ts.map +1 -1
  154. package/dist/plugins/analysis/ast/visitors/ImportExportVisitor.js +101 -0
  155. package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts +16 -1
  156. package/dist/plugins/analysis/ast/visitors/VariableVisitor.d.ts.map +1 -1
  157. package/dist/plugins/analysis/ast/visitors/VariableVisitor.js +233 -39
  158. package/dist/plugins/discovery/WorkspaceDiscovery.d.ts.map +1 -1
  159. package/dist/plugins/discovery/WorkspaceDiscovery.js +9 -4
  160. package/dist/plugins/enrichment/AliasTracker.d.ts.map +1 -1
  161. package/dist/plugins/enrichment/AliasTracker.js +16 -1
  162. package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts +32 -0
  163. package/dist/plugins/enrichment/ArgumentParameterLinker.d.ts.map +1 -0
  164. package/dist/plugins/enrichment/ArgumentParameterLinker.js +175 -0
  165. package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts +51 -0
  166. package/dist/plugins/enrichment/ClosureCaptureEnricher.d.ts.map +1 -0
  167. package/dist/plugins/enrichment/ClosureCaptureEnricher.js +205 -0
  168. package/dist/plugins/enrichment/ExternalCallResolver.d.ts +42 -0
  169. package/dist/plugins/enrichment/ExternalCallResolver.d.ts.map +1 -0
  170. package/dist/plugins/enrichment/ExternalCallResolver.js +213 -0
  171. package/dist/plugins/enrichment/FunctionCallResolver.d.ts +58 -0
  172. package/dist/plugins/enrichment/FunctionCallResolver.d.ts.map +1 -0
  173. package/dist/plugins/enrichment/FunctionCallResolver.js +340 -0
  174. package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts +16 -3
  175. package/dist/plugins/enrichment/HTTPConnectionEnricher.d.ts.map +1 -1
  176. package/dist/plugins/enrichment/HTTPConnectionEnricher.js +64 -20
  177. package/dist/plugins/enrichment/MethodCallResolver.d.ts.map +1 -1
  178. package/dist/plugins/enrichment/MethodCallResolver.js +15 -1
  179. package/dist/plugins/enrichment/MountPointResolver.d.ts +14 -12
  180. package/dist/plugins/enrichment/MountPointResolver.d.ts.map +1 -1
  181. package/dist/plugins/enrichment/MountPointResolver.js +172 -151
  182. package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts +44 -0
  183. package/dist/plugins/enrichment/NodejsBuiltinsResolver.d.ts.map +1 -0
  184. package/dist/plugins/enrichment/NodejsBuiltinsResolver.js +271 -0
  185. package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts +5 -27
  186. package/dist/plugins/enrichment/ValueDomainAnalyzer.d.ts.map +1 -1
  187. package/dist/plugins/enrichment/ValueDomainAnalyzer.js +62 -139
  188. package/dist/plugins/indexing/JSModuleIndexer.d.ts +15 -0
  189. package/dist/plugins/indexing/JSModuleIndexer.d.ts.map +1 -1
  190. package/dist/plugins/indexing/JSModuleIndexer.js +58 -0
  191. package/dist/plugins/indexing/RustModuleIndexer.d.ts +1 -1
  192. package/dist/plugins/indexing/RustModuleIndexer.js +4 -4
  193. package/dist/plugins/validation/BrokenImportValidator.d.ts +31 -0
  194. package/dist/plugins/validation/BrokenImportValidator.d.ts.map +1 -0
  195. package/dist/plugins/validation/BrokenImportValidator.js +249 -0
  196. package/dist/plugins/validation/CallResolverValidator.d.ts +21 -10
  197. package/dist/plugins/validation/CallResolverValidator.d.ts.map +1 -1
  198. package/dist/plugins/validation/CallResolverValidator.js +101 -76
  199. package/dist/plugins/validation/DataFlowValidator.d.ts.map +1 -1
  200. package/dist/plugins/validation/DataFlowValidator.js +49 -41
  201. package/dist/plugins/validation/GraphConnectivityValidator.d.ts.map +1 -1
  202. package/dist/plugins/validation/GraphConnectivityValidator.js +25 -1
  203. package/dist/plugins/validation/SQLInjectionValidator.d.ts.map +1 -1
  204. package/dist/plugins/validation/SQLInjectionValidator.js +2 -3
  205. package/dist/queries/findCallsInFunction.d.ts +52 -0
  206. package/dist/queries/findCallsInFunction.d.ts.map +1 -0
  207. package/dist/queries/findCallsInFunction.js +135 -0
  208. package/dist/queries/findContainingFunction.d.ts +45 -0
  209. package/dist/queries/findContainingFunction.d.ts.map +1 -0
  210. package/dist/queries/findContainingFunction.js +54 -0
  211. package/dist/queries/index.d.ts +14 -0
  212. package/dist/queries/index.d.ts.map +1 -0
  213. package/dist/queries/index.js +11 -0
  214. package/dist/queries/traceValues.d.ts +70 -0
  215. package/dist/queries/traceValues.d.ts.map +1 -0
  216. package/dist/queries/traceValues.js +299 -0
  217. package/dist/queries/types.d.ts +163 -0
  218. package/dist/queries/types.d.ts.map +1 -0
  219. package/dist/queries/types.js +9 -0
  220. package/dist/schema/GraphSchemaExtractor.d.ts +53 -0
  221. package/dist/schema/GraphSchemaExtractor.d.ts.map +1 -0
  222. package/dist/schema/GraphSchemaExtractor.js +124 -0
  223. package/dist/schema/InterfaceSchemaExtractor.d.ts +73 -0
  224. package/dist/schema/InterfaceSchemaExtractor.d.ts.map +1 -0
  225. package/dist/schema/InterfaceSchemaExtractor.js +112 -0
  226. package/dist/schema/index.d.ts +5 -0
  227. package/dist/schema/index.d.ts.map +1 -0
  228. package/dist/schema/index.js +2 -0
  229. package/dist/storage/backends/RFDBServerBackend.d.ts +12 -18
  230. package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
  231. package/dist/storage/backends/RFDBServerBackend.js +41 -52
  232. package/dist/storage/backends/typeValidation.d.ts.map +1 -1
  233. package/dist/storage/backends/typeValidation.js +1 -0
  234. package/package.json +3 -3
  235. package/src/Orchestrator.ts +35 -3
  236. package/src/config/ConfigLoader.ts +94 -3
  237. package/src/core/FileExplainer.ts +179 -0
  238. package/src/core/NodeFactory.ts +72 -8
  239. package/src/core/nodes/ArrayLiteralNode.ts +3 -2
  240. package/src/core/nodes/BranchNode.ts +113 -0
  241. package/src/core/nodes/CallSiteNode.ts +7 -5
  242. package/src/core/nodes/CaseNode.ts +123 -0
  243. package/src/core/nodes/ClassNode.ts +6 -4
  244. package/src/core/nodes/ConstantNode.ts +5 -4
  245. package/src/core/nodes/ConstructorCallNode.ts +217 -0
  246. package/src/core/nodes/DatabaseQueryNode.ts +5 -1
  247. package/src/core/nodes/DecoratorNode.ts +4 -3
  248. package/src/core/nodes/EnumNode.ts +4 -3
  249. package/src/core/nodes/EventListenerNode.ts +7 -4
  250. package/src/core/nodes/ExportNode.ts +6 -4
  251. package/src/core/nodes/ExpressionNode.ts +5 -4
  252. package/src/core/nodes/ExternalModuleNode.ts +11 -2
  253. package/src/core/nodes/HttpRequestNode.ts +7 -4
  254. package/src/core/nodes/ImportNode.ts +31 -4
  255. package/src/core/nodes/InterfaceNode.ts +4 -3
  256. package/src/core/nodes/LiteralNode.ts +5 -4
  257. package/src/core/nodes/MethodCallNode.ts +7 -5
  258. package/src/core/nodes/MethodNode.ts +6 -4
  259. package/src/core/nodes/ObjectLiteralNode.ts +3 -2
  260. package/src/core/nodes/ParameterNode.ts +4 -3
  261. package/src/core/nodes/TypeNode.ts +4 -3
  262. package/src/core/nodes/VariableDeclarationNode.ts +7 -5
  263. package/src/core/nodes/index.ts +3 -0
  264. package/src/data/builtins/BuiltinRegistry.ts +124 -0
  265. package/src/data/builtins/definitions.ts +267 -0
  266. package/src/data/builtins/index.ts +10 -0
  267. package/src/data/builtins/jsGlobals.ts +28 -0
  268. package/src/data/builtins/types.ts +36 -0
  269. package/src/data/globals/definitions.ts +156 -0
  270. package/src/data/globals/index.ts +66 -0
  271. package/src/diagnostics/DiagnosticReporter.ts +120 -0
  272. package/src/diagnostics/index.ts +1 -1
  273. package/src/errors/GrafemaError.ts +65 -0
  274. package/src/index.ts +45 -0
  275. package/src/plugins/analysis/DatabaseAnalyzer.ts +4 -2
  276. package/src/plugins/analysis/ExpressAnalyzer.ts +5 -1
  277. package/src/plugins/analysis/ExpressResponseAnalyzer.ts +636 -0
  278. package/src/plugins/analysis/ExpressRouteAnalyzer.ts +57 -18
  279. package/src/plugins/analysis/FetchAnalyzer.ts +204 -16
  280. package/src/plugins/analysis/JSASTAnalyzer.ts +2958 -260
  281. package/src/plugins/analysis/RustAnalyzer.ts +4 -4
  282. package/src/plugins/analysis/SQLiteAnalyzer.ts +5 -2
  283. package/src/plugins/analysis/SocketIOAnalyzer.ts +121 -7
  284. package/src/plugins/analysis/ast/GraphBuilder.ts +1578 -70
  285. package/src/plugins/analysis/ast/types.ts +387 -0
  286. package/src/plugins/analysis/ast/visitors/ASTVisitor.ts +8 -0
  287. package/src/plugins/analysis/ast/visitors/CallExpressionVisitor.ts +16 -1
  288. package/src/plugins/analysis/ast/visitors/FunctionVisitor.ts +77 -2
  289. package/src/plugins/analysis/ast/visitors/ImportExportVisitor.ts +112 -1
  290. package/src/plugins/analysis/ast/visitors/VariableVisitor.ts +272 -47
  291. package/src/plugins/discovery/WorkspaceDiscovery.ts +11 -4
  292. package/src/plugins/enrichment/AliasTracker.ts +22 -1
  293. package/src/plugins/enrichment/ArgumentParameterLinker.ts +240 -0
  294. package/src/plugins/enrichment/ClosureCaptureEnricher.ts +267 -0
  295. package/src/plugins/enrichment/ExternalCallResolver.ts +262 -0
  296. package/src/plugins/enrichment/FunctionCallResolver.ts +456 -0
  297. package/src/plugins/enrichment/HTTPConnectionEnricher.ts +70 -20
  298. package/src/plugins/enrichment/MethodCallResolver.ts +21 -1
  299. package/src/plugins/enrichment/MountPointResolver.ts +206 -198
  300. package/src/plugins/enrichment/NodejsBuiltinsResolver.ts +365 -0
  301. package/src/plugins/enrichment/ValueDomainAnalyzer.ts +67 -184
  302. package/src/plugins/indexing/JSModuleIndexer.ts +66 -0
  303. package/src/plugins/indexing/RustModuleIndexer.ts +4 -4
  304. package/src/plugins/validation/BrokenImportValidator.ts +325 -0
  305. package/src/plugins/validation/CallResolverValidator.ts +129 -109
  306. package/src/plugins/validation/DataFlowValidator.ts +75 -58
  307. package/src/plugins/validation/GraphConnectivityValidator.ts +39 -1
  308. package/src/plugins/validation/SQLInjectionValidator.ts +2 -5
  309. package/src/queries/README.md +46 -0
  310. package/src/queries/findCallsInFunction.ts +206 -0
  311. package/src/queries/findContainingFunction.ts +83 -0
  312. package/src/queries/index.ts +23 -0
  313. package/src/queries/traceValues.ts +398 -0
  314. package/src/queries/types.ts +187 -0
  315. package/src/schema/GraphSchemaExtractor.ts +177 -0
  316. package/src/schema/InterfaceSchemaExtractor.ts +173 -0
  317. package/src/schema/index.ts +5 -0
  318. package/src/storage/backends/RFDBServerBackend.ts +58 -70
  319. package/src/storage/backends/typeValidation.ts +1 -0
@@ -0,0 +1,171 @@
1
+ /**
2
+ * ConstructorCallNode - contract for CONSTRUCTOR_CALL node
3
+ *
4
+ * Represents a `new ClassName()` expression in code.
5
+ * Used for data flow: VARIABLE --ASSIGNED_FROM--> CONSTRUCTOR_CALL
6
+ *
7
+ * ID format: {file}:CONSTRUCTOR_CALL:{className}:{line}:{column}
8
+ * Example: src/app.js:CONSTRUCTOR_CALL:Date:42:10
9
+ */
10
+ /**
11
+ * List of built-in JavaScript constructors
12
+ * These are globally available and don't require imports
13
+ */
14
+ const BUILTIN_CONSTRUCTORS = new Set([
15
+ // Fundamental objects
16
+ 'Object',
17
+ 'Function',
18
+ 'Boolean',
19
+ 'Symbol',
20
+ // Error types
21
+ 'Error',
22
+ 'EvalError',
23
+ 'RangeError',
24
+ 'ReferenceError',
25
+ 'SyntaxError',
26
+ 'TypeError',
27
+ 'URIError',
28
+ 'AggregateError',
29
+ // Numbers and dates
30
+ 'Number',
31
+ 'BigInt',
32
+ 'Math',
33
+ 'Date',
34
+ // Text processing
35
+ 'String',
36
+ 'RegExp',
37
+ // Indexed collections
38
+ 'Array',
39
+ 'Int8Array',
40
+ 'Uint8Array',
41
+ 'Uint8ClampedArray',
42
+ 'Int16Array',
43
+ 'Uint16Array',
44
+ 'Int32Array',
45
+ 'Uint32Array',
46
+ 'Float32Array',
47
+ 'Float64Array',
48
+ 'BigInt64Array',
49
+ 'BigUint64Array',
50
+ // Keyed collections
51
+ 'Map',
52
+ 'Set',
53
+ 'WeakMap',
54
+ 'WeakSet',
55
+ 'WeakRef',
56
+ // Structured data
57
+ 'ArrayBuffer',
58
+ 'SharedArrayBuffer',
59
+ 'DataView',
60
+ 'Atomics',
61
+ 'JSON',
62
+ // Control abstraction
63
+ 'Promise',
64
+ 'Generator',
65
+ 'GeneratorFunction',
66
+ 'AsyncFunction',
67
+ 'AsyncGenerator',
68
+ 'AsyncGeneratorFunction',
69
+ // Reflection
70
+ 'Reflect',
71
+ 'Proxy',
72
+ // Internationalization
73
+ 'Intl',
74
+ // Web APIs (commonly used)
75
+ 'URL',
76
+ 'URLSearchParams',
77
+ 'Headers',
78
+ 'Request',
79
+ 'Response',
80
+ 'FormData',
81
+ 'Blob',
82
+ 'File',
83
+ 'FileReader',
84
+ 'AbortController',
85
+ 'TextEncoder',
86
+ 'TextDecoder',
87
+ 'Event',
88
+ 'CustomEvent',
89
+ 'EventTarget',
90
+ 'WebSocket',
91
+ 'Worker',
92
+ 'MessageChannel',
93
+ 'MessagePort',
94
+ 'BroadcastChannel',
95
+ 'ReadableStream',
96
+ 'WritableStream',
97
+ 'TransformStream',
98
+ 'CompressionStream',
99
+ 'DecompressionStream',
100
+ ]);
101
+ export class ConstructorCallNode {
102
+ static TYPE = 'CONSTRUCTOR_CALL';
103
+ static REQUIRED = ['name', 'file', 'line', 'column', 'className', 'isBuiltin'];
104
+ static OPTIONAL = [];
105
+ /**
106
+ * Check if a class name is a built-in JavaScript constructor
107
+ */
108
+ static isBuiltinConstructor(className) {
109
+ return BUILTIN_CONSTRUCTORS.has(className);
110
+ }
111
+ /**
112
+ * Generate ID for CONSTRUCTOR_CALL node
113
+ *
114
+ * @param className - Name of the constructor
115
+ * @param file - File path
116
+ * @param line - Line number
117
+ * @param column - Column position
118
+ * @param options - Optional counter for disambiguation
119
+ */
120
+ static generateId(className, file, line, column, options = {}) {
121
+ const counter = options.counter !== undefined ? `:${options.counter}` : '';
122
+ return `${file}:CONSTRUCTOR_CALL:${className}:${line}:${column}${counter}`;
123
+ }
124
+ /**
125
+ * Create CONSTRUCTOR_CALL node
126
+ *
127
+ * @param className - Name of the constructor (e.g., 'Date', 'MyClass')
128
+ * @param file - File path
129
+ * @param line - Line number
130
+ * @param column - Column position
131
+ * @param options - Optional counter for disambiguation
132
+ */
133
+ static create(className, file, line, column, options = {}) {
134
+ if (!className)
135
+ throw new Error('ConstructorCallNode.create: className is required');
136
+ if (!file)
137
+ throw new Error('ConstructorCallNode.create: file is required');
138
+ if (line === undefined)
139
+ throw new Error('ConstructorCallNode.create: line is required');
140
+ if (column === undefined)
141
+ throw new Error('ConstructorCallNode.create: column is required');
142
+ const id = this.generateId(className, file, line, column, options);
143
+ const isBuiltin = this.isBuiltinConstructor(className);
144
+ return {
145
+ id,
146
+ type: this.TYPE,
147
+ name: `new ${className}()`,
148
+ className,
149
+ isBuiltin,
150
+ file,
151
+ line,
152
+ column
153
+ };
154
+ }
155
+ static validate(node) {
156
+ const errors = [];
157
+ if (node.type !== this.TYPE) {
158
+ errors.push(`Expected type ${this.TYPE}, got ${node.type}`);
159
+ }
160
+ const nodeRecord = node;
161
+ for (const field of this.REQUIRED) {
162
+ if (nodeRecord[field] === undefined || nodeRecord[field] === null) {
163
+ errors.push(`Missing required field: ${field}`);
164
+ }
165
+ }
166
+ if (typeof node.isBuiltin !== 'boolean') {
167
+ errors.push('isBuiltin must be a boolean');
168
+ }
169
+ return errors;
170
+ }
171
+ }
@@ -4,6 +4,7 @@
4
4
  import type { BaseNodeRecord } from '@grafema/types';
5
5
  interface DatabaseQueryNodeRecord extends BaseNodeRecord {
6
6
  type: 'DATABASE_QUERY';
7
+ column: number;
7
8
  query?: string;
8
9
  operation: string;
9
10
  parentScopeId?: string;
@@ -13,9 +14,9 @@ interface DatabaseQueryNodeOptions {
13
14
  }
14
15
  export declare class DatabaseQueryNode {
15
16
  static readonly TYPE: "DATABASE_QUERY";
16
- static readonly REQUIRED: readonly ["name", "file", "line"];
17
+ static readonly REQUIRED: readonly ["name", "file", "line", "column"];
17
18
  static readonly OPTIONAL: readonly ["query", "operation", "parentScopeId"];
18
- static create(query: string | undefined, operation: string | undefined, file: string, line: number, options?: DatabaseQueryNodeOptions): DatabaseQueryNodeRecord;
19
+ static create(query: string | undefined, operation: string | undefined, file: string, line: number, column: number, options?: DatabaseQueryNodeOptions): DatabaseQueryNodeRecord;
19
20
  static validate(node: DatabaseQueryNodeRecord): string[];
20
21
  }
21
22
  export type { DatabaseQueryNodeRecord };
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseQueryNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/DatabaseQueryNode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,UAAU,uBAAwB,SAAQ,cAAc;IACtD,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,wBAAwB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAEjD,MAAM,CAAC,QAAQ,CAAC,QAAQ,oCAAqC;IAC7D,MAAM,CAAC,QAAQ,CAAC,QAAQ,mDAAoD;IAE5E,MAAM,CAAC,MAAM,CACX,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,wBAA6B,GACrC,uBAAuB;IAmB1B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,GAAG,MAAM,EAAE;CASzD;AAED,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"DatabaseQueryNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/DatabaseQueryNode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,UAAU,uBAAwB,SAAQ,cAAc;IACtD,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,wBAAwB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAEjD,MAAM,CAAC,QAAQ,CAAC,QAAQ,8CAA+C;IACvE,MAAM,CAAC,QAAQ,CAAC,QAAQ,mDAAoD;IAE5E,MAAM,CAAC,MAAM,CACX,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,wBAA6B,GACrC,uBAAuB;IAqB1B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,GAAG,MAAM,EAAE;CASzD;AAED,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
@@ -3,13 +3,15 @@
3
3
  */
4
4
  export class DatabaseQueryNode {
5
5
  static TYPE = 'DATABASE_QUERY';
6
- static REQUIRED = ['name', 'file', 'line'];
6
+ static REQUIRED = ['name', 'file', 'line', 'column'];
7
7
  static OPTIONAL = ['query', 'operation', 'parentScopeId'];
8
- static create(query, operation, file, line, options = {}) {
8
+ static create(query, operation, file, line, column, options = {}) {
9
9
  if (!file)
10
10
  throw new Error('DatabaseQueryNode.create: file is required');
11
11
  if (line === undefined)
12
12
  throw new Error('DatabaseQueryNode.create: line is required');
13
+ if (column === undefined)
14
+ throw new Error('DatabaseQueryNode.create: column is required');
13
15
  const name = query || `${operation || 'QUERY'}`;
14
16
  const id = `${file}:DATABASE_QUERY:${name}:${line}`;
15
17
  return {
@@ -20,6 +22,7 @@ export class DatabaseQueryNode {
20
22
  operation: operation || 'UNKNOWN',
21
23
  file,
22
24
  line,
25
+ column,
23
26
  parentScopeId: options.parentScopeId
24
27
  };
25
28
  }
@@ -21,8 +21,8 @@ interface DecoratorNodeOptions {
21
21
  }
22
22
  export declare class DecoratorNode {
23
23
  static readonly TYPE: "DECORATOR";
24
- static readonly REQUIRED: readonly ["name", "file", "line", "targetId", "targetType"];
25
- static readonly OPTIONAL: readonly ["column", "arguments"];
24
+ static readonly REQUIRED: readonly ["name", "file", "line", "column", "targetId", "targetType"];
25
+ static readonly OPTIONAL: readonly ["arguments"];
26
26
  /**
27
27
  * Create DECORATOR node
28
28
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DecoratorNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/DecoratorNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,KAAK,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAEzE,UAAU,mBAAoB,SAAQ,cAAc;IAClD,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,mBAAmB,CAAC;CACjC;AAED,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;CACvB;AAED,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,WAAW,CAAU;IAE5C,MAAM,CAAC,QAAQ,CAAC,QAAQ,8DAA+D;IACvF,MAAM,CAAC,QAAQ,CAAC,QAAQ,mCAAoC;IAE5D;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,mBAAmB,EAC/B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB;IAoBtB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,EAAE;CAgBrD;AAED,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"DecoratorNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/DecoratorNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,KAAK,mBAAmB,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAEzE,UAAU,mBAAoB,SAAQ,cAAc;IAClD,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,mBAAmB,CAAC;CACjC;AAED,UAAU,oBAAoB;IAC5B,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;CACvB;AAED,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,WAAW,CAAU;IAE5C,MAAM,CAAC,QAAQ,CAAC,QAAQ,wEAAyE;IACjG,MAAM,CAAC,QAAQ,CAAC,QAAQ,yBAA0B;IAElD;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,mBAAmB,EAC/B,OAAO,GAAE,oBAAyB,GACjC,mBAAmB;IAqBtB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,EAAE;CAgBrD;AAED,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -9,8 +9,8 @@
9
9
  */
10
10
  export class DecoratorNode {
11
11
  static TYPE = 'DECORATOR';
12
- static REQUIRED = ['name', 'file', 'line', 'targetId', 'targetType'];
13
- static OPTIONAL = ['column', 'arguments'];
12
+ static REQUIRED = ['name', 'file', 'line', 'column', 'targetId', 'targetType'];
13
+ static OPTIONAL = ['arguments'];
14
14
  /**
15
15
  * Create DECORATOR node
16
16
  *
@@ -30,6 +30,8 @@ export class DecoratorNode {
30
30
  throw new Error('DecoratorNode.create: file is required');
31
31
  if (!line)
32
32
  throw new Error('DecoratorNode.create: line is required');
33
+ if (column === undefined)
34
+ throw new Error('DecoratorNode.create: column is required');
33
35
  if (!targetId)
34
36
  throw new Error('DecoratorNode.create: targetId is required');
35
37
  if (!targetType)
@@ -40,7 +42,7 @@ export class DecoratorNode {
40
42
  name,
41
43
  file,
42
44
  line,
43
- column: column || 0,
45
+ column,
44
46
  arguments: options.arguments || [],
45
47
  targetId,
46
48
  targetType
@@ -23,8 +23,8 @@ interface EnumNodeOptions {
23
23
  }
24
24
  export declare class EnumNode {
25
25
  static readonly TYPE: "ENUM";
26
- static readonly REQUIRED: readonly ["name", "file", "line"];
27
- static readonly OPTIONAL: readonly ["column", "isConst", "members"];
26
+ static readonly REQUIRED: readonly ["name", "file", "line", "column"];
27
+ static readonly OPTIONAL: readonly ["isConst", "members"];
28
28
  /**
29
29
  * Create ENUM node
30
30
  *
@@ -1 +1 @@
1
- {"version":3,"file":"EnumNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/EnumNode.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,UAAU,cAAe,SAAQ,cAAc;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,UAAU,eAAe;IACvB,OAAO,CAAC,EAAE,O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,kCAAmC;IAE3D;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,eAAoB,GAC5B,cAAc;IAkBjB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,EAAE;CAgBhD;AAED,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC"}
@@ -8,8 +8,8 @@
8
8
  */
9
9
  export class EnumNode {
10
10
  static TYPE = 'ENUM';
11
- static REQUIRED = ['name', 'file', 'line'];
12
- static OPTIONAL = ['column', 'isConst', 'members'];
11
+ static REQUIRED = ['name', 'file', 'line', 'column'];
12
+ static OPTIONAL = ['isConst', 'members'];
13
13
  /**
14
14
  * Create ENUM node
15
15
  *
@@ -27,13 +27,15 @@ export class EnumNode {
27
27
  throw new Error('EnumNode.create: file is required');
28
28
  if (!line)
29
29
  throw new Error('EnumNode.create: line is required');
30
+ if (column === undefined)
31
+ throw new Error('EnumNode.create: column is required');
30
32
  return {
31
33
  id: `${file}:ENUM:${name}:${line}`,
32
34
  type: this.TYPE,
33
35
  name,
34
36
  file,
35
37
  line,
36
- column: column || 0,
38
+ column,
37
39
  isConst: options.isConst || false,
38
40
  members: options.members || []
39
41
  };
@@ -4,21 +4,21 @@
4
4
  import type { BaseNodeRecord } from '@grafema/types';
5
5
  interface EventListenerNodeRecord extends BaseNodeRecord {
6
6
  type: 'EVENT_LISTENER';
7
+ column: number;
7
8
  object?: string;
8
9
  parentScopeId?: string;
9
10
  callbackArg?: string;
10
11
  }
11
12
  interface EventListenerNodeOptions {
12
- column?: number;
13
13
  parentScopeId?: string;
14
14
  callbackArg?: string;
15
15
  counter?: number;
16
16
  }
17
17
  export declare class EventListenerNode {
18
18
  static readonly TYPE: "EVENT_LISTENER";
19
- static readonly REQUIRED: readonly ["name", "file", "line"];
20
- static readonly OPTIONAL: readonly ["object", "column", "parentScopeId", "callbackArg"];
21
- static create(eventName: string, objectName: string | undefined, file: string, line: number, options?: EventListenerNodeOptions): EventListenerNodeRecord;
19
+ static readonly REQUIRED: readonly ["name", "file", "line", "column"];
20
+ static readonly OPTIONAL: readonly ["object", "parentScopeId", "callbackArg"];
21
+ static create(eventName: string, objectName: string | undefined, file: string, line: number, column: number, options?: EventListenerNodeOptions): EventListenerNodeRecord;
22
22
  static validate(node: EventListenerNodeRecord): string[];
23
23
  }
24
24
  export type { EventListenerNodeRecord };
@@ -1 +1 @@
1
- {"version":3,"file":"EventListenerNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/EventListenerNode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,UAAU,uBAAwB,SAAQ,cAAc;IACtD,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,wBAAwB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAEjD,MAAM,CAAC,QAAQ,CAAC,QAAQ,oCAAqC;IAC7D,MAAM,CAAC,QAAQ,CAAC,QAAQ,gEAAiE;IAEzF,MAAM,CAAC,MAAM,CACX,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,wBAA6B,GACrC,uBAAuB;IAoB1B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,GAAG,MAAM,EAAE;CASzD;AAED,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
1
+ {"version":3,"file":"EventListenerNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/EventListenerNode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,UAAU,uBAAwB,SAAQ,cAAc;IACtD,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,wBAAwB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,iBAAiB;IAC5B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,gBAAgB,CAAU;IAEjD,MAAM,CAAC,QAAQ,CAAC,QAAQ,8CAA+C;IACvE,MAAM,CAAC,QAAQ,CAAC,QAAQ,sDAAuD;IAE/E,MAAM,CAAC,MAAM,CACX,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,wBAA6B,GACrC,uBAAuB;IAsB1B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,GAAG,MAAM,EAAE;CASzD;AAED,YAAY,EAAE,uBAAuB,EAAE,CAAC"}
@@ -3,17 +3,19 @@
3
3
  */
4
4
  export class EventListenerNode {
5
5
  static TYPE = 'EVENT_LISTENER';
6
- static REQUIRED = ['name', 'file', 'line'];
7
- static OPTIONAL = ['object', 'column', 'parentScopeId', 'callbackArg'];
8
- static create(eventName, objectName, file, line, options = {}) {
6
+ static REQUIRED = ['name', 'file', 'line', 'column'];
7
+ static OPTIONAL = ['object', 'parentScopeId', 'callbackArg'];
8
+ static create(eventName, objectName, file, line, column, options = {}) {
9
9
  if (!eventName)
10
10
  throw new Error('EventListenerNode.create: eventName is required');
11
11
  if (!file)
12
12
  throw new Error('EventListenerNode.create: file is required');
13
13
  if (line === undefined)
14
14
  throw new Error('EventListenerNode.create: line is required');
15
+ if (column === undefined)
16
+ throw new Error('EventListenerNode.create: column is required');
15
17
  const counter = options.counter !== undefined ? `:${options.counter}` : '';
16
- const id = `${file}:EVENT_LISTENER:${eventName}:${line}:${options.column || 0}${counter}`;
18
+ const id = `${file}:EVENT_LISTENER:${eventName}:${line}:${column}${counter}`;
17
19
  return {
18
20
  id,
19
21
  type: this.TYPE,
@@ -21,6 +23,7 @@ export class EventListenerNode {
21
23
  object: objectName,
22
24
  file,
23
25
  line,
26
+ column,
24
27
  parentScopeId: options.parentScopeId,
25
28
  callbackArg: options.callbackArg
26
29
  };
@@ -40,8 +40,8 @@ interface ExportContextOptions {
40
40
  }
41
41
  export declare class ExportNode {
42
42
  static readonly TYPE: "EXPORT";
43
- static readonly REQUIRED: readonly ["name", "file", "line"];
44
- static readonly OPTIONAL: readonly ["column", "exportKind", "local", "default", "source", "exportType"];
43
+ static readonly REQUIRED: readonly ["name", "file", "line", "column"];
44
+ static readonly OPTIONAL: readonly ["exportKind", "local", "default", "source", "exportType"];
45
45
  static create(name: string, file: string, line: number, column: number, options?: ExportNodeOptions): ExportNodeRecord;
46
46
  /**
47
47
  * Create EXPORT node with semantic ID (NEW API)
@@ -1 +1 @@
1
- {"version":3,"file":"ExportNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/ExportNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAqB,KAAK,YAAY,EAA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AE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,qBAAa,UAAU;IACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAU;IAEzC,MAAM,CAAC,QAAQ,CAAC,QAAQ,8CAA+C;IACvE,MAAM,CAAC,QAAQ,CAAC,QAAQ,sEAAuE;IAE/F,MAAM,CAAC,MAAM,CACX,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,iBAAsB,GAC9B,gBAAgB;IAqBnB;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,iBAAiB,CACtB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC3B,OAAO,GAAE,oBAAyB,GACjC,gBAAgB;IAyBnB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,GAAG,MAAM,EAAE;CAgBlD;AAED,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,CAAC"}
@@ -11,8 +11,8 @@
11
11
  import { computeSemanticId } from '../SemanticId.js';
12
12
  export class ExportNode {
13
13
  static TYPE = 'EXPORT';
14
- static REQUIRED = ['name', 'file', 'line'];
15
- static OPTIONAL = ['column', 'exportKind', 'local', 'default', 'source', 'exportType'];
14
+ static REQUIRED = ['name', 'file', 'line', 'column'];
15
+ static OPTIONAL = ['exportKind', 'local', 'default', 'source', 'exportType'];
16
16
  static create(name, file, line, column, options = {}) {
17
17
  if (!name)
18
18
  throw new Error('ExportNode.create: name is required');
@@ -20,13 +20,15 @@ export class ExportNode {
20
20
  throw new Error('ExportNode.create: file is required');
21
21
  if (!line)
22
22
  throw new Error('ExportNode.create: line is required');
23
+ if (column === undefined)
24
+ throw new Error('ExportNode.create: column is required');
23
25
  return {
24
26
  id: `${file}:EXPORT:${name}:${line}`,
25
27
  type: this.TYPE,
26
28
  name,
27
29
  file,
28
30
  line,
29
- column: column || 0,
31
+ column,
30
32
  exportKind: options.exportKind || 'value',
31
33
  local: options.local || name,
32
34
  default: options.default || false,
@@ -54,6 +56,8 @@ export class ExportNode {
54
56
  throw new Error('ExportNode.createWithContext: file is required');
55
57
  if (location.line === undefined)
56
58
  throw new Error('ExportNode.createWithContext: line is required');
59
+ if (location.column === undefined)
60
+ throw new Error('ExportNode.createWithContext: column is required');
57
61
  // Compute semantic ID
58
62
  const id = computeSemanticId(this.TYPE, name, context);
59
63
  return {
@@ -62,7 +66,7 @@ export class ExportNode {
62
66
  name,
63
67
  file: context.file,
64
68
  line: location.line,
65
- column: location.column ?? 0,
69
+ column: location.column,
66
70
  exportKind: options.exportKind || 'value',
67
71
  local: options.local || name,
68
72
  default: options.default || false,
@@ -35,8 +35,8 @@ interface ExpressionNodeOptions {
35
35
  }
36
36
  export declare class ExpressionNode {
37
37
  static readonly TYPE: "EXPRESSION";
38
- static readonly REQUIRED: readonly ["expressionType", "file", "line"];
39
- static readonly OPTIONAL: readonly ["column", "object", "property", "computed", "computedPropertyVar", "operator", "path", "baseName", "propertyPath", "arrayIndex"];
38
+ static readonly REQUIRED: readonly ["expressionType", "file", "line", "column"];
39
+ static readonly OPTIONAL: readonly ["object", "property", "computed", "computedPropertyVar", "operator", "path", "baseName", "propertyPath", "arrayIndex"];
40
40
  /**
41
41
  * Create EXPRESSION node
42
42
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ExpressionNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/ExpressionNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,UAAU,oBAAqB,SAAQ,cAAc;IACnD,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IAEvB,MAAM,CAAC,EAAE,MAAM,CAAC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AE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,YAAY,CAAU;IAE7C,MAAM,CAAC,QAAQ,CAAC,QAAQ,wDAAyD;IACjF,MAAM,CAAC,QAAQ,CAAC,QAAQ,mIAGb;IAEX;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,CACX,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,qBAA0B,GAClC,oBAAoB;IA8BvB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAqB3B;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,UAAU,CACf,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,MAAM;IAIT;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,kBAAkB,CACvB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,qBAAqB,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAC9C,oBAAoB;IAsCvB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,EAAE;CAiBtD;AAED,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -9,9 +9,9 @@
9
9
  */
10
10
  export class ExpressionNode {
11
11
  static TYPE = 'EXPRESSION';
12
- static REQUIRED = ['expressionType', 'file', 'line'];
12
+ static REQUIRED = ['expressionType', 'file', 'line', 'column'];
13
13
  static OPTIONAL = [
14
- 'column', 'object', 'property', 'computed', 'computedPropertyVar',
14
+ 'object', 'property', 'computed', 'computedPropertyVar',
15
15
  'operator', 'path', 'baseName', 'propertyPath', 'arrayIndex'
16
16
  ];
17
17
  /**
@@ -31,13 +31,15 @@ export class ExpressionNode {
31
31
  throw new Error('ExpressionNode.create: file is required');
32
32
  if (!line)
33
33
  throw new Error('ExpressionNode.create: line is required');
34
+ if (column === undefined)
35
+ throw new Error('ExpressionNode.create: column is required');
34
36
  const node = {
35
37
  id: `${file}:EXPRESSION:${expressionType}:${line}:${column}`,
36
38
  type: this.TYPE,
37
39
  name: this._computeName(expressionType, options),
38
40
  file,
39
41
  line,
40
- column: column || 0,
42
+ column,
41
43
  expressionType
42
44
  };
43
45
  // Add optional fields if present
@@ -138,7 +140,7 @@ export class ExpressionNode {
138
140
  name: this._computeName(expressionType, options),
139
141
  file,
140
142
  line,
141
- column: column || 0,
143
+ column,
142
144
  expressionType
143
145
  };
144
146
  // Add optional fields if present (same logic as create())
@@ -18,6 +18,10 @@ export declare class ExternalModuleNode {
18
18
  /**
19
19
  * Create EXTERNAL_MODULE node
20
20
  *
21
+ * Normalizes node: prefix for Node.js builtins:
22
+ * - 'node:fs' -> 'fs'
23
+ * - 'node:path' -> 'path'
24
+ *
21
25
  * @param source - Module name (e.g., 'lodash', '@tanstack/react-query', 'node:fs')
22
26
  * @returns ExternalModuleNodeRecord
23
27
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalModuleNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/ExternalModuleNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,UAAU,wBAAyB,SAAQ,cAAc;IACvD,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,iBAAiB,CAAU;IAElD,MAAM,CAAC,QAAQ,CAAC,QAAQ,oBAAqB;IAC7C,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAe;IAEvC;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,wBAAwB;IAYvD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,EAAE;CAa1D;AAED,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"ExternalModuleNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/ExternalModuleNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,UAAU,wBAAyB,SAAQ,cAAc;IACvD,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,qBAAa,kBAAkB;IAC7B,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAG,iBAAiB,CAAU;IAElD,MAAM,CAAC,QAAQ,CAAC,QAAQ,oBAAqB;IAC7C,MAAM,CAAC,QAAQ,CAAC,QAAQ,cAAe;IAEvC;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,wBAAwB;IAiBvD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,MAAM,EAAE;CAa1D;AAED,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
@@ -14,16 +14,24 @@ export class ExternalModuleNode {
14
14
  /**
15
15
  * Create EXTERNAL_MODULE node
16
16
  *
17
+ * Normalizes node: prefix for Node.js builtins:
18
+ * - 'node:fs' -> 'fs'
19
+ * - 'node:path' -> 'path'
20
+ *
17
21
  * @param source - Module name (e.g., 'lodash', '@tanstack/react-query', 'node:fs')
18
22
  * @returns ExternalModuleNodeRecord
19
23
  */
20
24
  static create(source) {
21
25
  if (!source)
22
26
  throw new Error('ExternalModuleNode.create: source is required');
27
+ // Normalize node: prefix for Node.js builtins
28
+ const normalizedSource = source.startsWith('node:')
29
+ ? source.slice(5)
30
+ : source;
23
31
  return {
24
- id: `EXTERNAL_MODULE:${source}`,
32
+ id: `EXTERNAL_MODULE:${normalizedSource}`,
25
33
  type: this.TYPE,
26
- name: source,
34
+ name: normalizedSource,
27
35
  file: '',
28
36
  line: 0
29
37
  };
@@ -4,20 +4,20 @@
4
4
  import type { BaseNodeRecord } from '@grafema/types';
5
5
  interface HttpRequestNodeRecord extends BaseNodeRecord {
6
6
  type: 'HTTP_REQUEST';
7
+ column: number;
7
8
  url?: string;
8
9
  method: string;
9
10
  parentScopeId?: string;
10
11
  }
11
12
  interface HttpRequestNodeOptions {
12
- column?: number;
13
13
  parentScopeId?: string;
14
14
  counter?: number;
15
15
  }
16
16
  export declare class HttpRequestNode {
17
17
  static readonly TYPE: "HTTP_REQUEST";
18
- static readonly REQUIRED: readonly ["name", "file", "line"];
19
- static readonly OPTIONAL: readonly ["url", "method", "column", "parentScopeId"];
20
- static create(url: string | undefined, method: string | undefined, file: string, line: number, options?: HttpRequestNodeOptions): HttpRequestNodeRecord;
18
+ static readonly REQUIRED: readonly ["name", "file", "line", "column"];
19
+ static readonly OPTIONAL: readonly ["url", "method", "parentScopeId"];
20
+ static create(url: string | undefined, method: string | undefined, file: string, line: number, column: number, options?: HttpRequestNodeOptions): HttpRequestNodeRecord;
21
21
  static validate(node: HttpRequestNodeRecord): string[];
22
22
  }
23
23
  export type { HttpRequestNodeRecord };
@@ -1 +1 @@
1
- {"version":3,"file":"HttpRequestNode.d.ts","sourceRoot":"","sources":["../../../src/core/nodes/HttpRequestNode.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,UAAU,qBAAsB,SAAQ,cAAc;IACpD,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;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Q,8CAA+C;IAEvE,MAAM,CAAC,MAAM,CACX,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,sBAA2B,GACnC,qBAAqB;IAsBxB,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,EAAE;CASvD;AAED,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
@@ -3,16 +3,18 @@
3
3
  */
4
4
  export class HttpRequestNode {
5
5
  static TYPE = 'HTTP_REQUEST';
6
- static REQUIRED = ['name', 'file', 'line'];
7
- static OPTIONAL = ['url', 'method', 'column', 'parentScopeId'];
8
- static create(url, method, file, line, options = {}) {
6
+ static REQUIRED = ['name', 'file', 'line', 'column'];
7
+ static OPTIONAL = ['url', 'method', 'parentScopeId'];
8
+ static create(url, method, file, line, column, options = {}) {
9
9
  if (!file)
10
10
  throw new Error('HttpRequestNode.create: file is required');
11
11
  if (line === undefined)
12
12
  throw new Error('HttpRequestNode.create: line is required');
13
+ if (column === undefined)
14
+ throw new Error('HttpRequestNode.create: column is required');
13
15
  const httpMethod = method || 'GET';
14
16
  const counter = options.counter !== undefined ? `:${options.counter}` : '';
15
- const id = `${file}:HTTP_REQUEST:${httpMethod}:${line}:${options.column || 0}${counter}`;
17
+ const id = `${file}:HTTP_REQUEST:${httpMethod}:${line}:${column}${counter}`;
16
18
  return {
17
19
  id,
18
20
  type: this.TYPE,
@@ -21,6 +23,7 @@ export class HttpRequestNode {
21
23
  method: httpMethod,
22
24
  file,
23
25
  line,
26
+ column,
24
27
  parentScopeId: options.parentScopeId
25
28
  };
26
29
  }