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