@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,841 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const DotAdapter_js_1 = require("./Adapters/DotAdapter.js");
|
|
4
|
+
const GraphologyAdapter_js_1 = require("./Adapters/GraphologyAdapter.js");
|
|
5
|
+
const GraphPlugin_js_1 = require("./GraphPlugin.js");
|
|
6
|
+
const NodeQuery_js_1 = require("./Operations/Matchers/NodeQuery/NodeQuery.js");
|
|
7
|
+
const Profile_js_1 = require("./Profile.js");
|
|
8
|
+
const NamedRuleRegistry_js_1 = require("./Rules/NamedRuleRegistry.js");
|
|
9
|
+
const NamedRuleSetRegistry_js_1 = require("./Rules/NamedRuleSetRegistry.js");
|
|
10
|
+
const Rule_js_1 = require("./Rules/Rule.js");
|
|
11
|
+
const RuleSet_js_1 = require("./Rules/RuleSet.js");
|
|
12
|
+
class AlwaysMatchRule extends Rule_js_1.NodeRule {
|
|
13
|
+
apply(nodeId, _node, graph) {
|
|
14
|
+
return graph.removeNode(nodeId);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
Rule_js_1.NodeRule.register(AlwaysMatchRule);
|
|
18
|
+
const createAlwaysMatch = (query) => new AlwaysMatchRule({
|
|
19
|
+
node: (query ?? NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', exists: true } })).getDsl(),
|
|
20
|
+
});
|
|
21
|
+
class RemoveLabelPlugin extends GraphPlugin_js_1.GraphPlugin {
|
|
22
|
+
constructor() {
|
|
23
|
+
super('test.remove_label', { label: 'default' });
|
|
24
|
+
}
|
|
25
|
+
build({ options, }) {
|
|
26
|
+
return {
|
|
27
|
+
namedRules: {
|
|
28
|
+
remove_label: createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: options.label } })),
|
|
29
|
+
},
|
|
30
|
+
namedRuleSets: {
|
|
31
|
+
remove_label_set: new RuleSet_js_1.RuleSet({
|
|
32
|
+
rules: [{ namedRule: 'remove_label' }],
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
phases: [
|
|
36
|
+
{
|
|
37
|
+
phase: 'main',
|
|
38
|
+
rules: [{ namedRuleSet: 'remove_label_set' }],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const pluginRegistry = new GraphPlugin_js_1.GraphPluginRegistry({
|
|
45
|
+
'test.remove_label': new RemoveLabelPlugin(),
|
|
46
|
+
});
|
|
47
|
+
describe('Profile.serialize', () => {
|
|
48
|
+
it('shoud serialize rules and operations type', () => {
|
|
49
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
50
|
+
supports: GraphologyAdapter_js_1.GraphologyAdapter,
|
|
51
|
+
phases: [
|
|
52
|
+
{
|
|
53
|
+
phase: 'main',
|
|
54
|
+
rules: [
|
|
55
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', exists: true } })),
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
const json = profile.serialize();
|
|
61
|
+
expect(json).toEqual(expect.objectContaining({
|
|
62
|
+
name: 'my-profile',
|
|
63
|
+
supports: 'GraphologyAdapter',
|
|
64
|
+
phases: [
|
|
65
|
+
{
|
|
66
|
+
phase: 'main',
|
|
67
|
+
rules: [
|
|
68
|
+
{
|
|
69
|
+
id: 'AlwaysMatchRule',
|
|
70
|
+
config: {
|
|
71
|
+
node: { attr: { key: 'label', exists: true } },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
usesProfiles: [],
|
|
78
|
+
}));
|
|
79
|
+
});
|
|
80
|
+
it('shoud serialize render options', () => {
|
|
81
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
82
|
+
supports: GraphologyAdapter_js_1.GraphologyAdapter,
|
|
83
|
+
render: {
|
|
84
|
+
options: {
|
|
85
|
+
graph: {
|
|
86
|
+
rankdir: 'TB',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
phases: [],
|
|
91
|
+
});
|
|
92
|
+
const json = profile.serialize();
|
|
93
|
+
expect(json).toEqual(expect.objectContaining({
|
|
94
|
+
name: 'my-profile',
|
|
95
|
+
render: {
|
|
96
|
+
options: {
|
|
97
|
+
graph: {
|
|
98
|
+
rankdir: 'TB',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
}));
|
|
103
|
+
});
|
|
104
|
+
it('shoud serialize render renderer', () => {
|
|
105
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
106
|
+
render: {
|
|
107
|
+
renderer: 'ui-json',
|
|
108
|
+
},
|
|
109
|
+
phases: [],
|
|
110
|
+
});
|
|
111
|
+
const json = profile.serialize();
|
|
112
|
+
expect(json).toEqual(expect.objectContaining({
|
|
113
|
+
name: 'my-profile',
|
|
114
|
+
render: {
|
|
115
|
+
renderer: 'ui-json',
|
|
116
|
+
},
|
|
117
|
+
}));
|
|
118
|
+
});
|
|
119
|
+
it('shoud serialize plugin references but not plugin-resolved phases', () => {
|
|
120
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
121
|
+
plugins: [
|
|
122
|
+
{
|
|
123
|
+
plugin: 'test.remove_label',
|
|
124
|
+
options: { label: 'plugin' },
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
phases: [],
|
|
128
|
+
});
|
|
129
|
+
const json = profile.serialize();
|
|
130
|
+
expect(json.plugins).toStrictEqual([
|
|
131
|
+
{
|
|
132
|
+
plugin: 'test.remove_label',
|
|
133
|
+
options: { label: 'plugin' },
|
|
134
|
+
},
|
|
135
|
+
]);
|
|
136
|
+
expect(json.phases).toStrictEqual([]);
|
|
137
|
+
});
|
|
138
|
+
it('shoud serialize named phases', () => {
|
|
139
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
140
|
+
phases: [
|
|
141
|
+
{
|
|
142
|
+
phase: 'cleanup',
|
|
143
|
+
rules: [
|
|
144
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'cleanup' } })),
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
],
|
|
148
|
+
});
|
|
149
|
+
const json = profile.serialize();
|
|
150
|
+
expect(json.phases).toStrictEqual([
|
|
151
|
+
{
|
|
152
|
+
phase: 'cleanup',
|
|
153
|
+
rules: [
|
|
154
|
+
{
|
|
155
|
+
id: 'AlwaysMatchRule',
|
|
156
|
+
config: { node: { attr: { key: 'label', eq: 'cleanup' } } },
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
]);
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
describe('Profile.deserialize', () => {
|
|
164
|
+
it('shoud deserialize rules', () => {
|
|
165
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
166
|
+
supports: GraphologyAdapter_js_1.GraphologyAdapter,
|
|
167
|
+
phases: [
|
|
168
|
+
{
|
|
169
|
+
phase: 'main',
|
|
170
|
+
rules: [
|
|
171
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', exists: true } })),
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
});
|
|
176
|
+
const json = profile.serialize();
|
|
177
|
+
const restored = Profile_js_1.Profile.deseriaize(json, {
|
|
178
|
+
GraphologyAdapter: GraphologyAdapter_js_1.GraphologyAdapter,
|
|
179
|
+
});
|
|
180
|
+
expect(restored.serialize()).toStrictEqual(json);
|
|
181
|
+
expect(restored.resolvePhases()).toHaveLength(1);
|
|
182
|
+
expect(restored.resolvePhases()[0]).toHaveLength(1);
|
|
183
|
+
});
|
|
184
|
+
it('shoud deserialize plugin references', () => {
|
|
185
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
186
|
+
plugins: [
|
|
187
|
+
{
|
|
188
|
+
plugin: 'test.remove_label',
|
|
189
|
+
options: { label: 'plugin' },
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
});
|
|
193
|
+
const json = profile.serialize();
|
|
194
|
+
const restored = Profile_js_1.Profile.deseriaize(json);
|
|
195
|
+
expect(restored.serialize().plugins).toStrictEqual([
|
|
196
|
+
{
|
|
197
|
+
plugin: 'test.remove_label',
|
|
198
|
+
options: { label: 'plugin' },
|
|
199
|
+
},
|
|
200
|
+
]);
|
|
201
|
+
});
|
|
202
|
+
it('shoud deserialize named phases', () => {
|
|
203
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
204
|
+
phases: [
|
|
205
|
+
{
|
|
206
|
+
phase: 'cleanup',
|
|
207
|
+
rules: [
|
|
208
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'cleanup' } })),
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
});
|
|
213
|
+
const json = profile.serialize();
|
|
214
|
+
const restored = Profile_js_1.Profile.deseriaize(json);
|
|
215
|
+
expect(restored.serialize().phases).toStrictEqual(json.phases);
|
|
216
|
+
});
|
|
217
|
+
it('shoud throw when deserializing unsupported phase names', () => {
|
|
218
|
+
expect(() => Profile_js_1.Profile.deseriaize({
|
|
219
|
+
name: 'invalid-profile',
|
|
220
|
+
phases: [
|
|
221
|
+
{
|
|
222
|
+
phase: 'invalid',
|
|
223
|
+
rules: [],
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
})).toThrow("Profile.phases contains unsupported phase 'invalid'");
|
|
227
|
+
});
|
|
228
|
+
it('shoud throw when supports is not registered during deserialize', () => {
|
|
229
|
+
expect(() => Profile_js_1.Profile.deseriaize({
|
|
230
|
+
name: 'unsupported-profile',
|
|
231
|
+
supports: 'MissingAdapter',
|
|
232
|
+
})).toThrow("Profile.supports ('MissingAdapter') is not registered");
|
|
233
|
+
});
|
|
234
|
+
it('shoud default missing phases and used profiles during deserialize', () => {
|
|
235
|
+
const restored = Profile_js_1.Profile.deseriaize({
|
|
236
|
+
name: 'empty-profile',
|
|
237
|
+
});
|
|
238
|
+
expect(restored.serialize().phases).toEqual([]);
|
|
239
|
+
expect(restored.serialize().usesProfiles).toEqual([]);
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
describe('Profile.resolveRendererOptions', () => {
|
|
243
|
+
it('shoud return undefined when no renderer options are set', () => {
|
|
244
|
+
const profile = new Profile_js_1.Profile('empty', {});
|
|
245
|
+
expect(profile.resolveRendererOptions()).toBeUndefined();
|
|
246
|
+
});
|
|
247
|
+
it('shoud return own renderer options when set', () => {
|
|
248
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
249
|
+
render: {
|
|
250
|
+
options: {
|
|
251
|
+
graph: {
|
|
252
|
+
rankdir: 'LR',
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
});
|
|
257
|
+
expect(profile.resolveRendererOptions()).toEqual({
|
|
258
|
+
graph: {
|
|
259
|
+
rankdir: 'LR',
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
it('shoud resolve renderer options from used profiles', () => {
|
|
264
|
+
const child = new Profile_js_1.Profile('child', {
|
|
265
|
+
render: {
|
|
266
|
+
options: {
|
|
267
|
+
graph: {
|
|
268
|
+
rankdir: 'TB',
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
const parent = new Profile_js_1.Profile('parent', {}).use(child);
|
|
274
|
+
expect(parent.resolveRendererOptions()).toEqual({
|
|
275
|
+
graph: {
|
|
276
|
+
rankdir: 'TB',
|
|
277
|
+
},
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
it('shoud prefer own renderer options over inherited ones', () => {
|
|
281
|
+
const child = new Profile_js_1.Profile('child', {
|
|
282
|
+
render: {
|
|
283
|
+
options: {
|
|
284
|
+
graph: {
|
|
285
|
+
rankdir: 'TB',
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
});
|
|
290
|
+
const parent = new Profile_js_1.Profile('parent', {
|
|
291
|
+
render: {
|
|
292
|
+
options: {
|
|
293
|
+
graph: {
|
|
294
|
+
rankdir: 'LR',
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
}).use(child);
|
|
299
|
+
expect(parent.resolveRendererOptions()).toEqual({
|
|
300
|
+
graph: {
|
|
301
|
+
rankdir: 'LR',
|
|
302
|
+
},
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
});
|
|
306
|
+
describe('Profile.resolveRenderer', () => {
|
|
307
|
+
it('shoud return undefined when no renderer is set', () => {
|
|
308
|
+
const profile = new Profile_js_1.Profile('empty', {});
|
|
309
|
+
expect(profile.resolveRenderer()).toBeUndefined();
|
|
310
|
+
});
|
|
311
|
+
it('shoud return own renderer when set', () => {
|
|
312
|
+
const profile = new Profile_js_1.Profile('my-profile', {
|
|
313
|
+
render: {
|
|
314
|
+
renderer: 'ui-json',
|
|
315
|
+
},
|
|
316
|
+
});
|
|
317
|
+
expect(profile.resolveRenderer()).toBe('ui-json');
|
|
318
|
+
});
|
|
319
|
+
it('shoud resolve renderer from used profiles', () => {
|
|
320
|
+
const child = new Profile_js_1.Profile('child', {
|
|
321
|
+
render: {
|
|
322
|
+
renderer: 'dot',
|
|
323
|
+
},
|
|
324
|
+
});
|
|
325
|
+
const parent = new Profile_js_1.Profile('parent', {}).use(child);
|
|
326
|
+
expect(parent.resolveRenderer()).toBe('dot');
|
|
327
|
+
});
|
|
328
|
+
it('shoud prefer own renderer over inherited ones', () => {
|
|
329
|
+
const child = new Profile_js_1.Profile('child', {
|
|
330
|
+
render: {
|
|
331
|
+
renderer: 'dot',
|
|
332
|
+
},
|
|
333
|
+
});
|
|
334
|
+
const parent = new Profile_js_1.Profile('parent', {
|
|
335
|
+
render: {
|
|
336
|
+
renderer: 'ui-json',
|
|
337
|
+
},
|
|
338
|
+
}).use(child);
|
|
339
|
+
expect(parent.resolveRenderer()).toBe('ui-json');
|
|
340
|
+
});
|
|
341
|
+
});
|
|
342
|
+
describe('Profile.resolvePhases', () => {
|
|
343
|
+
it('shoud accept compatible supports declarations', () => {
|
|
344
|
+
const profile = new Profile_js_1.Profile('supported', {
|
|
345
|
+
supports: GraphologyAdapter_js_1.GraphologyAdapter,
|
|
346
|
+
phases: [],
|
|
347
|
+
});
|
|
348
|
+
expect(profile.resolvePhases()).toEqual([]);
|
|
349
|
+
});
|
|
350
|
+
it('shoud resolve plugin phases at runtime', () => {
|
|
351
|
+
const profile = new Profile_js_1.Profile('plugin-profile', {
|
|
352
|
+
plugins: [
|
|
353
|
+
{
|
|
354
|
+
plugin: 'test.remove_label',
|
|
355
|
+
options: { label: 'plugin' },
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
});
|
|
359
|
+
const phases = profile.resolvePhases(undefined, undefined, pluginRegistry);
|
|
360
|
+
expect(phases).toHaveLength(1);
|
|
361
|
+
expect(phases[0]).toHaveLength(1);
|
|
362
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
363
|
+
id: 'AlwaysMatchRule',
|
|
364
|
+
config: { node: { attr: { key: 'label', eq: 'plugin' } } },
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
it('shoud auto-prefix plugin named rules and named rule sets', () => {
|
|
368
|
+
class PrefixRulePlugin extends GraphPlugin_js_1.GraphPlugin {
|
|
369
|
+
constructor() {
|
|
370
|
+
super('plugin.prefix');
|
|
371
|
+
}
|
|
372
|
+
build() {
|
|
373
|
+
return {
|
|
374
|
+
namedRules: {
|
|
375
|
+
remove: {
|
|
376
|
+
id: 'AlwaysMatchRule',
|
|
377
|
+
config: {
|
|
378
|
+
node: { attr: { key: 'label', eq: 'prefixed' } },
|
|
379
|
+
},
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
namedRuleSets: {
|
|
383
|
+
wrapper: new RuleSet_js_1.RuleSet({
|
|
384
|
+
rules: [{ namedRule: 'remove' }],
|
|
385
|
+
}),
|
|
386
|
+
},
|
|
387
|
+
phases: [
|
|
388
|
+
{
|
|
389
|
+
phase: 'main',
|
|
390
|
+
rules: [{ namedRuleSet: 'wrapper' }],
|
|
391
|
+
},
|
|
392
|
+
],
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
const registry = new GraphPlugin_js_1.GraphPluginRegistry({
|
|
397
|
+
'plugin.prefix': new PrefixRulePlugin(),
|
|
398
|
+
});
|
|
399
|
+
const profile = new Profile_js_1.Profile('plugin-profile', {
|
|
400
|
+
plugins: [{ plugin: 'plugin.prefix' }],
|
|
401
|
+
});
|
|
402
|
+
const phases = profile.resolvePhases(undefined, undefined, registry);
|
|
403
|
+
expect(phases).toHaveLength(1);
|
|
404
|
+
expect(phases[0]).toHaveLength(1);
|
|
405
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
406
|
+
id: 'AlwaysMatchRule',
|
|
407
|
+
config: { node: { attr: { key: 'label', eq: 'prefixed' } } },
|
|
408
|
+
});
|
|
409
|
+
});
|
|
410
|
+
it('shoud resolve plugin phases by named phase order', () => {
|
|
411
|
+
class CleanupPlugin extends GraphPlugin_js_1.GraphPlugin {
|
|
412
|
+
constructor() {
|
|
413
|
+
super('plugin.cleanup');
|
|
414
|
+
}
|
|
415
|
+
build() {
|
|
416
|
+
return {
|
|
417
|
+
namedRules: {
|
|
418
|
+
cleanup: {
|
|
419
|
+
id: 'AlwaysMatchRule',
|
|
420
|
+
config: {
|
|
421
|
+
node: { attr: { key: 'label', eq: 'plugin-cleanup' } },
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
phases: [
|
|
426
|
+
{
|
|
427
|
+
phase: 'cleanup',
|
|
428
|
+
rules: [{ namedRule: 'cleanup' }],
|
|
429
|
+
},
|
|
430
|
+
],
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
const registry = new GraphPlugin_js_1.GraphPluginRegistry({
|
|
435
|
+
'plugin.cleanup': new CleanupPlugin(),
|
|
436
|
+
});
|
|
437
|
+
const profile = new Profile_js_1.Profile('plugin-profile', {
|
|
438
|
+
plugins: [{ plugin: 'plugin.cleanup' }],
|
|
439
|
+
phases: [
|
|
440
|
+
{
|
|
441
|
+
phase: 'main',
|
|
442
|
+
rules: [
|
|
443
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'profile-main' } })),
|
|
444
|
+
],
|
|
445
|
+
},
|
|
446
|
+
],
|
|
447
|
+
});
|
|
448
|
+
const phases = profile.resolvePhases(undefined, undefined, registry);
|
|
449
|
+
expect(phases).toHaveLength(2);
|
|
450
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
451
|
+
id: 'AlwaysMatchRule',
|
|
452
|
+
config: { node: { attr: { key: 'label', eq: 'profile-main' } } },
|
|
453
|
+
});
|
|
454
|
+
expect(phases[1][0].serialize()).toEqual({
|
|
455
|
+
id: 'AlwaysMatchRule',
|
|
456
|
+
config: { node: { attr: { key: 'label', eq: 'plugin-cleanup' } } },
|
|
457
|
+
});
|
|
458
|
+
});
|
|
459
|
+
it('shoud throw when plugins are used without a plugin registry', () => {
|
|
460
|
+
const profile = new Profile_js_1.Profile('plugin-profile', {
|
|
461
|
+
plugins: [{ plugin: 'test.remove_label' }],
|
|
462
|
+
});
|
|
463
|
+
expect(() => profile.resolvePhases()).toThrow("Profile 'plugin-profile' contains plugins but no GraphPluginRegistry was provided");
|
|
464
|
+
});
|
|
465
|
+
it('shoud throw when plugin prefixed names collide', () => {
|
|
466
|
+
const profile = new Profile_js_1.Profile('plugin-profile', {
|
|
467
|
+
plugins: [{ plugin: 'test.remove_label' }],
|
|
468
|
+
});
|
|
469
|
+
const namedRules = new NamedRuleRegistry_js_1.NamedRuleRegistry({
|
|
470
|
+
'test.remove_label.remove_label': {
|
|
471
|
+
id: 'AlwaysMatchRule',
|
|
472
|
+
config: { node: { any: true } },
|
|
473
|
+
},
|
|
474
|
+
});
|
|
475
|
+
expect(() => profile.resolvePhases(namedRules, undefined, pluginRegistry)).toThrow("GraphPlugin 'test.remove_label' named rule 'test.remove_label.remove_label' collides with an existing named rule");
|
|
476
|
+
});
|
|
477
|
+
it('shoud throw when a phase contains an unsupported phase name', () => {
|
|
478
|
+
const profile = new Profile_js_1.Profile('phase-profile', {
|
|
479
|
+
phases: [
|
|
480
|
+
{
|
|
481
|
+
phase: 'invalid',
|
|
482
|
+
rules: [],
|
|
483
|
+
},
|
|
484
|
+
],
|
|
485
|
+
});
|
|
486
|
+
expect(() => profile.resolvePhases()).toThrow("Profile 'phase-profile' contains unsupported phase 'invalid'");
|
|
487
|
+
});
|
|
488
|
+
it('shoud throw when supports is incompatible across used profiles', () => {
|
|
489
|
+
const used = new Profile_js_1.Profile('used', {
|
|
490
|
+
supports: DotAdapter_js_1.DotAdapter,
|
|
491
|
+
});
|
|
492
|
+
const profile = new Profile_js_1.Profile('current', {
|
|
493
|
+
supports: GraphologyAdapter_js_1.GraphologyAdapter,
|
|
494
|
+
}).use(used);
|
|
495
|
+
expect(() => profile.resolvePhases()).toThrow("Profile.supports conflict for ('GraphologyAdapter') (conflicting profiles: used)");
|
|
496
|
+
});
|
|
497
|
+
it('shoud resolve named rules when a registry is provided', () => {
|
|
498
|
+
const registry = new NamedRuleRegistry_js_1.NamedRuleRegistry({
|
|
499
|
+
removeAlways: {
|
|
500
|
+
id: 'AlwaysMatchRule',
|
|
501
|
+
config: { node: { any: true } },
|
|
502
|
+
},
|
|
503
|
+
});
|
|
504
|
+
const profile = new Profile_js_1.Profile('named-profile', {
|
|
505
|
+
phases: [{ phase: 'main', rules: [{ namedRule: 'removeAlways' }] }],
|
|
506
|
+
});
|
|
507
|
+
const phases = profile.resolvePhases(registry);
|
|
508
|
+
expect(phases).toHaveLength(1);
|
|
509
|
+
expect(phases[0]).toHaveLength(1);
|
|
510
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
511
|
+
id: 'AlwaysMatchRule',
|
|
512
|
+
config: { node: { any: true } },
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
it('shoud throw when named rules are used without a registry', () => {
|
|
516
|
+
const profile = new Profile_js_1.Profile('named-profile', {
|
|
517
|
+
phases: [{ phase: 'main', rules: [{ namedRule: 'removeAlways' }] }],
|
|
518
|
+
});
|
|
519
|
+
expect(() => profile.resolvePhases()).toThrow("Profile 'named-profile' contains named rules but no NamedRuleRegistry was provided");
|
|
520
|
+
});
|
|
521
|
+
it('shoud use current named rule definitions after deserialize', () => {
|
|
522
|
+
const profile = new Profile_js_1.Profile('named-profile', {
|
|
523
|
+
phases: [{ phase: 'main', rules: [{ namedRule: 'removeAlways' }] }],
|
|
524
|
+
});
|
|
525
|
+
const serialized = profile.serialize();
|
|
526
|
+
const restored = Profile_js_1.Profile.deseriaize(serialized);
|
|
527
|
+
const updatedRegistry = new NamedRuleRegistry_js_1.NamedRuleRegistry({
|
|
528
|
+
removeAlways: {
|
|
529
|
+
id: 'AlwaysMatchRule',
|
|
530
|
+
config: {
|
|
531
|
+
node: { attr: { key: 'label', startsWith: 'data.' } },
|
|
532
|
+
},
|
|
533
|
+
},
|
|
534
|
+
});
|
|
535
|
+
const phases = restored.resolvePhases(updatedRegistry);
|
|
536
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
537
|
+
id: 'AlwaysMatchRule',
|
|
538
|
+
config: { node: { attr: { key: 'label', startsWith: 'data.' } } },
|
|
539
|
+
});
|
|
540
|
+
});
|
|
541
|
+
it('shoud append own phases after used profile phases', () => {
|
|
542
|
+
const used = new Profile_js_1.Profile('used', {
|
|
543
|
+
phases: [
|
|
544
|
+
{
|
|
545
|
+
phase: 'main',
|
|
546
|
+
rules: [
|
|
547
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'used' } })),
|
|
548
|
+
],
|
|
549
|
+
},
|
|
550
|
+
],
|
|
551
|
+
});
|
|
552
|
+
const current = new Profile_js_1.Profile('current', {
|
|
553
|
+
usesProfiles: [used],
|
|
554
|
+
phases: [
|
|
555
|
+
{
|
|
556
|
+
phase: 'main',
|
|
557
|
+
rules: [
|
|
558
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'current' } })),
|
|
559
|
+
],
|
|
560
|
+
},
|
|
561
|
+
],
|
|
562
|
+
});
|
|
563
|
+
const phases = current.resolvePhases();
|
|
564
|
+
expect(phases).toHaveLength(2);
|
|
565
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
566
|
+
id: 'AlwaysMatchRule',
|
|
567
|
+
config: { node: { attr: { key: 'label', eq: 'used' } } },
|
|
568
|
+
});
|
|
569
|
+
expect(phases[1][0].serialize()).toEqual({
|
|
570
|
+
id: 'AlwaysMatchRule',
|
|
571
|
+
config: { node: { attr: { key: 'label', eq: 'current' } } },
|
|
572
|
+
});
|
|
573
|
+
});
|
|
574
|
+
it('shoud resolve named rule sets when a rule set registry is provided', () => {
|
|
575
|
+
const namedRules = new NamedRuleRegistry_js_1.NamedRuleRegistry({
|
|
576
|
+
removeUsed: {
|
|
577
|
+
id: 'AlwaysMatchRule',
|
|
578
|
+
config: { node: { attr: { key: 'label', eq: 'used' } } },
|
|
579
|
+
},
|
|
580
|
+
removeCurrent: {
|
|
581
|
+
id: 'AlwaysMatchRule',
|
|
582
|
+
config: { node: { attr: { key: 'label', eq: 'current' } } },
|
|
583
|
+
},
|
|
584
|
+
});
|
|
585
|
+
const namedRuleSets = new NamedRuleSetRegistry_js_1.NamedRuleSetRegistry({
|
|
586
|
+
baseSet: new RuleSet_js_1.RuleSet({
|
|
587
|
+
rules: [{ namedRule: 'removeUsed' }],
|
|
588
|
+
}),
|
|
589
|
+
});
|
|
590
|
+
const profile = new Profile_js_1.Profile('named-set-profile', {
|
|
591
|
+
phases: [
|
|
592
|
+
{
|
|
593
|
+
phase: 'main',
|
|
594
|
+
rules: [{ namedRuleSet: 'baseSet' }, { namedRule: 'removeCurrent' }],
|
|
595
|
+
},
|
|
596
|
+
],
|
|
597
|
+
});
|
|
598
|
+
const phases = profile.resolvePhases(namedRules, namedRuleSets);
|
|
599
|
+
expect(phases).toHaveLength(1);
|
|
600
|
+
expect(phases[0]).toHaveLength(2);
|
|
601
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
602
|
+
id: 'AlwaysMatchRule',
|
|
603
|
+
config: { node: { attr: { key: 'label', eq: 'used' } } },
|
|
604
|
+
});
|
|
605
|
+
expect(phases[0][1].serialize()).toEqual({
|
|
606
|
+
id: 'AlwaysMatchRule',
|
|
607
|
+
config: { node: { attr: { key: 'label', eq: 'current' } } },
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
it('shoud resolve serialized rule entries', () => {
|
|
611
|
+
const profile = new Profile_js_1.Profile('serialized-profile', {
|
|
612
|
+
phases: [
|
|
613
|
+
{
|
|
614
|
+
phase: 'main',
|
|
615
|
+
rules: [
|
|
616
|
+
{
|
|
617
|
+
id: 'AlwaysMatchRule',
|
|
618
|
+
config: { node: { any: true } },
|
|
619
|
+
},
|
|
620
|
+
],
|
|
621
|
+
},
|
|
622
|
+
],
|
|
623
|
+
});
|
|
624
|
+
const phases = profile.resolvePhases();
|
|
625
|
+
expect(phases).toHaveLength(1);
|
|
626
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
627
|
+
id: 'AlwaysMatchRule',
|
|
628
|
+
config: { node: { any: true } },
|
|
629
|
+
});
|
|
630
|
+
});
|
|
631
|
+
it('shoud throw when ordering phases with unsupported entries', () => {
|
|
632
|
+
const profile = new Profile_js_1.Profile('phase-profile', {});
|
|
633
|
+
expect(() => profile.orderPhaseEntries([{ phase: 'invalid', rules: [] }])).toThrow("Profile 'phase-profile' contains unsupported phase 'invalid'");
|
|
634
|
+
});
|
|
635
|
+
it('shoud throw when named rule sets resolve multiple phases', () => {
|
|
636
|
+
const profile = new Profile_js_1.Profile('multi-set-profile', {
|
|
637
|
+
phases: [{ phase: 'main', rules: [{ namedRuleSet: 'multi' }] }],
|
|
638
|
+
});
|
|
639
|
+
const namedRuleSets = {
|
|
640
|
+
resolve: () => ({
|
|
641
|
+
resolvePhases: () => [[], []],
|
|
642
|
+
}),
|
|
643
|
+
};
|
|
644
|
+
expect(() => profile.resolvePhases(undefined, namedRuleSets)).toThrow("Profile 'multi-set-profile' references namedRuleSet 'multi' with multiple phases, which cannot be inlined in a single phase");
|
|
645
|
+
});
|
|
646
|
+
it('shoud return empty rules when named rule sets resolve no phases', () => {
|
|
647
|
+
const profile = new Profile_js_1.Profile('empty-set-profile', {
|
|
648
|
+
phases: [{ phase: 'main', rules: [{ namedRuleSet: 'empty' }] }],
|
|
649
|
+
});
|
|
650
|
+
const namedRuleSets = {
|
|
651
|
+
resolve: () => ({
|
|
652
|
+
resolvePhases: () => [],
|
|
653
|
+
}),
|
|
654
|
+
};
|
|
655
|
+
const phases = profile.resolvePhases(undefined, namedRuleSets);
|
|
656
|
+
expect(phases).toEqual([[]]);
|
|
657
|
+
});
|
|
658
|
+
it('shoud handle missing phase buckets during ordering', () => {
|
|
659
|
+
const profile = new Profile_js_1.Profile('phase-profile', {});
|
|
660
|
+
const originalGet = Map.prototype.get;
|
|
661
|
+
Map.prototype.get = function (key) {
|
|
662
|
+
if (key === 'pre') {
|
|
663
|
+
return undefined;
|
|
664
|
+
}
|
|
665
|
+
return originalGet.call(this, key);
|
|
666
|
+
};
|
|
667
|
+
try {
|
|
668
|
+
const ordered = profile.orderPhaseEntries([]);
|
|
669
|
+
expect(ordered).toEqual([]);
|
|
670
|
+
}
|
|
671
|
+
finally {
|
|
672
|
+
Map.prototype.get = originalGet;
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
it('shoud throw when named rule sets are used without a rule set registry', () => {
|
|
676
|
+
const profile = new Profile_js_1.Profile('named-set-profile', {
|
|
677
|
+
phases: [{ phase: 'main', rules: [{ namedRuleSet: 'baseSet' }] }],
|
|
678
|
+
});
|
|
679
|
+
expect(() => profile.resolvePhases()).toThrow("Profile 'named-set-profile' contains named rule sets but no NamedRuleSetRegistry was provided");
|
|
680
|
+
});
|
|
681
|
+
it('shoud resolve nested named rule sets', () => {
|
|
682
|
+
const namedRules = new NamedRuleRegistry_js_1.NamedRuleRegistry({
|
|
683
|
+
removeUsed: {
|
|
684
|
+
id: 'AlwaysMatchRule',
|
|
685
|
+
config: { node: { attr: { key: 'label', eq: 'used' } } },
|
|
686
|
+
},
|
|
687
|
+
removeCurrent: {
|
|
688
|
+
id: 'AlwaysMatchRule',
|
|
689
|
+
config: { node: { attr: { key: 'label', eq: 'current' } } },
|
|
690
|
+
},
|
|
691
|
+
});
|
|
692
|
+
const namedRuleSets = new NamedRuleSetRegistry_js_1.NamedRuleSetRegistry({
|
|
693
|
+
baseSet: new RuleSet_js_1.RuleSet({
|
|
694
|
+
rules: [{ namedRule: 'removeUsed' }],
|
|
695
|
+
}),
|
|
696
|
+
wrapperSet: new RuleSet_js_1.RuleSet({
|
|
697
|
+
rules: [{ namedRuleSet: 'baseSet' }, { namedRule: 'removeCurrent' }],
|
|
698
|
+
}),
|
|
699
|
+
});
|
|
700
|
+
const profile = new Profile_js_1.Profile('named-set-profile', {
|
|
701
|
+
phases: [{ phase: 'main', rules: [{ namedRuleSet: 'wrapperSet' }] }],
|
|
702
|
+
});
|
|
703
|
+
const phases = profile.resolvePhases(namedRules, namedRuleSets);
|
|
704
|
+
expect(phases).toHaveLength(1);
|
|
705
|
+
expect(phases[0]).toHaveLength(2);
|
|
706
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
707
|
+
id: 'AlwaysMatchRule',
|
|
708
|
+
config: { node: { attr: { key: 'label', eq: 'used' } } },
|
|
709
|
+
});
|
|
710
|
+
expect(phases[0][1].serialize()).toEqual({
|
|
711
|
+
id: 'AlwaysMatchRule',
|
|
712
|
+
config: { node: { attr: { key: 'label', eq: 'current' } } },
|
|
713
|
+
});
|
|
714
|
+
});
|
|
715
|
+
it('shoud order phases by named phase sequence', () => {
|
|
716
|
+
const profile = new Profile_js_1.Profile('phase-profile', {
|
|
717
|
+
phases: [
|
|
718
|
+
{
|
|
719
|
+
phase: 'cleanup',
|
|
720
|
+
rules: [
|
|
721
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'cleanup' } })),
|
|
722
|
+
],
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
phase: 'normalize',
|
|
726
|
+
rules: [
|
|
727
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'normalize' } })),
|
|
728
|
+
],
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
phase: 'main',
|
|
732
|
+
rules: [
|
|
733
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'main' } })),
|
|
734
|
+
],
|
|
735
|
+
},
|
|
736
|
+
],
|
|
737
|
+
});
|
|
738
|
+
const phases = profile.resolvePhases();
|
|
739
|
+
expect(phases).toHaveLength(3);
|
|
740
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
741
|
+
id: 'AlwaysMatchRule',
|
|
742
|
+
config: { node: { attr: { key: 'label', eq: 'normalize' } } },
|
|
743
|
+
});
|
|
744
|
+
expect(phases[1][0].serialize()).toEqual({
|
|
745
|
+
id: 'AlwaysMatchRule',
|
|
746
|
+
config: { node: { attr: { key: 'label', eq: 'main' } } },
|
|
747
|
+
});
|
|
748
|
+
expect(phases[2][0].serialize()).toEqual({
|
|
749
|
+
id: 'AlwaysMatchRule',
|
|
750
|
+
config: { node: { attr: { key: 'label', eq: 'cleanup' } } },
|
|
751
|
+
});
|
|
752
|
+
});
|
|
753
|
+
it('shoud run inherited cleanup phases after main phases', () => {
|
|
754
|
+
const used = new Profile_js_1.Profile('used', {
|
|
755
|
+
phases: [
|
|
756
|
+
{
|
|
757
|
+
phase: 'cleanup',
|
|
758
|
+
rules: [
|
|
759
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'used-cleanup' } })),
|
|
760
|
+
],
|
|
761
|
+
},
|
|
762
|
+
],
|
|
763
|
+
});
|
|
764
|
+
const current = new Profile_js_1.Profile('current', {
|
|
765
|
+
usesProfiles: [used],
|
|
766
|
+
phases: [
|
|
767
|
+
{
|
|
768
|
+
phase: 'main',
|
|
769
|
+
rules: [
|
|
770
|
+
createAlwaysMatch(NodeQuery_js_1.NodeQuery.from({ attr: { key: 'label', eq: 'current-main' } })),
|
|
771
|
+
],
|
|
772
|
+
},
|
|
773
|
+
],
|
|
774
|
+
});
|
|
775
|
+
const phases = current.resolvePhases();
|
|
776
|
+
expect(phases).toHaveLength(2);
|
|
777
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
778
|
+
id: 'AlwaysMatchRule',
|
|
779
|
+
config: { node: { attr: { key: 'label', eq: 'current-main' } } },
|
|
780
|
+
});
|
|
781
|
+
expect(phases[1][0].serialize()).toEqual({
|
|
782
|
+
id: 'AlwaysMatchRule',
|
|
783
|
+
config: { node: { attr: { key: 'label', eq: 'used-cleanup' } } },
|
|
784
|
+
});
|
|
785
|
+
});
|
|
786
|
+
});
|
|
787
|
+
describe('Profile.usePlugin', () => {
|
|
788
|
+
it('shoud append plugin references immutably', () => {
|
|
789
|
+
const base = new Profile_js_1.Profile('plugin-profile', {});
|
|
790
|
+
const updated = base.usePlugin('test.remove_label', { label: 'plugin' });
|
|
791
|
+
expect(base.serialize().plugins ?? []).toHaveLength(0);
|
|
792
|
+
expect(updated.serialize().plugins).toStrictEqual([
|
|
793
|
+
{ plugin: 'test.remove_label', options: { label: 'plugin' } },
|
|
794
|
+
]);
|
|
795
|
+
});
|
|
796
|
+
});
|
|
797
|
+
describe('Profile.addPhases', () => {
|
|
798
|
+
it('shoud append phases immutably', () => {
|
|
799
|
+
const base = new Profile_js_1.Profile('base', {
|
|
800
|
+
phases: [{ phase: 'main', rules: [] }],
|
|
801
|
+
});
|
|
802
|
+
const updated = base.addPhases([{ phase: 'cleanup', rules: [] }]);
|
|
803
|
+
expect(base.serialize().phases).toHaveLength(1);
|
|
804
|
+
expect(updated.serialize().phases).toHaveLength(2);
|
|
805
|
+
});
|
|
806
|
+
});
|
|
807
|
+
describe('Profile.use', () => {
|
|
808
|
+
it('shoud append used profiles immutably', () => {
|
|
809
|
+
const base = new Profile_js_1.Profile('base', {});
|
|
810
|
+
const used = new Profile_js_1.Profile('used', {});
|
|
811
|
+
const updated = base.use(used);
|
|
812
|
+
expect(base.serialize().usesProfiles).toHaveLength(0);
|
|
813
|
+
expect(updated.serialize().usesProfiles).toHaveLength(1);
|
|
814
|
+
});
|
|
815
|
+
});
|
|
816
|
+
describe('Profile.serialize (plugins)', () => {
|
|
817
|
+
it('shoud omit plugins when none are configured', () => {
|
|
818
|
+
const profile = new Profile_js_1.Profile('empty', {});
|
|
819
|
+
expect(profile.serialize().plugins).toBeUndefined();
|
|
820
|
+
});
|
|
821
|
+
});
|
|
822
|
+
describe('Profile.resolvePhases (rule-like entries)', () => {
|
|
823
|
+
it('shoud resolve rules that provide a serialize function', () => {
|
|
824
|
+
const ruleLike = {
|
|
825
|
+
serialize: () => ({
|
|
826
|
+
id: 'AlwaysMatchRule',
|
|
827
|
+
config: { node: { any: true } },
|
|
828
|
+
}),
|
|
829
|
+
};
|
|
830
|
+
const profile = new Profile_js_1.Profile('rule-like', {
|
|
831
|
+
phases: [{ phase: 'main', rules: [ruleLike] }],
|
|
832
|
+
});
|
|
833
|
+
const phases = profile.resolvePhases();
|
|
834
|
+
expect(phases).toHaveLength(1);
|
|
835
|
+
expect(phases[0]).toHaveLength(1);
|
|
836
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
837
|
+
id: 'AlwaysMatchRule',
|
|
838
|
+
config: { node: { any: true } },
|
|
839
|
+
});
|
|
840
|
+
});
|
|
841
|
+
});
|