@terra-graph/core 1.0.0-rc.4

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 (596) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +70 -0
  3. package/dist/cjs/Graph/Adapter.d.ts +8 -0
  4. package/dist/cjs/Graph/Adapter.js +5 -0
  5. package/dist/cjs/Graph/Adapters/DotAdapter.d.ts +17 -0
  6. package/dist/cjs/Graph/Adapters/DotAdapter.js +31 -0
  7. package/dist/cjs/Graph/Adapters/DotAdapter.test.d.ts +1 -0
  8. package/dist/cjs/Graph/Adapters/DotAdapter.test.js +45 -0
  9. package/dist/cjs/Graph/Adapters/GraphologyAdapter.d.ts +36 -0
  10. package/dist/cjs/Graph/Adapters/GraphologyAdapter.js +273 -0
  11. package/dist/cjs/Graph/Adapters/GraphologyAdapter.test.d.ts +1 -0
  12. package/dist/cjs/Graph/Adapters/GraphologyAdapter.test.js +561 -0
  13. package/dist/cjs/Graph/Adapters/index.d.ts +2 -0
  14. package/dist/cjs/Graph/Adapters/index.js +18 -0
  15. package/dist/cjs/Graph/GraphPlugin.d.ts +53 -0
  16. package/dist/cjs/Graph/GraphPlugin.js +223 -0
  17. package/dist/cjs/Graph/GraphPlugin.test.d.ts +1 -0
  18. package/dist/cjs/Graph/GraphPlugin.test.js +831 -0
  19. package/dist/cjs/Graph/GraphResolver.d.ts +21 -0
  20. package/dist/cjs/Graph/GraphResolver.js +80 -0
  21. package/dist/cjs/Graph/GraphResolver.test.d.ts +1 -0
  22. package/dist/cjs/Graph/GraphResolver.test.js +273 -0
  23. package/dist/cjs/Graph/Importer.d.ts +7 -0
  24. package/dist/cjs/Graph/Importer.js +2 -0
  25. package/dist/cjs/Graph/Importers/TerraformDotImporter.d.ts +12 -0
  26. package/dist/cjs/Graph/Importers/TerraformDotImporter.js +245 -0
  27. package/dist/cjs/Graph/Importers/TerraformDotImporter.test.d.ts +1 -0
  28. package/dist/cjs/Graph/Importers/TerraformDotImporter.test.js +343 -0
  29. package/dist/cjs/Graph/Importers/index.d.ts +1 -0
  30. package/dist/cjs/Graph/Importers/index.js +17 -0
  31. package/dist/cjs/Graph/Operations/Matchers/NodeMatchFn.d.ts +3 -0
  32. package/dist/cjs/Graph/Operations/Matchers/NodeMatchFn.js +2 -0
  33. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/NodeQuery.d.ts +21 -0
  34. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/NodeQuery.js +143 -0
  35. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/NodeQuery.test.d.ts +1 -0
  36. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/NodeQuery.test.js +308 -0
  37. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/QuerySchema.d.ts +155 -0
  38. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/QuerySchema.js +67 -0
  39. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/QuerySchema.test.d.ts +1 -0
  40. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/QuerySchema.test.js +51 -0
  41. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/index.d.ts +2 -0
  42. package/dist/cjs/Graph/Operations/Matchers/NodeQuery/index.js +18 -0
  43. package/dist/cjs/Graph/Operations/Matchers/index.d.ts +2 -0
  44. package/dist/cjs/Graph/Operations/Matchers/index.js +18 -0
  45. package/dist/cjs/Graph/Operations/Operations.d.ts +21 -0
  46. package/dist/cjs/Graph/Operations/Operations.js +2 -0
  47. package/dist/cjs/Graph/Operations/index.d.ts +2 -0
  48. package/dist/cjs/Graph/Operations/index.js +18 -0
  49. package/dist/cjs/Graph/Profile.d.ts +55 -0
  50. package/dist/cjs/Graph/Profile.js +223 -0
  51. package/dist/cjs/Graph/Profile.test.d.ts +1 -0
  52. package/dist/cjs/Graph/Profile.test.js +841 -0
  53. package/dist/cjs/Graph/ProfileRegistry.d.ts +18 -0
  54. package/dist/cjs/Graph/ProfileRegistry.js +61 -0
  55. package/dist/cjs/Graph/ProfileRegistry.test.d.ts +1 -0
  56. package/dist/cjs/Graph/ProfileRegistry.test.js +98 -0
  57. package/dist/cjs/Graph/Renderer.d.ts +9 -0
  58. package/dist/cjs/Graph/Renderer.js +2 -0
  59. package/dist/cjs/Graph/Renderers/DotRenderer.d.ts +27 -0
  60. package/dist/cjs/Graph/Renderers/DotRenderer.js +186 -0
  61. package/dist/cjs/Graph/Renderers/DotRenderer.test.d.ts +1 -0
  62. package/dist/cjs/Graph/Renderers/DotRenderer.test.js +1143 -0
  63. package/dist/cjs/Graph/Renderers/JsonRenderer.d.ts +5 -0
  64. package/dist/cjs/Graph/Renderers/JsonRenderer.js +13 -0
  65. package/dist/cjs/Graph/Renderers/JsonRenderer.test.d.ts +1 -0
  66. package/dist/cjs/Graph/Renderers/JsonRenderer.test.js +29 -0
  67. package/dist/cjs/Graph/Renderers/RendererRegistry.d.ts +15 -0
  68. package/dist/cjs/Graph/Renderers/RendererRegistry.js +33 -0
  69. package/dist/cjs/Graph/Renderers/RendererRegistry.test.d.ts +1 -0
  70. package/dist/cjs/Graph/Renderers/RendererRegistry.test.js +39 -0
  71. package/dist/cjs/Graph/Renderers/TgNodeLabel.d.ts +11 -0
  72. package/dist/cjs/Graph/Renderers/TgNodeLabel.js +43 -0
  73. package/dist/cjs/Graph/Renderers/TgNodeLabel.test.d.ts +1 -0
  74. package/dist/cjs/Graph/Renderers/TgNodeLabel.test.js +76 -0
  75. package/dist/cjs/Graph/Renderers/index.d.ts +4 -0
  76. package/dist/cjs/Graph/Renderers/index.js +20 -0
  77. package/dist/cjs/Graph/RuleError.d.ts +12 -0
  78. package/dist/cjs/Graph/RuleError.js +19 -0
  79. package/dist/cjs/Graph/RuleError.test.d.ts +1 -0
  80. package/dist/cjs/Graph/RuleError.test.js +25 -0
  81. package/dist/cjs/Graph/Rules/Edge/AlignNodes.d.ts +7 -0
  82. package/dist/cjs/Graph/Rules/Edge/AlignNodes.js +39 -0
  83. package/dist/cjs/Graph/Rules/Edge/AlignNodes.test.d.ts +1 -0
  84. package/dist/cjs/Graph/Rules/Edge/AlignNodes.test.js +194 -0
  85. package/dist/cjs/Graph/Rules/Edge/EdgeDirectionSemantic.d.ts +8 -0
  86. package/dist/cjs/Graph/Rules/Edge/EdgeDirectionSemantic.js +78 -0
  87. package/dist/cjs/Graph/Rules/Edge/EdgeDirectionSemantic.test.d.ts +1 -0
  88. package/dist/cjs/Graph/Rules/Edge/EdgeDirectionSemantic.test.js +454 -0
  89. package/dist/cjs/Graph/Rules/Edge/EdgeDotProperties.d.ts +9 -0
  90. package/dist/cjs/Graph/Rules/Edge/EdgeDotProperties.js +50 -0
  91. package/dist/cjs/Graph/Rules/Edge/EdgeDotProperties.test.d.ts +1 -0
  92. package/dist/cjs/Graph/Rules/Edge/EdgeDotProperties.test.js +333 -0
  93. package/dist/cjs/Graph/Rules/Edge/EdgeLegend.d.ts +8 -0
  94. package/dist/cjs/Graph/Rules/Edge/EdgeLegend.js +47 -0
  95. package/dist/cjs/Graph/Rules/Edge/EdgeLegend.test.d.ts +1 -0
  96. package/dist/cjs/Graph/Rules/Edge/EdgeLegend.test.js +186 -0
  97. package/dist/cjs/Graph/Rules/Edge/EdgeReverse.d.ts +6 -0
  98. package/dist/cjs/Graph/Rules/Edge/EdgeReverse.js +30 -0
  99. package/dist/cjs/Graph/Rules/Edge/EdgeReverse.test.d.ts +1 -0
  100. package/dist/cjs/Graph/Rules/Edge/EdgeReverse.test.js +134 -0
  101. package/dist/cjs/Graph/Rules/Edge/EdgeSemanticLegend.d.ts +8 -0
  102. package/dist/cjs/Graph/Rules/Edge/EdgeSemanticLegend.js +72 -0
  103. package/dist/cjs/Graph/Rules/Edge/EdgeSemanticLegend.test.d.ts +1 -0
  104. package/dist/cjs/Graph/Rules/Edge/EdgeSemanticLegend.test.js +511 -0
  105. package/dist/cjs/Graph/Rules/Edge/ExplicitEdge.d.ts +6 -0
  106. package/dist/cjs/Graph/Rules/Edge/ExplicitEdge.js +28 -0
  107. package/dist/cjs/Graph/Rules/Edge/ExplicitEdge.test.d.ts +1 -0
  108. package/dist/cjs/Graph/Rules/Edge/ExplicitEdge.test.js +125 -0
  109. package/dist/cjs/Graph/Rules/Edge/RemoveEdge.d.ts +6 -0
  110. package/dist/cjs/Graph/Rules/Edge/RemoveEdge.js +28 -0
  111. package/dist/cjs/Graph/Rules/Edge/RemoveEdge.test.d.ts +1 -0
  112. package/dist/cjs/Graph/Rules/Edge/RemoveEdge.test.js +135 -0
  113. package/dist/cjs/Graph/Rules/Edge/index.d.ts +8 -0
  114. package/dist/cjs/Graph/Rules/Edge/index.js +24 -0
  115. package/dist/cjs/Graph/Rules/NamedRuleRegistry.d.ts +20 -0
  116. package/dist/cjs/Graph/Rules/NamedRuleRegistry.js +71 -0
  117. package/dist/cjs/Graph/Rules/NamedRuleRegistry.test.d.ts +1 -0
  118. package/dist/cjs/Graph/Rules/NamedRuleRegistry.test.js +243 -0
  119. package/dist/cjs/Graph/Rules/NamedRuleSetRegistry.d.ts +19 -0
  120. package/dist/cjs/Graph/Rules/NamedRuleSetRegistry.js +62 -0
  121. package/dist/cjs/Graph/Rules/NamedRuleSetRegistry.test.d.ts +1 -0
  122. package/dist/cjs/Graph/Rules/NamedRuleSetRegistry.test.js +80 -0
  123. package/dist/cjs/Graph/Rules/Node/ConvertNodeToEdge.d.ts +6 -0
  124. package/dist/cjs/Graph/Rules/Node/ConvertNodeToEdge.js +32 -0
  125. package/dist/cjs/Graph/Rules/Node/ConvertNodeToEdge.test.d.ts +1 -0
  126. package/dist/cjs/Graph/Rules/Node/ConvertNodeToEdge.test.js +152 -0
  127. package/dist/cjs/Graph/Rules/Node/NodeDotProperties.d.ts +9 -0
  128. package/dist/cjs/Graph/Rules/Node/NodeDotProperties.js +43 -0
  129. package/dist/cjs/Graph/Rules/Node/NodeDotProperties.test.d.ts +1 -0
  130. package/dist/cjs/Graph/Rules/Node/NodeDotProperties.test.js +226 -0
  131. package/dist/cjs/Graph/Rules/Node/NodeProperties.d.ts +12 -0
  132. package/dist/cjs/Graph/Rules/Node/NodeProperties.js +81 -0
  133. package/dist/cjs/Graph/Rules/Node/NodeProperties.test.d.ts +1 -0
  134. package/dist/cjs/Graph/Rules/Node/NodeProperties.test.js +371 -0
  135. package/dist/cjs/Graph/Rules/Node/RemoveLeafChain.d.ts +12 -0
  136. package/dist/cjs/Graph/Rules/Node/RemoveLeafChain.js +82 -0
  137. package/dist/cjs/Graph/Rules/Node/RemoveLeafChain.test.d.ts +1 -0
  138. package/dist/cjs/Graph/Rules/Node/RemoveLeafChain.test.js +399 -0
  139. package/dist/cjs/Graph/Rules/Node/RemoveNode.d.ts +6 -0
  140. package/dist/cjs/Graph/Rules/Node/RemoveNode.js +14 -0
  141. package/dist/cjs/Graph/Rules/Node/RemoveNode.test.d.ts +1 -0
  142. package/dist/cjs/Graph/Rules/Node/RemoveNode.test.js +33 -0
  143. package/dist/cjs/Graph/Rules/Node/RemoveNodeAndReconnectEdges.d.ts +6 -0
  144. package/dist/cjs/Graph/Rules/Node/RemoveNodeAndReconnectEdges.js +38 -0
  145. package/dist/cjs/Graph/Rules/Node/RemoveNodeAndReconnectEdges.test.d.ts +1 -0
  146. package/dist/cjs/Graph/Rules/Node/RemoveNodeAndReconnectEdges.test.js +113 -0
  147. package/dist/cjs/Graph/Rules/Node/index.d.ts +6 -0
  148. package/dist/cjs/Graph/Rules/Node/index.js +22 -0
  149. package/dist/cjs/Graph/Rules/Rule.d.ts +40 -0
  150. package/dist/cjs/Graph/Rules/Rule.js +91 -0
  151. package/dist/cjs/Graph/Rules/Rule.test.d.ts +1 -0
  152. package/dist/cjs/Graph/Rules/Rule.test.js +127 -0
  153. package/dist/cjs/Graph/Rules/RuleConfig.d.ts +20 -0
  154. package/dist/cjs/Graph/Rules/RuleConfig.js +2 -0
  155. package/dist/cjs/Graph/Rules/RulePlan.d.ts +27 -0
  156. package/dist/cjs/Graph/Rules/RulePlan.js +28 -0
  157. package/dist/cjs/Graph/Rules/RuleSet.d.ts +25 -0
  158. package/dist/cjs/Graph/Rules/RuleSet.js +89 -0
  159. package/dist/cjs/Graph/Rules/RuleSet.test.d.ts +1 -0
  160. package/dist/cjs/Graph/Rules/RuleSet.test.js +222 -0
  161. package/dist/cjs/Graph/Rules/index.d.ts +8 -0
  162. package/dist/cjs/Graph/Rules/index.js +24 -0
  163. package/dist/cjs/Graph/Rules/registerAll.d.ts +14 -0
  164. package/dist/cjs/Graph/Rules/registerAll.js +16 -0
  165. package/dist/cjs/Graph/Serialization/Registry.d.ts +5 -0
  166. package/dist/cjs/Graph/Serialization/Registry.js +2 -0
  167. package/dist/cjs/Graph/Serialization/index.d.ts +1 -0
  168. package/dist/cjs/Graph/Serialization/index.js +17 -0
  169. package/dist/cjs/Graph/TgGraph.d.ts +82 -0
  170. package/dist/cjs/Graph/TgGraph.js +55 -0
  171. package/dist/cjs/Graph/TgGraph.test.d.ts +1 -0
  172. package/dist/cjs/Graph/TgGraph.test.js +61 -0
  173. package/dist/cjs/Graph/index.d.ts +15 -0
  174. package/dist/cjs/Graph/index.js +31 -0
  175. package/dist/cjs/Output/ArtifactTransformer/DotCliArtifactTransformer.d.ts +25 -0
  176. package/dist/cjs/Output/ArtifactTransformer/DotCliArtifactTransformer.js +86 -0
  177. package/dist/cjs/Output/ArtifactTransformer/DotCliArtifactTransformer.test.d.ts +1 -0
  178. package/dist/cjs/Output/ArtifactTransformer/DotCliArtifactTransformer.test.js +200 -0
  179. package/dist/cjs/Output/ArtifactTransformer/index.d.ts +1 -0
  180. package/dist/cjs/Output/ArtifactTransformer/index.js +17 -0
  181. package/dist/cjs/Output/ArtifactTransformer.d.ts +7 -0
  182. package/dist/cjs/Output/ArtifactTransformer.js +2 -0
  183. package/dist/cjs/Output/ArtifactTransformerFactory/DefaultArtifactTransformerFactory.d.ts +17 -0
  184. package/dist/cjs/Output/ArtifactTransformerFactory/DefaultArtifactTransformerFactory.js +78 -0
  185. package/dist/cjs/Output/ArtifactTransformerFactory/DefaultArtifactTransformerFactory.test.d.ts +1 -0
  186. package/dist/cjs/Output/ArtifactTransformerFactory/DefaultArtifactTransformerFactory.test.js +80 -0
  187. package/dist/cjs/Output/ArtifactTransformerFactory/OclifTransformerFlagParser.d.ts +9 -0
  188. package/dist/cjs/Output/ArtifactTransformerFactory/OclifTransformerFlagParser.js +80 -0
  189. package/dist/cjs/Output/ArtifactTransformerFactory/OclifTransformerFlagParser.test.d.ts +1 -0
  190. package/dist/cjs/Output/ArtifactTransformerFactory/OclifTransformerFlagParser.test.js +156 -0
  191. package/dist/cjs/Output/ArtifactTransformerFactory/index.d.ts +2 -0
  192. package/dist/cjs/Output/ArtifactTransformerFactory/index.js +18 -0
  193. package/dist/cjs/Output/ArtifactTransformerFactory.d.ts +10 -0
  194. package/dist/cjs/Output/ArtifactTransformerFactory.js +2 -0
  195. package/dist/cjs/Output/ArtifactWriter/FileArtifactWriter.d.ts +9 -0
  196. package/dist/cjs/Output/ArtifactWriter/FileArtifactWriter.js +25 -0
  197. package/dist/cjs/Output/ArtifactWriter/FileArtifactWriter.test.d.ts +1 -0
  198. package/dist/cjs/Output/ArtifactWriter/FileArtifactWriter.test.js +77 -0
  199. package/dist/cjs/Output/ArtifactWriter/StdoutArtifactWriter.d.ts +6 -0
  200. package/dist/cjs/Output/ArtifactWriter/StdoutArtifactWriter.js +17 -0
  201. package/dist/cjs/Output/ArtifactWriter/StdoutArtifactWriter.test.d.ts +1 -0
  202. package/dist/cjs/Output/ArtifactWriter/StdoutArtifactWriter.test.js +83 -0
  203. package/dist/cjs/Output/ArtifactWriter/index.d.ts +2 -0
  204. package/dist/cjs/Output/ArtifactWriter/index.js +18 -0
  205. package/dist/cjs/Output/ArtifactWriter.d.ts +8 -0
  206. package/dist/cjs/Output/ArtifactWriter.js +2 -0
  207. package/dist/cjs/Output/RenderPipeline.d.ts +12 -0
  208. package/dist/cjs/Output/RenderPipeline.js +17 -0
  209. package/dist/cjs/Output/RenderPipeline.test.d.ts +1 -0
  210. package/dist/cjs/Output/RenderPipeline.test.js +80 -0
  211. package/dist/cjs/Output/index.d.ts +7 -0
  212. package/dist/cjs/Output/index.js +23 -0
  213. package/dist/cjs/Runtime/RuntimeCatalog.d.ts +25 -0
  214. package/dist/cjs/Runtime/RuntimeCatalog.js +51 -0
  215. package/dist/cjs/Runtime/RuntimeCatalog.test.d.ts +1 -0
  216. package/dist/cjs/Runtime/RuntimeCatalog.test.js +165 -0
  217. package/dist/cjs/Runtime/RuntimeCatalogBuilder/RuntimeCatalogFromConfigBuilder.d.ts +5 -0
  218. package/dist/cjs/Runtime/RuntimeCatalogBuilder/RuntimeCatalogFromConfigBuilder.js +10 -0
  219. package/dist/cjs/Runtime/RuntimeCatalogBuilder/RuntimeCatalogFromConfigBuilder.test.d.ts +1 -0
  220. package/dist/cjs/Runtime/RuntimeCatalogBuilder/RuntimeCatalogFromConfigBuilder.test.js +31 -0
  221. package/dist/cjs/Runtime/RuntimeCatalogBuilder/index.d.ts +1 -0
  222. package/dist/cjs/Runtime/RuntimeCatalogBuilder/index.js +17 -0
  223. package/dist/cjs/Runtime/RuntimeCatalogBuilder.d.ts +11 -0
  224. package/dist/cjs/Runtime/RuntimeCatalogBuilder.js +2 -0
  225. package/dist/cjs/Runtime/RuntimeCatalogBuilder.test.d.ts +1 -0
  226. package/dist/cjs/Runtime/RuntimeCatalogBuilder.test.js +27 -0
  227. package/dist/cjs/Runtime/RuntimeCatalogLoader.d.ts +37 -0
  228. package/dist/cjs/Runtime/RuntimeCatalogLoader.js +106 -0
  229. package/dist/cjs/Runtime/RuntimeCatalogLoader.test.d.ts +1 -0
  230. package/dist/cjs/Runtime/RuntimeCatalogLoader.test.js +454 -0
  231. package/dist/cjs/Runtime/RuntimeConfigLoader.d.ts +33 -0
  232. package/dist/cjs/Runtime/RuntimeConfigLoader.js +93 -0
  233. package/dist/cjs/Runtime/RuntimeConfigLoader.test.d.ts +1 -0
  234. package/dist/cjs/Runtime/RuntimeConfigLoader.test.js +345 -0
  235. package/dist/cjs/Runtime/RuntimeConfigParser/JsonRuntimeConfigParser.d.ts +5 -0
  236. package/dist/cjs/Runtime/RuntimeConfigParser/JsonRuntimeConfigParser.js +16 -0
  237. package/dist/cjs/Runtime/RuntimeConfigParser/JsonRuntimeConfigParser.test.d.ts +1 -0
  238. package/dist/cjs/Runtime/RuntimeConfigParser/JsonRuntimeConfigParser.test.js +22 -0
  239. package/dist/cjs/Runtime/RuntimeConfigParser/YamlRuntimeConfigParser.d.ts +5 -0
  240. package/dist/cjs/Runtime/RuntimeConfigParser/YamlRuntimeConfigParser.js +20 -0
  241. package/dist/cjs/Runtime/RuntimeConfigParser/YamlRuntimeConfigParser.test.d.ts +1 -0
  242. package/dist/cjs/Runtime/RuntimeConfigParser/YamlRuntimeConfigParser.test.js +31 -0
  243. package/dist/cjs/Runtime/RuntimeConfigParser/index.d.ts +2 -0
  244. package/dist/cjs/Runtime/RuntimeConfigParser/index.js +18 -0
  245. package/dist/cjs/Runtime/RuntimeConfigParser.d.ts +5 -0
  246. package/dist/cjs/Runtime/RuntimeConfigParser.js +6 -0
  247. package/dist/cjs/Runtime/RuntimeConfigParser.test.d.ts +1 -0
  248. package/dist/cjs/Runtime/RuntimeConfigParser.test.js +8 -0
  249. package/dist/cjs/Runtime/RuntimeConfigParserRegistry.d.ts +9 -0
  250. package/dist/cjs/Runtime/RuntimeConfigParserRegistry.js +36 -0
  251. package/dist/cjs/Runtime/RuntimeConfigParserRegistry.test.d.ts +1 -0
  252. package/dist/cjs/Runtime/RuntimeConfigParserRegistry.test.js +53 -0
  253. package/dist/cjs/Runtime/RuntimeConfigSource/FileRuntimeConfigSource.d.ts +7 -0
  254. package/dist/cjs/Runtime/RuntimeConfigSource/FileRuntimeConfigSource.js +21 -0
  255. package/dist/cjs/Runtime/RuntimeConfigSource/FileRuntimeConfigSource.test.d.ts +1 -0
  256. package/dist/cjs/Runtime/RuntimeConfigSource/FileRuntimeConfigSource.test.js +40 -0
  257. package/dist/cjs/Runtime/RuntimeConfigSource/InMemoryRuntimeConfigSource.d.ts +8 -0
  258. package/dist/cjs/Runtime/RuntimeConfigSource/InMemoryRuntimeConfigSource.js +21 -0
  259. package/dist/cjs/Runtime/RuntimeConfigSource/InMemoryRuntimeConfigSource.test.d.ts +1 -0
  260. package/dist/cjs/Runtime/RuntimeConfigSource/InMemoryRuntimeConfigSource.test.js +21 -0
  261. package/dist/cjs/Runtime/RuntimeConfigSource/YamlRuntimeConfigSource.d.ts +6 -0
  262. package/dist/cjs/Runtime/RuntimeConfigSource/YamlRuntimeConfigSource.js +17 -0
  263. package/dist/cjs/Runtime/RuntimeConfigSource/YamlRuntimeConfigSource.test.d.ts +1 -0
  264. package/dist/cjs/Runtime/RuntimeConfigSource/YamlRuntimeConfigSource.test.js +37 -0
  265. package/dist/cjs/Runtime/RuntimeConfigSource/index.d.ts +3 -0
  266. package/dist/cjs/Runtime/RuntimeConfigSource/index.js +19 -0
  267. package/dist/cjs/Runtime/RuntimeConfigSource.d.ts +10 -0
  268. package/dist/cjs/Runtime/RuntimeConfigSource.js +20 -0
  269. package/dist/cjs/Runtime/RuntimeConfigSource.test.d.ts +1 -0
  270. package/dist/cjs/Runtime/RuntimeConfigSource.test.js +23 -0
  271. package/dist/cjs/Runtime/RuntimeConfigValidator/ZodRuntimeConfigValidator.d.ts +5 -0
  272. package/dist/cjs/Runtime/RuntimeConfigValidator/ZodRuntimeConfigValidator.js +77 -0
  273. package/dist/cjs/Runtime/RuntimeConfigValidator/ZodRuntimeConfigValidator.test.d.ts +1 -0
  274. package/dist/cjs/Runtime/RuntimeConfigValidator/ZodRuntimeConfigValidator.test.js +62 -0
  275. package/dist/cjs/Runtime/RuntimeConfigValidator/index.d.ts +1 -0
  276. package/dist/cjs/Runtime/RuntimeConfigValidator/index.js +17 -0
  277. package/dist/cjs/Runtime/RuntimeConfigValidator.d.ts +4 -0
  278. package/dist/cjs/Runtime/RuntimeConfigValidator.js +2 -0
  279. package/dist/cjs/Runtime/RuntimeConfigValidator.test.d.ts +1 -0
  280. package/dist/cjs/Runtime/RuntimeConfigValidator.test.js +40 -0
  281. package/dist/cjs/Runtime/RuntimeProvider.d.ts +5 -0
  282. package/dist/cjs/Runtime/RuntimeProvider.js +2 -0
  283. package/dist/cjs/Runtime/RuntimeProvider.test.d.ts +1 -0
  284. package/dist/cjs/Runtime/RuntimeProvider.test.js +12 -0
  285. package/dist/cjs/Runtime/RuntimeProviderLoader/ModuleRuntimeProviderLoader.d.ts +14 -0
  286. package/dist/cjs/Runtime/RuntimeProviderLoader/ModuleRuntimeProviderLoader.js +87 -0
  287. package/dist/cjs/Runtime/RuntimeProviderLoader/ModuleRuntimeProviderLoader.test.d.ts +1 -0
  288. package/dist/cjs/Runtime/RuntimeProviderLoader/ModuleRuntimeProviderLoader.test.js +148 -0
  289. package/dist/cjs/Runtime/RuntimeProviderLoader/index.d.ts +1 -0
  290. package/dist/cjs/Runtime/RuntimeProviderLoader/index.js +17 -0
  291. package/dist/cjs/Runtime/RuntimeProviderLoader.d.ts +8 -0
  292. package/dist/cjs/Runtime/RuntimeProviderLoader.js +2 -0
  293. package/dist/cjs/Runtime/RuntimeProviderLoader.test.d.ts +1 -0
  294. package/dist/cjs/Runtime/RuntimeProviderLoader.test.js +25 -0
  295. package/dist/cjs/Runtime/index.d.ts +15 -0
  296. package/dist/cjs/Runtime/index.js +31 -0
  297. package/dist/cjs/index.d.ts +3 -0
  298. package/dist/cjs/index.js +19 -0
  299. package/dist/cjs/package.json +1 -0
  300. package/dist/esm/Graph/Adapter.d.ts +8 -0
  301. package/dist/esm/Graph/Adapter.js +4 -0
  302. package/dist/esm/Graph/Adapters/DotAdapter.d.ts +17 -0
  303. package/dist/esm/Graph/Adapters/DotAdapter.js +27 -0
  304. package/dist/esm/Graph/Adapters/DotAdapter.test.d.ts +1 -0
  305. package/dist/esm/Graph/Adapters/DotAdapter.test.js +43 -0
  306. package/dist/esm/Graph/Adapters/GraphologyAdapter.d.ts +36 -0
  307. package/dist/esm/Graph/Adapters/GraphologyAdapter.js +269 -0
  308. package/dist/esm/Graph/Adapters/GraphologyAdapter.test.d.ts +1 -0
  309. package/dist/esm/Graph/Adapters/GraphologyAdapter.test.js +559 -0
  310. package/dist/esm/Graph/Adapters/index.d.ts +2 -0
  311. package/dist/esm/Graph/Adapters/index.js +2 -0
  312. package/dist/esm/Graph/GraphPlugin.d.ts +53 -0
  313. package/dist/esm/Graph/GraphPlugin.js +217 -0
  314. package/dist/esm/Graph/GraphPlugin.test.d.ts +1 -0
  315. package/dist/esm/Graph/GraphPlugin.test.js +829 -0
  316. package/dist/esm/Graph/GraphResolver.d.ts +21 -0
  317. package/dist/esm/Graph/GraphResolver.js +76 -0
  318. package/dist/esm/Graph/GraphResolver.test.d.ts +1 -0
  319. package/dist/esm/Graph/GraphResolver.test.js +271 -0
  320. package/dist/esm/Graph/Importer.d.ts +7 -0
  321. package/dist/esm/Graph/Importer.js +1 -0
  322. package/dist/esm/Graph/Importers/TerraformDotImporter.d.ts +12 -0
  323. package/dist/esm/Graph/Importers/TerraformDotImporter.js +238 -0
  324. package/dist/esm/Graph/Importers/TerraformDotImporter.test.d.ts +1 -0
  325. package/dist/esm/Graph/Importers/TerraformDotImporter.test.js +338 -0
  326. package/dist/esm/Graph/Importers/index.d.ts +1 -0
  327. package/dist/esm/Graph/Importers/index.js +1 -0
  328. package/dist/esm/Graph/Operations/Matchers/NodeMatchFn.d.ts +3 -0
  329. package/dist/esm/Graph/Operations/Matchers/NodeMatchFn.js +1 -0
  330. package/dist/esm/Graph/Operations/Matchers/NodeQuery/NodeQuery.d.ts +21 -0
  331. package/dist/esm/Graph/Operations/Matchers/NodeQuery/NodeQuery.js +139 -0
  332. package/dist/esm/Graph/Operations/Matchers/NodeQuery/NodeQuery.test.d.ts +1 -0
  333. package/dist/esm/Graph/Operations/Matchers/NodeQuery/NodeQuery.test.js +306 -0
  334. package/dist/esm/Graph/Operations/Matchers/NodeQuery/QuerySchema.d.ts +155 -0
  335. package/dist/esm/Graph/Operations/Matchers/NodeQuery/QuerySchema.js +64 -0
  336. package/dist/esm/Graph/Operations/Matchers/NodeQuery/QuerySchema.test.d.ts +1 -0
  337. package/dist/esm/Graph/Operations/Matchers/NodeQuery/QuerySchema.test.js +49 -0
  338. package/dist/esm/Graph/Operations/Matchers/NodeQuery/index.d.ts +2 -0
  339. package/dist/esm/Graph/Operations/Matchers/NodeQuery/index.js +2 -0
  340. package/dist/esm/Graph/Operations/Matchers/index.d.ts +2 -0
  341. package/dist/esm/Graph/Operations/Matchers/index.js +2 -0
  342. package/dist/esm/Graph/Operations/Operations.d.ts +21 -0
  343. package/dist/esm/Graph/Operations/Operations.js +1 -0
  344. package/dist/esm/Graph/Operations/index.d.ts +2 -0
  345. package/dist/esm/Graph/Operations/index.js +2 -0
  346. package/dist/esm/Graph/Profile.d.ts +55 -0
  347. package/dist/esm/Graph/Profile.js +219 -0
  348. package/dist/esm/Graph/Profile.test.d.ts +1 -0
  349. package/dist/esm/Graph/Profile.test.js +839 -0
  350. package/dist/esm/Graph/ProfileRegistry.d.ts +18 -0
  351. package/dist/esm/Graph/ProfileRegistry.js +57 -0
  352. package/dist/esm/Graph/ProfileRegistry.test.d.ts +1 -0
  353. package/dist/esm/Graph/ProfileRegistry.test.js +96 -0
  354. package/dist/esm/Graph/Renderer.d.ts +9 -0
  355. package/dist/esm/Graph/Renderer.js +1 -0
  356. package/dist/esm/Graph/Renderers/DotRenderer.d.ts +27 -0
  357. package/dist/esm/Graph/Renderers/DotRenderer.js +179 -0
  358. package/dist/esm/Graph/Renderers/DotRenderer.test.d.ts +1 -0
  359. package/dist/esm/Graph/Renderers/DotRenderer.test.js +1141 -0
  360. package/dist/esm/Graph/Renderers/JsonRenderer.d.ts +5 -0
  361. package/dist/esm/Graph/Renderers/JsonRenderer.js +9 -0
  362. package/dist/esm/Graph/Renderers/JsonRenderer.test.d.ts +1 -0
  363. package/dist/esm/Graph/Renderers/JsonRenderer.test.js +27 -0
  364. package/dist/esm/Graph/Renderers/RendererRegistry.d.ts +15 -0
  365. package/dist/esm/Graph/Renderers/RendererRegistry.js +29 -0
  366. package/dist/esm/Graph/Renderers/RendererRegistry.test.d.ts +1 -0
  367. package/dist/esm/Graph/Renderers/RendererRegistry.test.js +37 -0
  368. package/dist/esm/Graph/Renderers/TgNodeLabel.d.ts +11 -0
  369. package/dist/esm/Graph/Renderers/TgNodeLabel.js +39 -0
  370. package/dist/esm/Graph/Renderers/TgNodeLabel.test.d.ts +1 -0
  371. package/dist/esm/Graph/Renderers/TgNodeLabel.test.js +74 -0
  372. package/dist/esm/Graph/Renderers/index.d.ts +4 -0
  373. package/dist/esm/Graph/Renderers/index.js +4 -0
  374. package/dist/esm/Graph/RuleError.d.ts +12 -0
  375. package/dist/esm/Graph/RuleError.js +14 -0
  376. package/dist/esm/Graph/RuleError.test.d.ts +1 -0
  377. package/dist/esm/Graph/RuleError.test.js +23 -0
  378. package/dist/esm/Graph/Rules/Edge/AlignNodes.d.ts +7 -0
  379. package/dist/esm/Graph/Rules/Edge/AlignNodes.js +35 -0
  380. package/dist/esm/Graph/Rules/Edge/AlignNodes.test.d.ts +1 -0
  381. package/dist/esm/Graph/Rules/Edge/AlignNodes.test.js +192 -0
  382. package/dist/esm/Graph/Rules/Edge/EdgeDirectionSemantic.d.ts +8 -0
  383. package/dist/esm/Graph/Rules/Edge/EdgeDirectionSemantic.js +74 -0
  384. package/dist/esm/Graph/Rules/Edge/EdgeDirectionSemantic.test.d.ts +1 -0
  385. package/dist/esm/Graph/Rules/Edge/EdgeDirectionSemantic.test.js +452 -0
  386. package/dist/esm/Graph/Rules/Edge/EdgeDotProperties.d.ts +9 -0
  387. package/dist/esm/Graph/Rules/Edge/EdgeDotProperties.js +46 -0
  388. package/dist/esm/Graph/Rules/Edge/EdgeDotProperties.test.d.ts +1 -0
  389. package/dist/esm/Graph/Rules/Edge/EdgeDotProperties.test.js +331 -0
  390. package/dist/esm/Graph/Rules/Edge/EdgeLegend.d.ts +8 -0
  391. package/dist/esm/Graph/Rules/Edge/EdgeLegend.js +43 -0
  392. package/dist/esm/Graph/Rules/Edge/EdgeLegend.test.d.ts +1 -0
  393. package/dist/esm/Graph/Rules/Edge/EdgeLegend.test.js +184 -0
  394. package/dist/esm/Graph/Rules/Edge/EdgeReverse.d.ts +6 -0
  395. package/dist/esm/Graph/Rules/Edge/EdgeReverse.js +26 -0
  396. package/dist/esm/Graph/Rules/Edge/EdgeReverse.test.d.ts +1 -0
  397. package/dist/esm/Graph/Rules/Edge/EdgeReverse.test.js +132 -0
  398. package/dist/esm/Graph/Rules/Edge/EdgeSemanticLegend.d.ts +8 -0
  399. package/dist/esm/Graph/Rules/Edge/EdgeSemanticLegend.js +68 -0
  400. package/dist/esm/Graph/Rules/Edge/EdgeSemanticLegend.test.d.ts +1 -0
  401. package/dist/esm/Graph/Rules/Edge/EdgeSemanticLegend.test.js +509 -0
  402. package/dist/esm/Graph/Rules/Edge/ExplicitEdge.d.ts +6 -0
  403. package/dist/esm/Graph/Rules/Edge/ExplicitEdge.js +24 -0
  404. package/dist/esm/Graph/Rules/Edge/ExplicitEdge.test.d.ts +1 -0
  405. package/dist/esm/Graph/Rules/Edge/ExplicitEdge.test.js +123 -0
  406. package/dist/esm/Graph/Rules/Edge/RemoveEdge.d.ts +6 -0
  407. package/dist/esm/Graph/Rules/Edge/RemoveEdge.js +24 -0
  408. package/dist/esm/Graph/Rules/Edge/RemoveEdge.test.d.ts +1 -0
  409. package/dist/esm/Graph/Rules/Edge/RemoveEdge.test.js +133 -0
  410. package/dist/esm/Graph/Rules/Edge/index.d.ts +8 -0
  411. package/dist/esm/Graph/Rules/Edge/index.js +8 -0
  412. package/dist/esm/Graph/Rules/NamedRuleRegistry.d.ts +20 -0
  413. package/dist/esm/Graph/Rules/NamedRuleRegistry.js +67 -0
  414. package/dist/esm/Graph/Rules/NamedRuleRegistry.test.d.ts +1 -0
  415. package/dist/esm/Graph/Rules/NamedRuleRegistry.test.js +241 -0
  416. package/dist/esm/Graph/Rules/NamedRuleSetRegistry.d.ts +19 -0
  417. package/dist/esm/Graph/Rules/NamedRuleSetRegistry.js +58 -0
  418. package/dist/esm/Graph/Rules/NamedRuleSetRegistry.test.d.ts +1 -0
  419. package/dist/esm/Graph/Rules/NamedRuleSetRegistry.test.js +78 -0
  420. package/dist/esm/Graph/Rules/Node/ConvertNodeToEdge.d.ts +6 -0
  421. package/dist/esm/Graph/Rules/Node/ConvertNodeToEdge.js +28 -0
  422. package/dist/esm/Graph/Rules/Node/ConvertNodeToEdge.test.d.ts +1 -0
  423. package/dist/esm/Graph/Rules/Node/ConvertNodeToEdge.test.js +150 -0
  424. package/dist/esm/Graph/Rules/Node/NodeDotProperties.d.ts +9 -0
  425. package/dist/esm/Graph/Rules/Node/NodeDotProperties.js +39 -0
  426. package/dist/esm/Graph/Rules/Node/NodeDotProperties.test.d.ts +1 -0
  427. package/dist/esm/Graph/Rules/Node/NodeDotProperties.test.js +224 -0
  428. package/dist/esm/Graph/Rules/Node/NodeProperties.d.ts +12 -0
  429. package/dist/esm/Graph/Rules/Node/NodeProperties.js +77 -0
  430. package/dist/esm/Graph/Rules/Node/NodeProperties.test.d.ts +1 -0
  431. package/dist/esm/Graph/Rules/Node/NodeProperties.test.js +369 -0
  432. package/dist/esm/Graph/Rules/Node/RemoveLeafChain.d.ts +12 -0
  433. package/dist/esm/Graph/Rules/Node/RemoveLeafChain.js +78 -0
  434. package/dist/esm/Graph/Rules/Node/RemoveLeafChain.test.d.ts +1 -0
  435. package/dist/esm/Graph/Rules/Node/RemoveLeafChain.test.js +397 -0
  436. package/dist/esm/Graph/Rules/Node/RemoveNode.d.ts +6 -0
  437. package/dist/esm/Graph/Rules/Node/RemoveNode.js +10 -0
  438. package/dist/esm/Graph/Rules/Node/RemoveNode.test.d.ts +1 -0
  439. package/dist/esm/Graph/Rules/Node/RemoveNode.test.js +31 -0
  440. package/dist/esm/Graph/Rules/Node/RemoveNodeAndReconnectEdges.d.ts +6 -0
  441. package/dist/esm/Graph/Rules/Node/RemoveNodeAndReconnectEdges.js +34 -0
  442. package/dist/esm/Graph/Rules/Node/RemoveNodeAndReconnectEdges.test.d.ts +1 -0
  443. package/dist/esm/Graph/Rules/Node/RemoveNodeAndReconnectEdges.test.js +111 -0
  444. package/dist/esm/Graph/Rules/Node/index.d.ts +6 -0
  445. package/dist/esm/Graph/Rules/Node/index.js +6 -0
  446. package/dist/esm/Graph/Rules/Rule.d.ts +40 -0
  447. package/dist/esm/Graph/Rules/Rule.js +85 -0
  448. package/dist/esm/Graph/Rules/Rule.test.d.ts +1 -0
  449. package/dist/esm/Graph/Rules/Rule.test.js +125 -0
  450. package/dist/esm/Graph/Rules/RuleConfig.d.ts +20 -0
  451. package/dist/esm/Graph/Rules/RuleConfig.js +1 -0
  452. package/dist/esm/Graph/Rules/RulePlan.d.ts +27 -0
  453. package/dist/esm/Graph/Rules/RulePlan.js +22 -0
  454. package/dist/esm/Graph/Rules/RuleSet.d.ts +25 -0
  455. package/dist/esm/Graph/Rules/RuleSet.js +85 -0
  456. package/dist/esm/Graph/Rules/RuleSet.test.d.ts +1 -0
  457. package/dist/esm/Graph/Rules/RuleSet.test.js +220 -0
  458. package/dist/esm/Graph/Rules/index.d.ts +8 -0
  459. package/dist/esm/Graph/Rules/index.js +8 -0
  460. package/dist/esm/Graph/Rules/registerAll.d.ts +14 -0
  461. package/dist/esm/Graph/Rules/registerAll.js +14 -0
  462. package/dist/esm/Graph/Serialization/Registry.d.ts +5 -0
  463. package/dist/esm/Graph/Serialization/Registry.js +1 -0
  464. package/dist/esm/Graph/Serialization/index.d.ts +1 -0
  465. package/dist/esm/Graph/Serialization/index.js +1 -0
  466. package/dist/esm/Graph/TgGraph.d.ts +82 -0
  467. package/dist/esm/Graph/TgGraph.js +46 -0
  468. package/dist/esm/Graph/TgGraph.test.d.ts +1 -0
  469. package/dist/esm/Graph/TgGraph.test.js +59 -0
  470. package/dist/esm/Graph/index.d.ts +15 -0
  471. package/dist/esm/Graph/index.js +15 -0
  472. package/dist/esm/Output/ArtifactTransformer/DotCliArtifactTransformer.d.ts +25 -0
  473. package/dist/esm/Output/ArtifactTransformer/DotCliArtifactTransformer.js +82 -0
  474. package/dist/esm/Output/ArtifactTransformer/DotCliArtifactTransformer.test.d.ts +1 -0
  475. package/dist/esm/Output/ArtifactTransformer/DotCliArtifactTransformer.test.js +198 -0
  476. package/dist/esm/Output/ArtifactTransformer/index.d.ts +1 -0
  477. package/dist/esm/Output/ArtifactTransformer/index.js +1 -0
  478. package/dist/esm/Output/ArtifactTransformer.d.ts +7 -0
  479. package/dist/esm/Output/ArtifactTransformer.js +1 -0
  480. package/dist/esm/Output/ArtifactTransformerFactory/DefaultArtifactTransformerFactory.d.ts +17 -0
  481. package/dist/esm/Output/ArtifactTransformerFactory/DefaultArtifactTransformerFactory.js +74 -0
  482. package/dist/esm/Output/ArtifactTransformerFactory/DefaultArtifactTransformerFactory.test.d.ts +1 -0
  483. package/dist/esm/Output/ArtifactTransformerFactory/DefaultArtifactTransformerFactory.test.js +78 -0
  484. package/dist/esm/Output/ArtifactTransformerFactory/OclifTransformerFlagParser.d.ts +9 -0
  485. package/dist/esm/Output/ArtifactTransformerFactory/OclifTransformerFlagParser.js +76 -0
  486. package/dist/esm/Output/ArtifactTransformerFactory/OclifTransformerFlagParser.test.d.ts +1 -0
  487. package/dist/esm/Output/ArtifactTransformerFactory/OclifTransformerFlagParser.test.js +154 -0
  488. package/dist/esm/Output/ArtifactTransformerFactory/index.d.ts +2 -0
  489. package/dist/esm/Output/ArtifactTransformerFactory/index.js +2 -0
  490. package/dist/esm/Output/ArtifactTransformerFactory.d.ts +10 -0
  491. package/dist/esm/Output/ArtifactTransformerFactory.js +1 -0
  492. package/dist/esm/Output/ArtifactWriter/FileArtifactWriter.d.ts +9 -0
  493. package/dist/esm/Output/ArtifactWriter/FileArtifactWriter.js +21 -0
  494. package/dist/esm/Output/ArtifactWriter/FileArtifactWriter.test.d.ts +1 -0
  495. package/dist/esm/Output/ArtifactWriter/FileArtifactWriter.test.js +75 -0
  496. package/dist/esm/Output/ArtifactWriter/StdoutArtifactWriter.d.ts +6 -0
  497. package/dist/esm/Output/ArtifactWriter/StdoutArtifactWriter.js +13 -0
  498. package/dist/esm/Output/ArtifactWriter/StdoutArtifactWriter.test.d.ts +1 -0
  499. package/dist/esm/Output/ArtifactWriter/StdoutArtifactWriter.test.js +81 -0
  500. package/dist/esm/Output/ArtifactWriter/index.d.ts +2 -0
  501. package/dist/esm/Output/ArtifactWriter/index.js +2 -0
  502. package/dist/esm/Output/ArtifactWriter.d.ts +8 -0
  503. package/dist/esm/Output/ArtifactWriter.js +1 -0
  504. package/dist/esm/Output/RenderPipeline.d.ts +12 -0
  505. package/dist/esm/Output/RenderPipeline.js +13 -0
  506. package/dist/esm/Output/RenderPipeline.test.d.ts +1 -0
  507. package/dist/esm/Output/RenderPipeline.test.js +78 -0
  508. package/dist/esm/Output/index.d.ts +7 -0
  509. package/dist/esm/Output/index.js +7 -0
  510. package/dist/esm/Runtime/RuntimeCatalog.d.ts +25 -0
  511. package/dist/esm/Runtime/RuntimeCatalog.js +47 -0
  512. package/dist/esm/Runtime/RuntimeCatalog.test.d.ts +1 -0
  513. package/dist/esm/Runtime/RuntimeCatalog.test.js +163 -0
  514. package/dist/esm/Runtime/RuntimeCatalogBuilder/RuntimeCatalogFromConfigBuilder.d.ts +5 -0
  515. package/dist/esm/Runtime/RuntimeCatalogBuilder/RuntimeCatalogFromConfigBuilder.js +6 -0
  516. package/dist/esm/Runtime/RuntimeCatalogBuilder/RuntimeCatalogFromConfigBuilder.test.d.ts +1 -0
  517. package/dist/esm/Runtime/RuntimeCatalogBuilder/RuntimeCatalogFromConfigBuilder.test.js +29 -0
  518. package/dist/esm/Runtime/RuntimeCatalogBuilder/index.d.ts +1 -0
  519. package/dist/esm/Runtime/RuntimeCatalogBuilder/index.js +1 -0
  520. package/dist/esm/Runtime/RuntimeCatalogBuilder.d.ts +11 -0
  521. package/dist/esm/Runtime/RuntimeCatalogBuilder.js +1 -0
  522. package/dist/esm/Runtime/RuntimeCatalogBuilder.test.d.ts +1 -0
  523. package/dist/esm/Runtime/RuntimeCatalogBuilder.test.js +25 -0
  524. package/dist/esm/Runtime/RuntimeCatalogLoader.d.ts +37 -0
  525. package/dist/esm/Runtime/RuntimeCatalogLoader.js +102 -0
  526. package/dist/esm/Runtime/RuntimeCatalogLoader.test.d.ts +1 -0
  527. package/dist/esm/Runtime/RuntimeCatalogLoader.test.js +452 -0
  528. package/dist/esm/Runtime/RuntimeConfigLoader.d.ts +33 -0
  529. package/dist/esm/Runtime/RuntimeConfigLoader.js +89 -0
  530. package/dist/esm/Runtime/RuntimeConfigLoader.test.d.ts +1 -0
  531. package/dist/esm/Runtime/RuntimeConfigLoader.test.js +343 -0
  532. package/dist/esm/Runtime/RuntimeConfigParser/JsonRuntimeConfigParser.d.ts +5 -0
  533. package/dist/esm/Runtime/RuntimeConfigParser/JsonRuntimeConfigParser.js +12 -0
  534. package/dist/esm/Runtime/RuntimeConfigParser/JsonRuntimeConfigParser.test.d.ts +1 -0
  535. package/dist/esm/Runtime/RuntimeConfigParser/JsonRuntimeConfigParser.test.js +20 -0
  536. package/dist/esm/Runtime/RuntimeConfigParser/YamlRuntimeConfigParser.d.ts +5 -0
  537. package/dist/esm/Runtime/RuntimeConfigParser/YamlRuntimeConfigParser.js +16 -0
  538. package/dist/esm/Runtime/RuntimeConfigParser/YamlRuntimeConfigParser.test.d.ts +1 -0
  539. package/dist/esm/Runtime/RuntimeConfigParser/YamlRuntimeConfigParser.test.js +29 -0
  540. package/dist/esm/Runtime/RuntimeConfigParser/index.d.ts +2 -0
  541. package/dist/esm/Runtime/RuntimeConfigParser/index.js +2 -0
  542. package/dist/esm/Runtime/RuntimeConfigParser.d.ts +5 -0
  543. package/dist/esm/Runtime/RuntimeConfigParser.js +2 -0
  544. package/dist/esm/Runtime/RuntimeConfigParser.test.d.ts +1 -0
  545. package/dist/esm/Runtime/RuntimeConfigParser.test.js +6 -0
  546. package/dist/esm/Runtime/RuntimeConfigParserRegistry.d.ts +9 -0
  547. package/dist/esm/Runtime/RuntimeConfigParserRegistry.js +32 -0
  548. package/dist/esm/Runtime/RuntimeConfigParserRegistry.test.d.ts +1 -0
  549. package/dist/esm/Runtime/RuntimeConfigParserRegistry.test.js +51 -0
  550. package/dist/esm/Runtime/RuntimeConfigSource/FileRuntimeConfigSource.d.ts +7 -0
  551. package/dist/esm/Runtime/RuntimeConfigSource/FileRuntimeConfigSource.js +17 -0
  552. package/dist/esm/Runtime/RuntimeConfigSource/FileRuntimeConfigSource.test.d.ts +1 -0
  553. package/dist/esm/Runtime/RuntimeConfigSource/FileRuntimeConfigSource.test.js +38 -0
  554. package/dist/esm/Runtime/RuntimeConfigSource/InMemoryRuntimeConfigSource.d.ts +8 -0
  555. package/dist/esm/Runtime/RuntimeConfigSource/InMemoryRuntimeConfigSource.js +17 -0
  556. package/dist/esm/Runtime/RuntimeConfigSource/InMemoryRuntimeConfigSource.test.d.ts +1 -0
  557. package/dist/esm/Runtime/RuntimeConfigSource/InMemoryRuntimeConfigSource.test.js +19 -0
  558. package/dist/esm/Runtime/RuntimeConfigSource/YamlRuntimeConfigSource.d.ts +6 -0
  559. package/dist/esm/Runtime/RuntimeConfigSource/YamlRuntimeConfigSource.js +13 -0
  560. package/dist/esm/Runtime/RuntimeConfigSource/YamlRuntimeConfigSource.test.d.ts +1 -0
  561. package/dist/esm/Runtime/RuntimeConfigSource/YamlRuntimeConfigSource.test.js +35 -0
  562. package/dist/esm/Runtime/RuntimeConfigSource/index.d.ts +3 -0
  563. package/dist/esm/Runtime/RuntimeConfigSource/index.js +3 -0
  564. package/dist/esm/Runtime/RuntimeConfigSource.d.ts +10 -0
  565. package/dist/esm/Runtime/RuntimeConfigSource.js +15 -0
  566. package/dist/esm/Runtime/RuntimeConfigSource.test.d.ts +1 -0
  567. package/dist/esm/Runtime/RuntimeConfigSource.test.js +21 -0
  568. package/dist/esm/Runtime/RuntimeConfigValidator/ZodRuntimeConfigValidator.d.ts +5 -0
  569. package/dist/esm/Runtime/RuntimeConfigValidator/ZodRuntimeConfigValidator.js +73 -0
  570. package/dist/esm/Runtime/RuntimeConfigValidator/ZodRuntimeConfigValidator.test.d.ts +1 -0
  571. package/dist/esm/Runtime/RuntimeConfigValidator/ZodRuntimeConfigValidator.test.js +60 -0
  572. package/dist/esm/Runtime/RuntimeConfigValidator/index.d.ts +1 -0
  573. package/dist/esm/Runtime/RuntimeConfigValidator/index.js +1 -0
  574. package/dist/esm/Runtime/RuntimeConfigValidator.d.ts +4 -0
  575. package/dist/esm/Runtime/RuntimeConfigValidator.js +1 -0
  576. package/dist/esm/Runtime/RuntimeConfigValidator.test.d.ts +1 -0
  577. package/dist/esm/Runtime/RuntimeConfigValidator.test.js +39 -0
  578. package/dist/esm/Runtime/RuntimeProvider.d.ts +5 -0
  579. package/dist/esm/Runtime/RuntimeProvider.js +1 -0
  580. package/dist/esm/Runtime/RuntimeProvider.test.d.ts +1 -0
  581. package/dist/esm/Runtime/RuntimeProvider.test.js +11 -0
  582. package/dist/esm/Runtime/RuntimeProviderLoader/ModuleRuntimeProviderLoader.d.ts +14 -0
  583. package/dist/esm/Runtime/RuntimeProviderLoader/ModuleRuntimeProviderLoader.js +50 -0
  584. package/dist/esm/Runtime/RuntimeProviderLoader/ModuleRuntimeProviderLoader.test.d.ts +1 -0
  585. package/dist/esm/Runtime/RuntimeProviderLoader/ModuleRuntimeProviderLoader.test.js +146 -0
  586. package/dist/esm/Runtime/RuntimeProviderLoader/index.d.ts +1 -0
  587. package/dist/esm/Runtime/RuntimeProviderLoader/index.js +1 -0
  588. package/dist/esm/Runtime/RuntimeProviderLoader.d.ts +8 -0
  589. package/dist/esm/Runtime/RuntimeProviderLoader.js +1 -0
  590. package/dist/esm/Runtime/RuntimeProviderLoader.test.d.ts +1 -0
  591. package/dist/esm/Runtime/RuntimeProviderLoader.test.js +24 -0
  592. package/dist/esm/Runtime/index.d.ts +15 -0
  593. package/dist/esm/Runtime/index.js +15 -0
  594. package/dist/esm/index.d.ts +3 -0
  595. package/dist/esm/index.js +3 -0
  596. package/package.json +110 -0
