@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,831 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const GraphPlugin_js_1 = require("./GraphPlugin.js");
4
+ const NamedRuleRegistry_js_1 = require("./Rules/NamedRuleRegistry.js");
5
+ const NamedRuleSetRegistry_js_1 = require("./Rules/NamedRuleSetRegistry.js");
6
+ const RemoveNode_js_1 = require("./Rules/Node/RemoveNode.js");
7
+ const RuleSet_js_1 = require("./Rules/RuleSet.js");
8
+ describe('GraphPluginRegistry.resolve', () => {
9
+ it('shoud resolve a named plugin instance', () => {
10
+ class ExamplePlugin extends GraphPlugin_js_1.GraphPlugin {
11
+ constructor() {
12
+ super('example.plugin');
13
+ }
14
+ build() {
15
+ return {};
16
+ }
17
+ }
18
+ const plugin = new ExamplePlugin();
19
+ const registry = new GraphPlugin_js_1.GraphPluginRegistry({
20
+ 'example.plugin': plugin,
21
+ });
22
+ expect(registry.resolve('example.plugin')).toBe(plugin);
23
+ });
24
+ it('shoud resolve a fresh instance each time for a named plugin factory', () => {
25
+ class FactoryPlugin extends GraphPlugin_js_1.GraphPlugin {
26
+ constructor() {
27
+ super('factory.plugin');
28
+ }
29
+ build() {
30
+ return {};
31
+ }
32
+ }
33
+ const registry = new GraphPlugin_js_1.GraphPluginRegistry({
34
+ 'factory.plugin': () => new FactoryPlugin(),
35
+ });
36
+ const first = registry.resolve('factory.plugin');
37
+ const second = registry.resolve('factory.plugin');
38
+ expect(first).not.toBe(second);
39
+ expect(first.name).toBe(second.name);
40
+ });
41
+ it('shoud throw when a named plugin is not registered', () => {
42
+ const registry = new GraphPlugin_js_1.GraphPluginRegistry();
43
+ expect(() => registry.resolve('doesNotExist')).toThrow("GraphPlugin 'doesNotExist' is not registered");
44
+ });
45
+ it('shoud throw when registry key and plugin name do not match', () => {
46
+ class WrongNamePlugin extends GraphPlugin_js_1.GraphPlugin {
47
+ constructor() {
48
+ super('wrong.name');
49
+ }
50
+ build() {
51
+ return {};
52
+ }
53
+ }
54
+ const registry = new GraphPlugin_js_1.GraphPluginRegistry({
55
+ 'expected.name': new WrongNamePlugin(),
56
+ });
57
+ expect(() => registry.resolve('expected.name')).toThrow("GraphPlugin registry key 'expected.name' does not match plugin.name 'wrong.name'");
58
+ });
59
+ });
60
+ describe('GraphPluginRegistry.register', () => {
61
+ it('shoud return a new registry without mutating the original', () => {
62
+ class OnePlugin extends GraphPlugin_js_1.GraphPlugin {
63
+ constructor() {
64
+ super('one.plugin');
65
+ }
66
+ build() {
67
+ return {};
68
+ }
69
+ }
70
+ class TwoPlugin extends GraphPlugin_js_1.GraphPlugin {
71
+ constructor() {
72
+ super('two.plugin');
73
+ }
74
+ build() {
75
+ return {};
76
+ }
77
+ }
78
+ const base = new GraphPlugin_js_1.GraphPluginRegistry({
79
+ 'one.plugin': new OnePlugin(),
80
+ });
81
+ const next = base.register('two.plugin', new TwoPlugin());
82
+ expect(base.names()).toEqual(['one.plugin']);
83
+ expect(next.names()).toEqual(['one.plugin', 'two.plugin']);
84
+ });
85
+ });
86
+ describe('GraphPluginRegistry.registerMany', () => {
87
+ it('shoud return a new registry with merged definitions', () => {
88
+ class OnePlugin extends GraphPlugin_js_1.GraphPlugin {
89
+ constructor() {
90
+ super('one.plugin');
91
+ }
92
+ build() {
93
+ return {};
94
+ }
95
+ }
96
+ class TwoPlugin extends GraphPlugin_js_1.GraphPlugin {
97
+ constructor() {
98
+ super('two.plugin');
99
+ }
100
+ build() {
101
+ return {};
102
+ }
103
+ }
104
+ const base = new GraphPlugin_js_1.GraphPluginRegistry({
105
+ 'one.plugin': new OnePlugin(),
106
+ });
107
+ const next = base.registerMany({
108
+ 'two.plugin': () => new TwoPlugin(),
109
+ });
110
+ expect(base.names()).toEqual(['one.plugin']);
111
+ expect(next.names()).toEqual(['one.plugin', 'two.plugin']);
112
+ expect(next.resolve('two.plugin')).not.toBe(next.resolve('two.plugin'));
113
+ });
114
+ });
115
+ describe('GraphPluginRegistry.use', () => {
116
+ it('shoud combine registries immutably', () => {
117
+ class OnePlugin extends GraphPlugin_js_1.GraphPlugin {
118
+ constructor() {
119
+ super('one.plugin');
120
+ }
121
+ build() {
122
+ return {};
123
+ }
124
+ }
125
+ class TwoPlugin extends GraphPlugin_js_1.GraphPlugin {
126
+ constructor() {
127
+ super('two.plugin');
128
+ }
129
+ build() {
130
+ return {};
131
+ }
132
+ }
133
+ const one = new GraphPlugin_js_1.GraphPluginRegistry({
134
+ 'one.plugin': new OnePlugin(),
135
+ });
136
+ const two = new GraphPlugin_js_1.GraphPluginRegistry({
137
+ 'two.plugin': new TwoPlugin(),
138
+ });
139
+ const combined = one.use(two);
140
+ expect(one.names()).toEqual(['one.plugin']);
141
+ expect(two.names()).toEqual(['two.plugin']);
142
+ expect(combined.names()).toEqual(['one.plugin', 'two.plugin']);
143
+ });
144
+ });
145
+ describe('GraphPluginRegistry.from', () => {
146
+ it('shoud combine an array of registries', () => {
147
+ class OnePlugin extends GraphPlugin_js_1.GraphPlugin {
148
+ constructor() {
149
+ super('one.plugin');
150
+ }
151
+ build() {
152
+ return {};
153
+ }
154
+ }
155
+ class TwoPlugin extends GraphPlugin_js_1.GraphPlugin {
156
+ constructor() {
157
+ super('two.plugin');
158
+ }
159
+ build() {
160
+ return {};
161
+ }
162
+ }
163
+ const one = new GraphPlugin_js_1.GraphPluginRegistry({
164
+ 'one.plugin': new OnePlugin(),
165
+ });
166
+ const two = new GraphPlugin_js_1.GraphPluginRegistry({
167
+ 'two.plugin': new TwoPlugin(),
168
+ });
169
+ const combined = GraphPlugin_js_1.GraphPluginRegistry.from([one, two]);
170
+ expect(combined.names()).toEqual(['one.plugin', 'two.plugin']);
171
+ });
172
+ });
173
+ describe('resolveGraphPlugins', () => {
174
+ it('shoud resolve plugin named rules, named rule sets and prefixed phases', () => {
175
+ class PluginOne extends GraphPlugin_js_1.GraphPlugin {
176
+ constructor() {
177
+ super('test.plugin', { marker: 'default' });
178
+ }
179
+ build({ options, }) {
180
+ return {
181
+ namedRules: {
182
+ remove: new RemoveNode_js_1.RemoveNode({
183
+ node: {
184
+ attr: {
185
+ key: 'label',
186
+ eq: options.marker ?? 'default',
187
+ },
188
+ },
189
+ }),
190
+ },
191
+ namedRuleSets: {
192
+ wrapper: new RuleSet_js_1.RuleSet({
193
+ rules: [{ namedRule: 'remove' }],
194
+ }),
195
+ },
196
+ phases: [
197
+ {
198
+ phase: 'main',
199
+ rules: [{ namedRuleSet: 'wrapper' }],
200
+ },
201
+ ],
202
+ };
203
+ }
204
+ }
205
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
206
+ 'test.plugin': new PluginOne(),
207
+ });
208
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
209
+ plugins: [{ plugin: 'test.plugin', options: { marker: 'plugin' } }],
210
+ pluginRegistry,
211
+ });
212
+ expect(result.namedRules.names()).toEqual(['test.plugin.remove']);
213
+ expect(result.namedRuleSets.names()).toEqual(['test.plugin.wrapper']);
214
+ expect(result.phases).toEqual([
215
+ {
216
+ phase: 'main',
217
+ rules: [{ namedRuleSet: 'test.plugin.wrapper' }],
218
+ },
219
+ ]);
220
+ const resolved = result.namedRuleSets
221
+ .resolve('test.plugin.wrapper')
222
+ .resolvePhases(result.namedRules, result.namedRuleSets);
223
+ expect(resolved[0][0].serialize()).toEqual({
224
+ id: 'RemoveNode',
225
+ config: {
226
+ node: { attr: { key: 'label', eq: 'plugin' } },
227
+ },
228
+ });
229
+ });
230
+ it('shoud resolve and prefix named phases', () => {
231
+ class PluginWithCleanupContribution extends GraphPlugin_js_1.GraphPlugin {
232
+ constructor() {
233
+ super('test.phase_contrib', { marker: 'default' });
234
+ }
235
+ build({ options, }) {
236
+ return {
237
+ namedRules: {
238
+ remove: new RemoveNode_js_1.RemoveNode({
239
+ node: {
240
+ attr: {
241
+ key: 'label',
242
+ eq: options.marker ?? 'default',
243
+ },
244
+ },
245
+ }),
246
+ },
247
+ namedRuleSets: {
248
+ wrapper: new RuleSet_js_1.RuleSet({
249
+ rules: [{ namedRule: 'remove' }],
250
+ }),
251
+ },
252
+ phases: [
253
+ {
254
+ phase: 'cleanup',
255
+ rules: [{ namedRuleSet: 'wrapper' }],
256
+ },
257
+ ],
258
+ };
259
+ }
260
+ }
261
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
262
+ 'test.phase_contrib': new PluginWithCleanupContribution(),
263
+ });
264
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
265
+ plugins: [
266
+ { plugin: 'test.phase_contrib', options: { marker: 'plugin' } },
267
+ ],
268
+ pluginRegistry,
269
+ });
270
+ expect(result.phases).toEqual([
271
+ {
272
+ phase: 'cleanup',
273
+ rules: [{ namedRuleSet: 'test.phase_contrib.wrapper' }],
274
+ },
275
+ ]);
276
+ });
277
+ it('shoud merge plugin defaults with provided options', () => {
278
+ class CapturePlugin extends GraphPlugin_js_1.GraphPlugin {
279
+ captured;
280
+ constructor() {
281
+ super('test.capture', { one: 'default-one', two: 'default-two' });
282
+ }
283
+ build({ options, }) {
284
+ this.captured = options;
285
+ return {};
286
+ }
287
+ }
288
+ const plugin = new CapturePlugin();
289
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
290
+ 'test.capture': plugin,
291
+ });
292
+ (0, GraphPlugin_js_1.resolveGraphPlugins)({
293
+ plugins: [{ plugin: 'test.capture', options: { one: 'override' } }],
294
+ pluginRegistry,
295
+ });
296
+ expect(plugin.captured).toEqual({
297
+ one: 'override',
298
+ two: 'default-two',
299
+ });
300
+ });
301
+ it('shoud pass an empty object when no defaults and no options are provided', () => {
302
+ class EmptyOptionsPlugin extends GraphPlugin_js_1.GraphPlugin {
303
+ captured;
304
+ constructor() {
305
+ super('test.empty');
306
+ }
307
+ build({ options, }) {
308
+ this.captured = options;
309
+ return {};
310
+ }
311
+ }
312
+ const plugin = new EmptyOptionsPlugin();
313
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
314
+ 'test.empty': plugin,
315
+ });
316
+ (0, GraphPlugin_js_1.resolveGraphPlugins)({
317
+ plugins: [{ plugin: 'test.empty' }],
318
+ pluginRegistry,
319
+ });
320
+ expect(plugin.captured).toEqual({});
321
+ });
322
+ it('shoud throw when plugin local names collide after prefixing', () => {
323
+ class CollisionPlugin extends GraphPlugin_js_1.GraphPlugin {
324
+ constructor() {
325
+ super('test.collision');
326
+ }
327
+ build() {
328
+ return {
329
+ namedRules: {
330
+ one: new RemoveNode_js_1.RemoveNode({ node: { any: true } }),
331
+ 'test.collision.one': new RemoveNode_js_1.RemoveNode({ node: { any: true } }),
332
+ },
333
+ };
334
+ }
335
+ }
336
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
337
+ 'test.collision': new CollisionPlugin(),
338
+ });
339
+ expect(() => (0, GraphPlugin_js_1.resolveGraphPlugins)({
340
+ plugins: [{ plugin: 'test.collision' }],
341
+ pluginRegistry,
342
+ })).toThrow("GraphPlugin 'test.collision' has colliding named rule names after prefixing ('test.collision.one' -> 'test.collision.one')");
343
+ });
344
+ it('shoud throw when plugin prefixed names collide with existing registries', () => {
345
+ class CollisionPlugin extends GraphPlugin_js_1.GraphPlugin {
346
+ constructor() {
347
+ super('test.collision');
348
+ }
349
+ build() {
350
+ return {
351
+ namedRules: {
352
+ one: new RemoveNode_js_1.RemoveNode({ node: { any: true } }),
353
+ },
354
+ };
355
+ }
356
+ }
357
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
358
+ 'test.collision': new CollisionPlugin(),
359
+ });
360
+ const namedRules = new NamedRuleRegistry_js_1.NamedRuleRegistry({
361
+ 'test.collision.one': new RemoveNode_js_1.RemoveNode({ node: { any: true } }),
362
+ });
363
+ expect(() => (0, GraphPlugin_js_1.resolveGraphPlugins)({
364
+ plugins: [{ plugin: 'test.collision' }],
365
+ pluginRegistry,
366
+ namedRules,
367
+ })).toThrow("GraphPlugin 'test.collision' named rule 'test.collision.one' collides with an existing named rule");
368
+ });
369
+ it('shoud not double prefix already prefixed names', () => {
370
+ class PrefixedPlugin extends GraphPlugin_js_1.GraphPlugin {
371
+ constructor() {
372
+ super('test.prefixed');
373
+ }
374
+ build() {
375
+ return {
376
+ namedRules: {
377
+ 'test.prefixed.rule': new RemoveNode_js_1.RemoveNode({ node: { any: true } }),
378
+ },
379
+ phases: [
380
+ {
381
+ phase: 'main',
382
+ rules: [{ namedRule: 'test.prefixed.rule' }],
383
+ },
384
+ ],
385
+ };
386
+ }
387
+ }
388
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
389
+ 'test.prefixed': new PrefixedPlugin(),
390
+ });
391
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
392
+ plugins: [{ plugin: 'test.prefixed' }],
393
+ pluginRegistry,
394
+ });
395
+ expect(result.namedRules.names()).toEqual(['test.prefixed.rule']);
396
+ expect(result.phases).toEqual([
397
+ {
398
+ phase: 'main',
399
+ rules: [{ namedRule: 'test.prefixed.rule' }],
400
+ },
401
+ ]);
402
+ });
403
+ it('shoud retain external named rule references without remapping', () => {
404
+ class ExternalRefPlugin extends GraphPlugin_js_1.GraphPlugin {
405
+ constructor() {
406
+ super('test.external');
407
+ }
408
+ build() {
409
+ return {
410
+ phases: [
411
+ {
412
+ phase: 'main',
413
+ rules: [{ namedRule: 'shared.rule' }],
414
+ },
415
+ ],
416
+ };
417
+ }
418
+ }
419
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
420
+ 'test.external': new ExternalRefPlugin(),
421
+ });
422
+ const namedRules = new NamedRuleRegistry_js_1.NamedRuleRegistry({
423
+ 'shared.rule': new RemoveNode_js_1.RemoveNode({ node: { any: true } }),
424
+ });
425
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
426
+ plugins: [{ plugin: 'test.external' }],
427
+ pluginRegistry,
428
+ namedRules,
429
+ });
430
+ expect(result.phases).toEqual([
431
+ {
432
+ phase: 'main',
433
+ rules: [{ namedRule: 'shared.rule' }],
434
+ },
435
+ ]);
436
+ });
437
+ it('shoud retain external named rule set references without remapping', () => {
438
+ class ExternalRuleSetPlugin extends GraphPlugin_js_1.GraphPlugin {
439
+ constructor() {
440
+ super('test.external_set');
441
+ }
442
+ build() {
443
+ return {
444
+ phases: [
445
+ {
446
+ phase: 'main',
447
+ rules: [{ namedRuleSet: 'shared.set' }],
448
+ },
449
+ ],
450
+ };
451
+ }
452
+ }
453
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
454
+ 'test.external_set': new ExternalRuleSetPlugin(),
455
+ });
456
+ const namedRuleSets = new NamedRuleSetRegistry_js_1.NamedRuleSetRegistry({
457
+ 'shared.set': new RuleSet_js_1.RuleSet({
458
+ rules: [{ namedRule: 'shared.rule' }],
459
+ }),
460
+ });
461
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
462
+ plugins: [{ plugin: 'test.external_set' }],
463
+ pluginRegistry,
464
+ namedRuleSets,
465
+ });
466
+ expect(result.phases).toEqual([
467
+ {
468
+ phase: 'main',
469
+ rules: [{ namedRuleSet: 'shared.set' }],
470
+ },
471
+ ]);
472
+ });
473
+ it('shoud rewrite named rule set factories with prefixed references', () => {
474
+ class RuleSetFactoryPlugin extends GraphPlugin_js_1.GraphPlugin {
475
+ constructor() {
476
+ super('test.factory', { label: 'default' });
477
+ }
478
+ build({ options, }) {
479
+ return {
480
+ namedRules: {
481
+ remove: new RemoveNode_js_1.RemoveNode({
482
+ node: { attr: { key: 'label', eq: options.label } },
483
+ }),
484
+ },
485
+ namedRuleSets: {
486
+ wrapper: () => new RuleSet_js_1.RuleSet({
487
+ rules: [{ namedRule: 'remove' }],
488
+ }),
489
+ },
490
+ phases: [
491
+ {
492
+ phase: 'main',
493
+ rules: [{ namedRuleSet: 'wrapper' }],
494
+ },
495
+ ],
496
+ };
497
+ }
498
+ }
499
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
500
+ 'test.factory': new RuleSetFactoryPlugin(),
501
+ });
502
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
503
+ plugins: [{ plugin: 'test.factory', options: { label: 'plugin' } }],
504
+ pluginRegistry,
505
+ });
506
+ const resolved = result.namedRuleSets
507
+ .resolve('test.factory.wrapper')
508
+ .resolvePhases(result.namedRules, result.namedRuleSets);
509
+ expect(resolved[0][0].serialize()).toEqual({
510
+ id: 'RemoveNode',
511
+ config: { node: { attr: { key: 'label', eq: 'plugin' } } },
512
+ });
513
+ });
514
+ it('shoud rewrite serialized named rule set definitions with prefixed rules', () => {
515
+ class SerializedRuleSetPlugin extends GraphPlugin_js_1.GraphPlugin {
516
+ constructor() {
517
+ super('test.serialized_set');
518
+ }
519
+ build() {
520
+ return {
521
+ namedRules: {
522
+ remove: new RemoveNode_js_1.RemoveNode({ node: { any: true } }),
523
+ },
524
+ namedRuleSets: {
525
+ wrapper: {
526
+ rules: [{ namedRule: 'remove' }],
527
+ },
528
+ },
529
+ phases: [
530
+ {
531
+ phase: 'main',
532
+ rules: [{ namedRuleSet: 'wrapper' }],
533
+ },
534
+ ],
535
+ };
536
+ }
537
+ }
538
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
539
+ 'test.serialized_set': new SerializedRuleSetPlugin(),
540
+ });
541
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
542
+ plugins: [{ plugin: 'test.serialized_set' }],
543
+ pluginRegistry,
544
+ });
545
+ const serialized = result.namedRuleSets
546
+ .resolve('test.serialized_set.wrapper')
547
+ .serialize();
548
+ expect(serialized.rules).toEqual([
549
+ { namedRule: 'test.serialized_set.remove' },
550
+ ]);
551
+ });
552
+ it('shoud keep unmapped references inside serialized rule sets', () => {
553
+ class ExternalRefsRuleSetPlugin extends GraphPlugin_js_1.GraphPlugin {
554
+ constructor() {
555
+ super('test.external_ruleset');
556
+ }
557
+ build() {
558
+ return {
559
+ namedRuleSets: {
560
+ wrapper: {
561
+ rules: [
562
+ { namedRule: 'shared.rule' },
563
+ { namedRuleSet: 'shared.set' },
564
+ {
565
+ id: 'RemoveNode',
566
+ config: { node: { any: true } },
567
+ },
568
+ ],
569
+ },
570
+ },
571
+ };
572
+ }
573
+ }
574
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
575
+ 'test.external_ruleset': new ExternalRefsRuleSetPlugin(),
576
+ });
577
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
578
+ plugins: [{ plugin: 'test.external_ruleset' }],
579
+ pluginRegistry,
580
+ });
581
+ const serialized = result.namedRuleSets
582
+ .resolve('test.external_ruleset.wrapper')
583
+ .serialize();
584
+ expect(serialized.rules).toEqual([
585
+ { namedRule: 'shared.rule' },
586
+ { namedRuleSet: 'shared.set' },
587
+ {
588
+ id: 'RemoveNode',
589
+ config: { node: { any: true } },
590
+ },
591
+ ]);
592
+ });
593
+ it('shoud prefix named rule set references inside serialized rule sets', () => {
594
+ class NestedRuleSetPlugin extends GraphPlugin_js_1.GraphPlugin {
595
+ constructor() {
596
+ super('test.nested_ruleset');
597
+ }
598
+ build() {
599
+ return {
600
+ namedRuleSets: {
601
+ inner: {
602
+ rules: [],
603
+ },
604
+ outer: {
605
+ rules: [{ namedRuleSet: 'inner' }],
606
+ },
607
+ },
608
+ };
609
+ }
610
+ }
611
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
612
+ 'test.nested_ruleset': new NestedRuleSetPlugin(),
613
+ });
614
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
615
+ plugins: [{ plugin: 'test.nested_ruleset' }],
616
+ pluginRegistry,
617
+ });
618
+ const serialized = result.namedRuleSets
619
+ .resolve('test.nested_ruleset.outer')
620
+ .serialize();
621
+ expect(serialized.rules).toEqual([
622
+ { namedRuleSet: 'test.nested_ruleset.inner' },
623
+ ]);
624
+ });
625
+ it('shoud fall back to unprefixed named rules when map misses entries', () => {
626
+ const originalGet = Map.prototype.get;
627
+ Map.prototype.get = function (key) {
628
+ if (key === 'fallback-rule') {
629
+ return undefined;
630
+ }
631
+ return originalGet.call(this, key);
632
+ };
633
+ try {
634
+ class FallbackRulePlugin extends GraphPlugin_js_1.GraphPlugin {
635
+ constructor() {
636
+ super('test.fallback_rule');
637
+ }
638
+ build() {
639
+ return {
640
+ namedRules: {
641
+ 'fallback-rule': new RemoveNode_js_1.RemoveNode({ node: { any: true } }),
642
+ },
643
+ };
644
+ }
645
+ }
646
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
647
+ 'test.fallback_rule': new FallbackRulePlugin(),
648
+ });
649
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
650
+ plugins: [{ plugin: 'test.fallback_rule' }],
651
+ pluginRegistry,
652
+ });
653
+ expect(result.namedRules.names()).toEqual(['fallback-rule']);
654
+ }
655
+ finally {
656
+ Map.prototype.get = originalGet;
657
+ }
658
+ });
659
+ it('shoud fall back to unprefixed named rule sets when map misses entries', () => {
660
+ const originalGet = Map.prototype.get;
661
+ Map.prototype.get = function (key) {
662
+ if (key === 'fallback-set') {
663
+ return undefined;
664
+ }
665
+ return originalGet.call(this, key);
666
+ };
667
+ try {
668
+ class FallbackRuleSetPlugin extends GraphPlugin_js_1.GraphPlugin {
669
+ constructor() {
670
+ super('test.fallback_set');
671
+ }
672
+ build() {
673
+ return {
674
+ namedRuleSets: {
675
+ 'fallback-set': new RuleSet_js_1.RuleSet(),
676
+ },
677
+ };
678
+ }
679
+ }
680
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
681
+ 'test.fallback_set': new FallbackRuleSetPlugin(),
682
+ });
683
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
684
+ plugins: [{ plugin: 'test.fallback_set' }],
685
+ pluginRegistry,
686
+ });
687
+ expect(result.namedRuleSets.names()).toEqual(['fallback-set']);
688
+ }
689
+ finally {
690
+ Map.prototype.get = originalGet;
691
+ }
692
+ });
693
+ it('shoud allow serialized rule sets without rules', () => {
694
+ class EmptyRuleSetPlugin extends GraphPlugin_js_1.GraphPlugin {
695
+ constructor() {
696
+ super('test.empty_ruleset');
697
+ }
698
+ build() {
699
+ return {
700
+ namedRuleSets: {
701
+ empty: {},
702
+ },
703
+ };
704
+ }
705
+ }
706
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
707
+ 'test.empty_ruleset': new EmptyRuleSetPlugin(),
708
+ });
709
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
710
+ plugins: [{ plugin: 'test.empty_ruleset' }],
711
+ pluginRegistry,
712
+ });
713
+ const serialized = result.namedRuleSets
714
+ .resolve('test.empty_ruleset.empty')
715
+ .serialize();
716
+ expect(serialized.rules).toEqual([]);
717
+ });
718
+ it('shoud pass through serialized phase rules unchanged', () => {
719
+ class SerializedPhasePlugin extends GraphPlugin_js_1.GraphPlugin {
720
+ constructor() {
721
+ super('test.serial_phase');
722
+ }
723
+ build() {
724
+ return {
725
+ phases: [
726
+ {
727
+ phase: 'main',
728
+ rules: [
729
+ {
730
+ id: 'RemoveNode',
731
+ config: { node: { any: true } },
732
+ },
733
+ ],
734
+ },
735
+ ],
736
+ };
737
+ }
738
+ }
739
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
740
+ 'test.serial_phase': new SerializedPhasePlugin(),
741
+ });
742
+ const result = (0, GraphPlugin_js_1.resolveGraphPlugins)({
743
+ plugins: [{ plugin: 'test.serial_phase' }],
744
+ pluginRegistry,
745
+ });
746
+ expect(result.phases).toEqual([
747
+ {
748
+ phase: 'main',
749
+ rules: [
750
+ {
751
+ id: 'RemoveNode',
752
+ config: { node: { any: true } },
753
+ },
754
+ ],
755
+ },
756
+ ]);
757
+ });
758
+ it('shoud throw when plugin phases include unsupported names', () => {
759
+ class InvalidPhasePlugin extends GraphPlugin_js_1.GraphPlugin {
760
+ constructor() {
761
+ super('test.invalid_phase');
762
+ }
763
+ build() {
764
+ const invalidPhase = {
765
+ phase: 'invalid',
766
+ rules: [],
767
+ };
768
+ return {
769
+ phases: [invalidPhase],
770
+ };
771
+ }
772
+ }
773
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
774
+ 'test.invalid_phase': new InvalidPhasePlugin(),
775
+ });
776
+ expect(() => (0, GraphPlugin_js_1.resolveGraphPlugins)({
777
+ plugins: [{ plugin: 'test.invalid_phase' }],
778
+ pluginRegistry,
779
+ })).toThrow("GraphPlugin phases contains unsupported phase 'invalid'");
780
+ });
781
+ it('shoud throw when plugin reference is not registered', () => {
782
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry();
783
+ expect(() => (0, GraphPlugin_js_1.resolveGraphPlugins)({
784
+ plugins: [{ plugin: 'unknown.plugin' }],
785
+ pluginRegistry,
786
+ })).toThrow("GraphPlugin 'unknown.plugin' is not registered");
787
+ });
788
+ it('shoud pass through non-object options to plugin build', () => {
789
+ class ObjectlessPlugin extends GraphPlugin_js_1.GraphPlugin {
790
+ captured;
791
+ constructor() {
792
+ super('test.objectless');
793
+ }
794
+ build({ options, }) {
795
+ this.captured = options;
796
+ return {};
797
+ }
798
+ }
799
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
800
+ 'test.objectless': new ObjectlessPlugin(),
801
+ });
802
+ (0, GraphPlugin_js_1.resolveGraphPlugins)({
803
+ plugins: [{ plugin: 'test.objectless', options: 'raw' }],
804
+ pluginRegistry,
805
+ });
806
+ const resolved = pluginRegistry.resolve('test.objectless');
807
+ expect(resolved.captured).toBe('raw');
808
+ });
809
+ it('shoud pass through non-object plugin defaults when no options are provided', () => {
810
+ class DefaultPlugin extends GraphPlugin_js_1.GraphPlugin {
811
+ captured;
812
+ constructor() {
813
+ // biome-ignore lint/suspicious/noExplicitAny: test setup for branch coverage
814
+ super('test.string_default', 'default');
815
+ }
816
+ build({ options, }) {
817
+ this.captured = options;
818
+ return {};
819
+ }
820
+ }
821
+ const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
822
+ 'test.string_default': new DefaultPlugin(),
823
+ });
824
+ (0, GraphPlugin_js_1.resolveGraphPlugins)({
825
+ plugins: [{ plugin: 'test.string_default' }],
826
+ pluginRegistry,
827
+ });
828
+ const resolved = pluginRegistry.resolve('test.string_default');
829
+ expect(resolved.captured).toBe('default');
830
+ });
831
+ });