@@ -0,0 +1,559 @@
1
+ import { DirectedGraph, UndirectedGraph } from 'graphology';
2
+ import { JsonRenderer } from '../Renderers/JsonRenderer.js';
3
+ import { TG_SCHEMA_VERSION, asEdgeId, asNodeId, tgNodeIdFrom, } from '../TgGraph.js';
4
+ import { GraphologyAdapter } from './GraphologyAdapter.js';
5
+ const buildGraphFixture = () => {
6
+ const graph = new DirectedGraph();
7
+ const a = asNodeId('a');
8
+ const b = asNodeId('b');
9
+ graph.addNode(a, { label: 'A' });
10
+ graph.addNode(b, { label: 'B' });
11
+ const e1 = asEdgeId('e1');
12
+ graph.addEdgeWithKey(e1, a, b, { weight: 2 });
13
+ graph.setAttribute('tg:description', { note: 'test' });
14
+ const tg = {
15
+ schemaVersion: TG_SCHEMA_VERSION,
16
+ nodes: {
17
+ [a]: { id: a },
18
+ [b]: { id: b },
19
+ },
20
+ edges: [
21
+ {
22
+ id: e1,
23
+ from: a,
24
+ to: b,
25
+ attributes: { weight: 2 },
26
+ },
27
+ ],
28
+ description: { note: 'test' },
29
+ };
30
+ return { graph, tg, a, b, e1 };
31
+ };
32
+ describe('GraphologyAdapter.getGraph', () => {
33
+ it('shoud return a copy of the original graph without changing it', () => {
34
+ const initialGraph = new UndirectedGraph();
35
+ initialGraph.addNode('a-node', { attribute: 'value' });
36
+ const graphology = new GraphologyAdapter(initialGraph);
37
+ const copiedGraph = graphology.getGraph();
38
+ expect(copiedGraph).not.toBe(initialGraph);
39
+ expect(copiedGraph.export()).toStrictEqual(initialGraph.export());
40
+ });
41
+ it('shoud default to an empty directed graph when none is provided', () => {
42
+ const adapter = new GraphologyAdapter();
43
+ expect(adapter.nodeIds()).toEqual([]);
44
+ });
45
+ });
46
+ describe('GraphologyAdapter.getRenderer', () => {
47
+ it('shoud return a JsonRenderer instance', () => {
48
+ const adapter = new GraphologyAdapter(new DirectedGraph());
49
+ const renderer = adapter.getRenderer();
50
+ expect(renderer).toBeInstanceOf(JsonRenderer);
51
+ });
52
+ });
53
+ describe('GraphologyAdapter.getNodeAttributes', () => {
54
+ it('shoud return node attributes when the node exists', () => {
55
+ const { graph, a } = buildGraphFixture();
56
+ const adapter = new GraphologyAdapter(graph);
57
+ expect(adapter.getNodeAttributes(a)).toStrictEqual({
58
+ label: 'A',
59
+ });
60
+ });
61
+ it('shoud return undefined when the node does not exist', () => {
62
+ const { graph } = buildGraphFixture();
63
+ const adapter = new GraphologyAdapter(graph);
64
+ expect(adapter.getNodeAttributes(asNodeId('missing'))).toBeUndefined();
65
+ });
66
+ });
67
+ describe('GraphologyAdapter.getEdgeAttributes', () => {
68
+ it('shoud return edge attributes', () => {
69
+ const { graph, e1 } = buildGraphFixture();
70
+ const adapter = new GraphologyAdapter(graph);
71
+ expect(adapter.getEdgeAttributes(e1)).toStrictEqual({ weight: 2 });
72
+ });
73
+ });
74
+ describe('GraphologyAdapter.edgeSource', () => {
75
+ it('shoud return the source node id', () => {
76
+ const { graph, a, e1 } = buildGraphFixture();
77
+ const adapter = new GraphologyAdapter(graph);
78
+ expect(adapter.edgeSource(e1)).toBe(a);
79
+ });
80
+ });
81
+ describe('GraphologyAdapter.edgeTarget', () => {
82
+ it('shoud return the target node id', () => {
83
+ const { graph, b, e1 } = buildGraphFixture();
84
+ const adapter = new GraphologyAdapter(graph);
85
+ expect(adapter.edgeTarget(e1)).toBe(b);
86
+ });
87
+ });
88
+ describe('GraphologyAdapter.neighbors', () => {
89
+ it('shoud return neighboring node ids', () => {
90
+ const { graph, a, b } = buildGraphFixture();
91
+ const adapter = new GraphologyAdapter(graph);
92
+ expect(adapter.neighbors(a)).toEqual(expect.arrayContaining([b]));
93
+ });
94
+ });
95
+ describe('GraphologyAdapter.predecessors', () => {
96
+ it('shoud return predecessor node ids', () => {
97
+ const { graph, a, b } = buildGraphFixture();
98
+ const adapter = new GraphologyAdapter(graph);
99
+ expect(adapter.predecessors(b)).toEqual(expect.arrayContaining([a]));
100
+ });
101
+ });
102
+ describe('GraphologyAdapter.successors', () => {
103
+ it('shoud return successor node ids', () => {
104
+ const { graph, a, b } = buildGraphFixture();
105
+ const adapter = new GraphologyAdapter(graph);
106
+ expect(adapter.successors(a)).toEqual(expect.arrayContaining([b]));
107
+ });
108
+ });
109
+ describe('GraphologyAdapter.inEdges', () => {
110
+ it('shoud return inbound edge ids', () => {
111
+ const { graph, b, e1 } = buildGraphFixture();
112
+ const adapter = new GraphologyAdapter(graph);
113
+ expect(adapter.inEdges(b)).toEqual([e1]);
114
+ });
115
+ });
116
+ describe('GraphologyAdapter.outEdges', () => {
117
+ it('shoud return outbound edge ids', () => {
118
+ const { graph, a, e1 } = buildGraphFixture();
119
+ const adapter = new GraphologyAdapter(graph);
120
+ expect(adapter.outEdges(a)).toEqual([e1]);
121
+ });
122
+ });
123
+ describe('GraphologyAdapter.edgesBetween', () => {
124
+ it('shoud return edge ids between nodes', () => {
125
+ const { graph, a, b, e1 } = buildGraphFixture();
126
+ const adapter = new GraphologyAdapter(graph);
127
+ expect(adapter.edgesBetween(a, b)).toEqual([e1]);
128
+ });
129
+ });
130
+ describe('GraphologyAdapter.setNodeAttributes', () => {
131
+ it('shoud return a new adapter with updated node attributes', () => {
132
+ const { graph, a } = buildGraphFixture();
133
+ const adapter = new GraphologyAdapter(graph);
134
+ const updated = adapter.setNodeAttributes(a, { label: 'A2' });
135
+ expect(updated.getNodeAttributes(a)).toStrictEqual({ label: 'A2' });
136
+ expect(adapter.getNodeAttributes(a)).toStrictEqual({ label: 'A' });
137
+ });
138
+ });
139
+ describe('GraphologyAdapter.setEdge', () => {
140
+ it('shoud return a new adapter with a new edge', () => {
141
+ const { graph, a, b, e1 } = buildGraphFixture();
142
+ const adapter = new GraphologyAdapter(graph);
143
+ const e2 = asEdgeId('e2');
144
+ const updated = adapter.setEdge(e2, b, a, { weight: 1 });
145
+ expect(updated.edgesBetween(b, a)).toEqual(expect.arrayContaining([e1, e2]));
146
+ expect(adapter.edgesBetween(b, a)).toEqual([e1]);
147
+ });
148
+ });
149
+ describe('GraphologyAdapter.removeNode', () => {
150
+ it('shoud return a new adapter without the node', () => {
151
+ const { graph, a } = buildGraphFixture();
152
+ const adapter = new GraphologyAdapter(graph);
153
+ const updated = adapter.removeNode(a);
154
+ expect(updated.getNodeAttributes(a)).toBeUndefined();
155
+ expect(adapter.getNodeAttributes(a)).toStrictEqual({ label: 'A' });
156
+ });
157
+ });
158
+ describe('GraphologyAdapter.removeEdge', () => {
159
+ it('shoud return a new adapter without the edge', () => {
160
+ const { graph, a, b, e1 } = buildGraphFixture();
161
+ const adapter = new GraphologyAdapter(graph);
162
+ const updated = adapter.removeEdge(e1);
163
+ expect(updated.edgesBetween(a, b)).toEqual([]);
164
+ expect(adapter.edgesBetween(a, b)).toEqual([e1]);
165
+ });
166
+ });
167
+ const buildTgGraph = () => {
168
+ const { a, b, e1 } = buildGraphFixture();
169
+ return {
170
+ tg: {
171
+ schemaVersion: TG_SCHEMA_VERSION,
172
+ nodes: {
173
+ [a]: { id: a },
174
+ [b]: { id: b },
175
+ },
176
+ edges: [
177
+ {
178
+ id: e1,
179
+ from: a,
180
+ to: b,
181
+ attributes: { weight: 2 },
182
+ },
183
+ ],
184
+ description: { note: 'test' },
185
+ },
186
+ a,
187
+ b,
188
+ e1,
189
+ };
190
+ };
191
+ describe('GraphologyAdapter.withTgGraph', () => {
192
+ it('shoud return a new adapter with the graph data applied', () => {
193
+ const { tg } = buildTgGraph();
194
+ const updated = new GraphologyAdapter(new DirectedGraph()).withTgGraph(tg);
195
+ expect(updated.toTgGraph()).toStrictEqual(tg);
196
+ });
197
+ it('shoud default missing edge attributes to an empty object', () => {
198
+ const { a, b, e1 } = buildGraphFixture();
199
+ const tg = {
200
+ schemaVersion: TG_SCHEMA_VERSION,
201
+ nodes: {
202
+ [a]: { id: a },
203
+ [b]: { id: b },
204
+ },
205
+ edges: [
206
+ {
207
+ id: e1,
208
+ from: a,
209
+ to: b,
210
+ },
211
+ ],
212
+ description: {},
213
+ };
214
+ const updated = new GraphologyAdapter(new DirectedGraph()).withTgGraph(tg);
215
+ expect(updated.toTgGraph()).toStrictEqual({
216
+ ...tg,
217
+ edges: [
218
+ {
219
+ ...tg.edges[0],
220
+ attributes: {},
221
+ },
222
+ ],
223
+ });
224
+ });
225
+ it('shoud default schemaVersion when missing', () => {
226
+ const tg = {
227
+ nodes: {},
228
+ edges: [],
229
+ description: {},
230
+ };
231
+ const updated = new GraphologyAdapter(new DirectedGraph()).withTgGraph(tg);
232
+ expect(updated.toTgGraph().schemaVersion).toBe(TG_SCHEMA_VERSION);
233
+ });
234
+ });
235
+ describe('GraphologyAdapter.toTgGraph', () => {
236
+ it('shoud return a TgGraph representation of the current graph', () => {
237
+ const { tg, graph } = buildGraphFixture();
238
+ const adapter = new GraphologyAdapter(graph);
239
+ expect(adapter.toTgGraph()).toStrictEqual(tg);
240
+ });
241
+ it('shoud omit labels from the canonical tg model', () => {
242
+ const graph = new DirectedGraph();
243
+ const a = asNodeId('a');
244
+ graph.addNode(a, { label: 'A' });
245
+ const adapter = new GraphologyAdapter(graph);
246
+ expect(adapter.toTgGraph()).toStrictEqual({
247
+ schemaVersion: TG_SCHEMA_VERSION,
248
+ nodes: {
249
+ [a]: { id: a },
250
+ },
251
+ edges: [],
252
+ description: {},
253
+ });
254
+ });
255
+ it('shoud include terraform fields when present on the node attributes', () => {
256
+ const graph = new DirectedGraph();
257
+ const a = asNodeId('a');
258
+ graph.addNode(a, {
259
+ label: 'A',
260
+ terraform: {
261
+ kind: 'resource',
262
+ address: 'aws_s3_bucket.main',
263
+ resource: 'aws_s3_bucket',
264
+ name: 'main',
265
+ },
266
+ });
267
+ const adapter = new GraphologyAdapter(graph);
268
+ expect(adapter.toTgGraph()).toStrictEqual({
269
+ schemaVersion: TG_SCHEMA_VERSION,
270
+ nodes: {
271
+ [a]: {
272
+ id: a,
273
+ terraform: {
274
+ kind: 'resource',
275
+ address: 'aws_s3_bucket.main',
276
+ resource: 'aws_s3_bucket',
277
+ name: 'main',
278
+ },
279
+ },
280
+ },
281
+ edges: [],
282
+ description: {},
283
+ });
284
+ });
285
+ it('shoud return an empty-node payload when neither label nor terraform exist', () => {
286
+ const graph = new DirectedGraph();
287
+ const a = asNodeId('a');
288
+ graph.addNode(a, {});
289
+ const adapter = new GraphologyAdapter(graph);
290
+ expect(adapter.toTgGraph()).toStrictEqual({
291
+ schemaVersion: TG_SCHEMA_VERSION,
292
+ nodes: {
293
+ [a]: { id: a },
294
+ },
295
+ edges: [],
296
+ description: {},
297
+ });
298
+ });
299
+ it('shoud derive terraform details from namespaced node ids', () => {
300
+ const graph = new DirectedGraph();
301
+ const nodeId = tgNodeIdFrom('resource', 'module.example.aws_s3_bucket.main');
302
+ graph.addNode(nodeId, { label: 'bucket' });
303
+ const adapter = new GraphologyAdapter(graph);
304
+ expect(adapter.toTgGraph()).toStrictEqual({
305
+ schemaVersion: TG_SCHEMA_VERSION,
306
+ nodes: {
307
+ [nodeId]: {
308
+ id: nodeId,
309
+ terraform: {
310
+ kind: 'resource',
311
+ address: 'module.example.aws_s3_bucket.main',
312
+ resource: 'aws_s3_bucket',
313
+ name: 'main',
314
+ moduleAddress: 'module.example',
315
+ parentModuleName: 'example',
316
+ parentModuleNodeId: tgNodeIdFrom('module', 'module.example'),
317
+ },
318
+ },
319
+ },
320
+ edges: [],
321
+ description: {},
322
+ });
323
+ });
324
+ it('shoud derive terraform details for data nodes', () => {
325
+ const graph = new DirectedGraph();
326
+ const nodeId = tgNodeIdFrom('data', 'data.aws_iam_policy.policy');
327
+ graph.addNode(nodeId, { label: 'policy' });
328
+ const adapter = new GraphologyAdapter(graph);
329
+ expect(adapter.toTgGraph().nodes[nodeId]).toEqual({
330
+ id: nodeId,
331
+ terraform: {
332
+ kind: 'data',
333
+ address: 'data.aws_iam_policy.policy',
334
+ resource: 'aws_iam_policy',
335
+ name: 'policy',
336
+ },
337
+ });
338
+ });
339
+ it('shoud derive terraform details for nested module nodes', () => {
340
+ const graph = new DirectedGraph();
341
+ const nodeId = tgNodeIdFrom('module', 'module.alpha.module.beta');
342
+ graph.addNode(nodeId, { label: 'module.beta' });
343
+ const adapter = new GraphologyAdapter(graph);
344
+ expect(adapter.toTgGraph().nodes[nodeId]).toEqual({
345
+ id: nodeId,
346
+ terraform: {
347
+ kind: 'module',
348
+ address: 'module.alpha.module.beta',
349
+ resource: 'module',
350
+ name: 'beta',
351
+ moduleAddress: 'module.alpha',
352
+ parentModuleName: 'alpha',
353
+ parentModuleNodeId: tgNodeIdFrom('module', 'module.alpha'),
354
+ },
355
+ });
356
+ });
357
+ it('shoud derive terraform details for top-level module nodes', () => {
358
+ const graph = new DirectedGraph();
359
+ const nodeId = tgNodeIdFrom('module', 'module.alpha');
360
+ graph.addNode(nodeId, { label: 'module.alpha' });
361
+ const adapter = new GraphologyAdapter(graph);
362
+ expect(adapter.toTgGraph().nodes[nodeId]).toEqual({
363
+ id: nodeId,
364
+ terraform: {
365
+ kind: 'module',
366
+ address: 'module.alpha',
367
+ resource: 'module',
368
+ name: 'alpha',
369
+ },
370
+ });
371
+ });
372
+ it('shoud derive terraform details for local and provider nodes', () => {
373
+ const graph = new DirectedGraph();
374
+ const localNodeId = tgNodeIdFrom('local', 'region');
375
+ const providerNodeId = tgNodeIdFrom('provider', 'provider[registry.terraform.io/hashicorp/aws]');
376
+ graph.addNode(localNodeId, { label: 'region' });
377
+ graph.addNode(providerNodeId, { label: 'provider.aws' });
378
+ const adapter = new GraphologyAdapter(graph);
379
+ const tg = adapter.toTgGraph();
380
+ expect(tg.nodes[localNodeId]).toEqual({
381
+ id: localNodeId,
382
+ terraform: {
383
+ kind: 'local',
384
+ address: 'region',
385
+ resource: 'local',
386
+ name: 'region',
387
+ },
388
+ });
389
+ expect(tg.nodes[providerNodeId]).toEqual({
390
+ id: providerNodeId,
391
+ terraform: {
392
+ kind: 'provider',
393
+ address: 'provider[registry.terraform.io/hashicorp/aws]',
394
+ resource: 'provider',
395
+ name: 'provider[registry.terraform.io/hashicorp/aws]',
396
+ },
397
+ });
398
+ });
399
+ it('shoud derive terraform details for root and meta nodes', () => {
400
+ const graph = new DirectedGraph();
401
+ const rootNodeId = tgNodeIdFrom('root', 'root');
402
+ const metaNodeId = tgNodeIdFrom('meta', 'meta.block');
403
+ graph.addNode(rootNodeId, { label: 'root' });
404
+ graph.addNode(metaNodeId, { label: 'meta.block' });
405
+ const adapter = new GraphologyAdapter(graph);
406
+ const tg = adapter.toTgGraph();
407
+ expect(tg.nodes[rootNodeId]).toEqual({
408
+ id: rootNodeId,
409
+ terraform: {
410
+ kind: 'root',
411
+ address: 'root',
412
+ resource: 'root',
413
+ name: 'root',
414
+ },
415
+ });
416
+ expect(tg.nodes[metaNodeId]).toEqual({
417
+ id: metaNodeId,
418
+ terraform: {
419
+ kind: 'meta',
420
+ address: 'meta.block',
421
+ resource: 'meta',
422
+ name: 'meta.block',
423
+ },
424
+ });
425
+ });
426
+ it('shoud use address fallback when provider or meta join is empty', () => {
427
+ const graph = new DirectedGraph();
428
+ const providerNodeId = tgNodeIdFrom('provider', 'provider.aws');
429
+ const metaNodeId = tgNodeIdFrom('meta', 'meta.block');
430
+ graph.addNode(providerNodeId, { label: 'provider' });
431
+ graph.addNode(metaNodeId, { label: 'meta' });
432
+ const adapter = new GraphologyAdapter(graph);
433
+ const originalJoin = Array.prototype.join;
434
+ let overrides = 0;
435
+ Array.prototype.join = function (separator) {
436
+ if (overrides < 2 && (this[0] === 'provider' || this[0] === 'meta')) {
437
+ overrides += 1;
438
+ return '';
439
+ }
440
+ return originalJoin.call(this, separator);
441
+ };
442
+ try {
443
+ const tg = adapter.toTgGraph();
444
+ expect(tg.nodes[providerNodeId]).toEqual({
445
+ id: providerNodeId,
446
+ terraform: {
447
+ kind: 'provider',
448
+ address: 'provider.aws',
449
+ resource: 'provider',
450
+ name: 'provider.aws',
451
+ },
452
+ });
453
+ expect(tg.nodes[metaNodeId]).toEqual({
454
+ id: metaNodeId,
455
+ terraform: {
456
+ kind: 'meta',
457
+ address: 'meta.block',
458
+ resource: 'meta',
459
+ name: 'meta.block',
460
+ },
461
+ });
462
+ }
463
+ finally {
464
+ Array.prototype.join = originalJoin;
465
+ }
466
+ });
467
+ it('shoud fall back to terraform kind for unknown types', () => {
468
+ const graph = new DirectedGraph();
469
+ const nodeId = tgNodeIdFrom('terraform', 'terraform');
470
+ graph.addNode(nodeId, { label: 'terraform' });
471
+ const adapter = new GraphologyAdapter(graph);
472
+ expect(adapter.toTgGraph().nodes[nodeId]).toEqual({
473
+ id: nodeId,
474
+ terraform: {
475
+ kind: 'terraform',
476
+ address: 'terraform',
477
+ resource: 'terraform',
478
+ name: 'terraform',
479
+ },
480
+ });
481
+ });
482
+ it('shoud honor provided terraform parentModuleNodeId', () => {
483
+ const graph = new DirectedGraph();
484
+ const nodeId = asNodeId('custom-node');
485
+ const parentModuleNodeId = tgNodeIdFrom('module', 'module.alpha');
486
+ graph.addNode(nodeId, {
487
+ label: 'custom',
488
+ terraform: {
489
+ kind: 'resource',
490
+ address: 'module.alpha.aws_s3_bucket.main',
491
+ resource: 'aws_s3_bucket',
492
+ name: 'main',
493
+ moduleAddress: 'module.alpha',
494
+ parentModuleName: 'alpha',
495
+ parentModuleNodeId,
496
+ },
497
+ });
498
+ const adapter = new GraphologyAdapter(graph);
499
+ expect(adapter.toTgGraph().nodes[nodeId]).toEqual({
500
+ id: nodeId,
501
+ terraform: {
502
+ kind: 'resource',
503
+ address: 'module.alpha.aws_s3_bucket.main',
504
+ resource: 'aws_s3_bucket',
505
+ name: 'main',
506
+ moduleAddress: 'module.alpha',
507
+ parentModuleName: 'alpha',
508
+ parentModuleNodeId,
509
+ },
510
+ });
511
+ });
512
+ it('shoud fall back to the module address when segments are empty', () => {
513
+ const graph = new DirectedGraph();
514
+ const nodeId = tgNodeIdFrom('module', 'module.alpha');
515
+ graph.addNode(nodeId, { label: 'module.alpha' });
516
+ const adapter = new GraphologyAdapter(graph);
517
+ const originalSplit = String.prototype.split;
518
+ String.prototype.split = function (...args) {
519
+ if (this === 'module.alpha') {
520
+ return [];
521
+ }
522
+ return originalSplit.apply(this, args);
523
+ };
524
+ try {
525
+ const node = adapter.toTgGraph().nodes[nodeId];
526
+ expect(node.terraform).toEqual({
527
+ kind: 'module',
528
+ address: 'module.alpha',
529
+ resource: 'module',
530
+ name: 'module.alpha',
531
+ });
532
+ }
533
+ finally {
534
+ String.prototype.split = originalSplit;
535
+ }
536
+ });
537
+ });
538
+ describe('GraphologyAdapter.parentModuleHelpers', () => {
539
+ it('shoud fall back to moduleAddress when split yields no parts', () => {
540
+ const adapter = new GraphologyAdapter(new DirectedGraph());
541
+ const originalSplit = String.prototype.split;
542
+ String.prototype.split = function (...args) {
543
+ if (this === 'module.empty') {
544
+ return [];
545
+ }
546
+ return originalSplit.apply(this, args);
547
+ };
548
+ try {
549
+ const helpers = adapter.parentModuleHelpers('module.empty');
550
+ expect(helpers).toEqual({
551
+ parentModuleName: 'module.empty',
552
+ parentModuleNodeId: tgNodeIdFrom('module', 'module.empty'),
553
+ });
554
+ }
555
+ finally {
556
+ String.prototype.split = originalSplit;
557
+ }
558
+ });
559
+ });
@@ -0,0 +1,2 @@
1
+ export * from './DotAdapter.js';
2
+ export * from './GraphologyAdapter.js';
@@ -0,0 +1,2 @@
1
+ export * from './DotAdapter.js';
2
+ export * from './GraphologyAdapter.js';
@@ -0,0 +1,53 @@
1
+ import { NamedRuleRegistry } from './Rules/NamedRuleRegistry.js';
2
+ import { NamedRuleSetDefinitions, NamedRuleSetRegistry } from './Rules/NamedRuleSetRegistry.js';
3
+ import { NamedRuleDefinitions, PhasePlan } from './Rules/RulePlan.js';
4
+ export type GraphPluginBuildInput<TOptions extends Record<string, unknown> = Record<string, unknown>> = {
5
+ options: TOptions;
6
+ namedRules: NamedRuleRegistry;
7
+ namedRuleSets: NamedRuleSetRegistry;
8
+ };
9
+ export type GraphPluginBuildResult = {
10
+ namedRules?: NamedRuleDefinitions;
11
+ namedRuleSets?: NamedRuleSetDefinitions;
12
+ phases?: PhasePlan;
13
+ };
14
+ export declare abstract class GraphPlugin<TOptions extends Record<string, unknown> = Record<string, unknown>> {
15
+ readonly name: string;
16
+ readonly defaults?: TOptions | undefined;
17
+ constructor(name: string, defaults?: TOptions | undefined);
18
+ abstract build(input: GraphPluginBuildInput<TOptions>): GraphPluginBuildResult;
19
+ }
20
+ type GraphPluginFactory = () => GraphPlugin;
21
+ export type GraphPluginDefinition = GraphPlugin | GraphPluginFactory;
22
+ export type GraphPluginDefinitions = Record<string, GraphPluginDefinition>;
23
+ export declare class GraphPluginRegistry {
24
+ private readonly definitions;
25
+ constructor(definitions?: GraphPluginDefinitions, factories?: Record<string, GraphPluginFactory>);
26
+ static from(registries: GraphPluginRegistry[]): GraphPluginRegistry;
27
+ register(name: string, definition: GraphPluginDefinition): GraphPluginRegistry;
28
+ registerMany(definitions: GraphPluginDefinitions): GraphPluginRegistry;
29
+ use(registry: GraphPluginRegistry): GraphPluginRegistry;
30
+ resolve(name: string): GraphPlugin;
31
+ names(): string[];
32
+ private static fromFactories;
33
+ private static toFactories;
34
+ private static toFactory;
35
+ }
36
+ export type GraphPluginRef = {
37
+ plugin: string;
38
+ options?: unknown;
39
+ };
40
+ export type SerializedGraphPluginRef = GraphPluginRef;
41
+ export type ResolveGraphPluginsInput = {
42
+ plugins: GraphPluginRef[];
43
+ pluginRegistry: GraphPluginRegistry;
44
+ namedRules?: NamedRuleRegistry;
45
+ namedRuleSets?: NamedRuleSetRegistry;
46
+ };
47
+ export type ResolveGraphPluginsResult = {
48
+ phases: PhasePlan;
49
+ namedRules: NamedRuleRegistry;
50
+ namedRuleSets: NamedRuleSetRegistry;
51
+ };
52
+ export declare const resolveGraphPlugins: (input: ResolveGraphPluginsInput) => ResolveGraphPluginsResult;
53
+ export {};