@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,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuntimeConfigLoader = void 0;
|
|
4
|
+
const RuntimeCatalogFromConfigBuilder_js_1 = require("./RuntimeCatalogBuilder/RuntimeCatalogFromConfigBuilder.js");
|
|
5
|
+
const RuntimeConfigParserRegistry_js_1 = require("./RuntimeConfigParserRegistry.js");
|
|
6
|
+
const RuntimeConfigSource_js_1 = require("./RuntimeConfigSource.js");
|
|
7
|
+
const ZodRuntimeConfigValidator_js_1 = require("./RuntimeConfigValidator/ZodRuntimeConfigValidator.js");
|
|
8
|
+
const ModuleRuntimeProviderLoader_js_1 = require("./RuntimeProviderLoader/ModuleRuntimeProviderLoader.js");
|
|
9
|
+
class RuntimeConfigLoader {
|
|
10
|
+
parserRegistry;
|
|
11
|
+
validator;
|
|
12
|
+
catalogBuilder;
|
|
13
|
+
providerLoader;
|
|
14
|
+
baseProviders;
|
|
15
|
+
constructor(dependencies = {}) {
|
|
16
|
+
this.parserRegistry =
|
|
17
|
+
dependencies.parserRegistry ?? RuntimeConfigParserRegistry_js_1.RuntimeConfigParserRegistry.defaults();
|
|
18
|
+
this.validator = dependencies.validator ?? new ZodRuntimeConfigValidator_js_1.ZodRuntimeConfigValidator();
|
|
19
|
+
this.catalogBuilder =
|
|
20
|
+
dependencies.catalogBuilder ??
|
|
21
|
+
new RuntimeCatalogFromConfigBuilder_js_1.RuntimeCatalogFromConfigBuilder();
|
|
22
|
+
this.providerLoader =
|
|
23
|
+
dependencies.providerLoader ?? new ModuleRuntimeProviderLoader_js_1.ModuleRuntimeProviderLoader();
|
|
24
|
+
this.baseProviders = Object.freeze([...(dependencies.baseProviders ?? [])]);
|
|
25
|
+
}
|
|
26
|
+
async load(input) {
|
|
27
|
+
const document = await input.source.read();
|
|
28
|
+
const format = document.format ??
|
|
29
|
+
(0, RuntimeConfigSource_js_1.inferRuntimeConfigFormatFromReference)(document.reference);
|
|
30
|
+
if (!format) {
|
|
31
|
+
const from = document.reference ? ` from '${document.reference}'` : '';
|
|
32
|
+
throw new Error(`Unable to determine runtime config format${from}`);
|
|
33
|
+
}
|
|
34
|
+
let parsed;
|
|
35
|
+
try {
|
|
36
|
+
parsed = this.parserRegistry.resolve(format).parse(document.content);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
40
|
+
throw new Error(`Failed to parse runtime config as '${format}': ${message}`);
|
|
41
|
+
}
|
|
42
|
+
let config;
|
|
43
|
+
try {
|
|
44
|
+
config = this.validator.validate(parsed);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
48
|
+
throw new Error(`Runtime config validation failed: ${message}`);
|
|
49
|
+
}
|
|
50
|
+
const loadedProviders = await this.loadProviders(config.providers ?? [], document.reference);
|
|
51
|
+
const providers = [...this.baseProviders, ...loadedProviders];
|
|
52
|
+
const supportedAdapterOperationsRegistry = this.mergeSupportedAdapterOperationsRegistry([
|
|
53
|
+
...providers.map((provider) => provider.supportedAdapterOperationsRegistry),
|
|
54
|
+
]);
|
|
55
|
+
const catalog = this.catalogBuilder.build({
|
|
56
|
+
providers,
|
|
57
|
+
config,
|
|
58
|
+
supportedAdapterOperationsRegistry,
|
|
59
|
+
});
|
|
60
|
+
return { catalog, config };
|
|
61
|
+
}
|
|
62
|
+
async loadProviders(providerReferences, sourceReference) {
|
|
63
|
+
const uniqueSpecifiers = [...new Set(providerReferences)];
|
|
64
|
+
const loadedProviders = [];
|
|
65
|
+
for (const specifier of uniqueSpecifiers) {
|
|
66
|
+
try {
|
|
67
|
+
loadedProviders.push(await this.providerLoader.load({
|
|
68
|
+
specifier,
|
|
69
|
+
sourceReference,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
74
|
+
throw new Error(`Failed to load runtime provider '${specifier}': ${message}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return loadedProviders;
|
|
78
|
+
}
|
|
79
|
+
mergeSupportedAdapterOperationsRegistry(registries) {
|
|
80
|
+
const merged = registries.reduce((acc, registry) => {
|
|
81
|
+
if (!registry) {
|
|
82
|
+
return acc;
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
// biome-ignore lint/performance/noAccumulatingSpread: <explanation>
|
|
86
|
+
...acc,
|
|
87
|
+
...registry,
|
|
88
|
+
};
|
|
89
|
+
}, {});
|
|
90
|
+
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.RuntimeConfigLoader = RuntimeConfigLoader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const promises_1 = require("node:fs/promises");
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const DotAdapter_js_1 = require("../Graph/Adapters/DotAdapter.js");
|
|
7
|
+
const Profile_js_1 = require("../Graph/Profile.js");
|
|
8
|
+
const ProfileRegistry_js_1 = require("../Graph/ProfileRegistry.js");
|
|
9
|
+
const NamedRuleRegistry_js_1 = require("../Graph/Rules/NamedRuleRegistry.js");
|
|
10
|
+
const NamedRuleSetRegistry_js_1 = require("../Graph/Rules/NamedRuleSetRegistry.js");
|
|
11
|
+
const RemoveNode_js_1 = require("../Graph/Rules/Node/RemoveNode.js");
|
|
12
|
+
const RuntimeConfigLoader_js_1 = require("./RuntimeConfigLoader.js");
|
|
13
|
+
const RuntimeConfigParserRegistry_js_1 = require("./RuntimeConfigParserRegistry.js");
|
|
14
|
+
const FileRuntimeConfigSource_js_1 = require("./RuntimeConfigSource/FileRuntimeConfigSource.js");
|
|
15
|
+
const InMemoryRuntimeConfigSource_js_1 = require("./RuntimeConfigSource/InMemoryRuntimeConfigSource.js");
|
|
16
|
+
describe('RuntimeConfigParserRegistry.resolve', () => {
|
|
17
|
+
it('shoud resolve default json and yaml parsers', () => {
|
|
18
|
+
const registry = RuntimeConfigParserRegistry_js_1.RuntimeConfigParserRegistry.defaults();
|
|
19
|
+
expect(registry.resolve('json').parse('{"a":1}')).toEqual({ a: 1 });
|
|
20
|
+
expect(registry.resolve('yaml').parse('value: ok')).toEqual({
|
|
21
|
+
value: 'ok',
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
it('shoud throw when no parser is registered for a format', () => {
|
|
25
|
+
const registry = RuntimeConfigParserRegistry_js_1.RuntimeConfigParserRegistry.defaults();
|
|
26
|
+
expect(() => registry.resolve('toml')).toThrow("No RuntimeConfigParser registered for format 'toml'");
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
describe('FileRuntimeConfigSource.read', () => {
|
|
30
|
+
it('shoud read file contents and infer format from file extension', async () => {
|
|
31
|
+
const dir = await (0, promises_1.mkdtemp)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'runtime-config-loader-'));
|
|
32
|
+
const filePath = (0, node_path_1.join)(dir, 'runtime.json');
|
|
33
|
+
await (0, promises_1.writeFile)(filePath, '{"profiles":{}}', 'utf8');
|
|
34
|
+
try {
|
|
35
|
+
const source = new FileRuntimeConfigSource_js_1.FileRuntimeConfigSource(filePath);
|
|
36
|
+
const doc = await source.read();
|
|
37
|
+
expect(doc.content).toBe('{"profiles":{}}');
|
|
38
|
+
expect(doc.format).toBe('json');
|
|
39
|
+
expect(doc.reference).toBe(filePath);
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
await (0, promises_1.rm)(dir, { recursive: true, force: true });
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe('RuntimeConfigLoader.load', () => {
|
|
47
|
+
it('shoud load a runtime catalog from in-memory json config', async () => {
|
|
48
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource(JSON.stringify({
|
|
49
|
+
namedRules: {
|
|
50
|
+
removeAlways: {
|
|
51
|
+
id: RemoveNode_js_1.RemoveNode.name,
|
|
52
|
+
config: { node: { any: true } },
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
profiles: {
|
|
56
|
+
profile: {
|
|
57
|
+
phases: [{ phase: 'main', rules: [{ namedRule: 'removeAlways' }] }],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}));
|
|
61
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader();
|
|
62
|
+
const loaded = await loader.load({ source });
|
|
63
|
+
const phases = loaded.catalog.resolveProfilePhases('profile');
|
|
64
|
+
expect(phases).toHaveLength(1);
|
|
65
|
+
expect(phases[0]).toHaveLength(1);
|
|
66
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
67
|
+
id: 'RemoveNode',
|
|
68
|
+
config: { node: { any: true } },
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
it('shoud load a runtime catalog from in-memory yaml config', async () => {
|
|
72
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource(`
|
|
73
|
+
namedRules:
|
|
74
|
+
removeAlways:
|
|
75
|
+
id: RemoveNode
|
|
76
|
+
config:
|
|
77
|
+
node:
|
|
78
|
+
any: true
|
|
79
|
+
profiles:
|
|
80
|
+
profile:
|
|
81
|
+
phases:
|
|
82
|
+
- phase: main
|
|
83
|
+
rules:
|
|
84
|
+
- namedRule: removeAlways
|
|
85
|
+
`, 'yaml');
|
|
86
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader();
|
|
87
|
+
const loaded = await loader.load({ source });
|
|
88
|
+
const phases = loaded.catalog.resolveProfilePhases('profile');
|
|
89
|
+
expect(phases).toHaveLength(1);
|
|
90
|
+
expect(phases[0]).toHaveLength(1);
|
|
91
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
92
|
+
id: 'RemoveNode',
|
|
93
|
+
config: { node: { any: true } },
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
it('shoud fail when runtime config schema validation fails', async () => {
|
|
97
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource(JSON.stringify({
|
|
98
|
+
profiles: {
|
|
99
|
+
profile: {
|
|
100
|
+
phases: [{ phase: 'invalid_phase', rules: [] }],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
}));
|
|
104
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader();
|
|
105
|
+
await expect(loader.load({ source })).rejects.toThrow(/Runtime config validation failed:/);
|
|
106
|
+
});
|
|
107
|
+
it('shoud support custom parsers via dependency injection', async () => {
|
|
108
|
+
class FakeYamlParser {
|
|
109
|
+
supports(format) {
|
|
110
|
+
return format === 'yaml';
|
|
111
|
+
}
|
|
112
|
+
parse(_content) {
|
|
113
|
+
return {
|
|
114
|
+
namedRules: {
|
|
115
|
+
removeAlways: {
|
|
116
|
+
id: RemoveNode_js_1.RemoveNode.name,
|
|
117
|
+
config: { node: { any: true } },
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
profiles: {
|
|
121
|
+
profile: {
|
|
122
|
+
phases: [
|
|
123
|
+
{ phase: 'main', rules: [{ namedRule: 'removeAlways' }] },
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const parserRegistry = new RuntimeConfigParserRegistry_js_1.RuntimeConfigParserRegistry([
|
|
131
|
+
new FakeYamlParser(),
|
|
132
|
+
]);
|
|
133
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader({ parserRegistry });
|
|
134
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource('profiles:\n profile: {}', 'yaml');
|
|
135
|
+
const loaded = await loader.load({ source });
|
|
136
|
+
const phases = loaded.catalog.resolveProfilePhases('profile');
|
|
137
|
+
expect(phases).toHaveLength(1);
|
|
138
|
+
expect(phases[0]).toHaveLength(1);
|
|
139
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
140
|
+
id: 'RemoveNode',
|
|
141
|
+
config: { node: { any: true } },
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
it('shoud infer the config format from the source reference', async () => {
|
|
145
|
+
class ReferencedSource {
|
|
146
|
+
async read() {
|
|
147
|
+
return {
|
|
148
|
+
content: JSON.stringify({
|
|
149
|
+
profiles: {
|
|
150
|
+
profile: { phases: [] },
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
153
|
+
reference: '/tmp/runtime.json',
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader();
|
|
158
|
+
const loaded = await loader.load({ source: new ReferencedSource() });
|
|
159
|
+
expect(loaded.catalog.resolveProfilePhases('profile')).toEqual([]);
|
|
160
|
+
});
|
|
161
|
+
it('shoud fail when source format is unknown', async () => {
|
|
162
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource('{}', 'custom');
|
|
163
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader();
|
|
164
|
+
await expect(loader.load({ source })).rejects.toThrow("Failed to parse runtime config as 'custom': No RuntimeConfigParser registered for format 'custom'");
|
|
165
|
+
});
|
|
166
|
+
it('shoud fail when runtime config format cannot be inferred', async () => {
|
|
167
|
+
class UnknownFormatSource {
|
|
168
|
+
async read() {
|
|
169
|
+
return { content: '{}' };
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const source = new UnknownFormatSource();
|
|
173
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader();
|
|
174
|
+
await expect(loader.load({ source })).rejects.toThrow('Unable to determine runtime config format');
|
|
175
|
+
});
|
|
176
|
+
it('shoud include the source reference when format inference fails', async () => {
|
|
177
|
+
class UnknownReferencedSource {
|
|
178
|
+
async read() {
|
|
179
|
+
return { content: '{}', reference: '/tmp/runtime.unknown' };
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader();
|
|
183
|
+
await expect(loader.load({ source: new UnknownReferencedSource() })).rejects.toThrow("Unable to determine runtime config format from '/tmp/runtime.unknown'");
|
|
184
|
+
});
|
|
185
|
+
it('shoud surface non-error parser failures', async () => {
|
|
186
|
+
class ThrowingParser {
|
|
187
|
+
supports(format) {
|
|
188
|
+
return format === 'json';
|
|
189
|
+
}
|
|
190
|
+
parse(_content) {
|
|
191
|
+
throw 'parser-failed';
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const parserRegistry = new RuntimeConfigParserRegistry_js_1.RuntimeConfigParserRegistry([
|
|
195
|
+
new ThrowingParser(),
|
|
196
|
+
]);
|
|
197
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader({ parserRegistry });
|
|
198
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource('{}', 'json');
|
|
199
|
+
await expect(loader.load({ source })).rejects.toThrow("Failed to parse runtime config as 'json': parser-failed");
|
|
200
|
+
});
|
|
201
|
+
it('shoud surface non-error validation failures', async () => {
|
|
202
|
+
const validator = {
|
|
203
|
+
validate(_input) {
|
|
204
|
+
throw 'validation-failed';
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader({ validator });
|
|
208
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource('{}', 'json');
|
|
209
|
+
await expect(loader.load({ source })).rejects.toThrow('Runtime config validation failed: validation-failed');
|
|
210
|
+
});
|
|
211
|
+
it('shoud surface non-error provider load failures', async () => {
|
|
212
|
+
class ThrowingProviderLoader {
|
|
213
|
+
async load(_input) {
|
|
214
|
+
throw 'provider-failed';
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader({
|
|
218
|
+
providerLoader: new ThrowingProviderLoader(),
|
|
219
|
+
});
|
|
220
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource(JSON.stringify({
|
|
221
|
+
providers: ['@example/runtime-provider'],
|
|
222
|
+
profiles: {
|
|
223
|
+
profile: {
|
|
224
|
+
phases: [],
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
}), 'json');
|
|
228
|
+
await expect(loader.load({ source })).rejects.toThrow("Failed to load runtime provider '@example/runtime-provider': provider-failed");
|
|
229
|
+
});
|
|
230
|
+
it('shoud return validated config alongside catalog with load', async () => {
|
|
231
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource(JSON.stringify({
|
|
232
|
+
profiles: {
|
|
233
|
+
profile: {
|
|
234
|
+
phases: [],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
run: {
|
|
238
|
+
profile: 'profile',
|
|
239
|
+
},
|
|
240
|
+
}));
|
|
241
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader();
|
|
242
|
+
const loaded = await loader.load({ source });
|
|
243
|
+
expect(loaded.config.run?.profile).toBe('profile');
|
|
244
|
+
expect(loaded.catalog.resolveProfilePhases('profile')).toEqual([]);
|
|
245
|
+
});
|
|
246
|
+
it('shoud load runtime providers declared in config and merge adapter support registries', async () => {
|
|
247
|
+
class FakeRuntimeProviderLoader {
|
|
248
|
+
async load(_input) {
|
|
249
|
+
return {
|
|
250
|
+
supportedAdapterOperationsRegistry: {
|
|
251
|
+
ExternalDotAdapter: DotAdapter_js_1.DotAdapter,
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource(JSON.stringify({
|
|
257
|
+
providers: ['@example/runtime-provider'],
|
|
258
|
+
profiles: {
|
|
259
|
+
profile: {
|
|
260
|
+
supports: 'ExternalDotAdapter',
|
|
261
|
+
phases: [],
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
}), 'json', '/tmp/runtime.json');
|
|
265
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader({
|
|
266
|
+
providerLoader: new FakeRuntimeProviderLoader(),
|
|
267
|
+
});
|
|
268
|
+
const loaded = await loader.load({ source });
|
|
269
|
+
const profile = loaded.catalog.resolveProfile('profile');
|
|
270
|
+
expect(profile.supports).toBe(DotAdapter_js_1.DotAdapter);
|
|
271
|
+
});
|
|
272
|
+
it('shoud merge base provider adapter support registries configured on the loader', async () => {
|
|
273
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource(JSON.stringify({
|
|
274
|
+
profiles: {
|
|
275
|
+
profile: {
|
|
276
|
+
supports: 'ExternalDotAdapter',
|
|
277
|
+
phases: [],
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
}), 'json', '/tmp/runtime.json');
|
|
281
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader({
|
|
282
|
+
baseProviders: [
|
|
283
|
+
{
|
|
284
|
+
supportedAdapterOperationsRegistry: {
|
|
285
|
+
ExternalDotAdapter: DotAdapter_js_1.DotAdapter,
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
});
|
|
290
|
+
const loaded = await loader.load({ source });
|
|
291
|
+
const profile = loaded.catalog.resolveProfile('profile');
|
|
292
|
+
expect(profile.supports).toBe(DotAdapter_js_1.DotAdapter);
|
|
293
|
+
});
|
|
294
|
+
it('shoud merge provider catalog contributions declared in config', async () => {
|
|
295
|
+
class FakeRuntimeProviderLoader {
|
|
296
|
+
async load(_input) {
|
|
297
|
+
return {
|
|
298
|
+
namedRules: new NamedRuleRegistry_js_1.NamedRuleRegistry({
|
|
299
|
+
removeAlways: new RemoveNode_js_1.RemoveNode({
|
|
300
|
+
node: { any: true },
|
|
301
|
+
}),
|
|
302
|
+
}),
|
|
303
|
+
namedRuleSets: new NamedRuleSetRegistry_js_1.NamedRuleSetRegistry({
|
|
304
|
+
wrapper: {
|
|
305
|
+
rules: [{ namedRule: 'removeAlways' }],
|
|
306
|
+
},
|
|
307
|
+
}),
|
|
308
|
+
profiles: new ProfileRegistry_js_1.ProfileRegistry({
|
|
309
|
+
'provider.profile': new Profile_js_1.Profile('provider.profile', {
|
|
310
|
+
phases: [{ phase: 'main', rules: [{ namedRuleSet: 'wrapper' }] }],
|
|
311
|
+
}),
|
|
312
|
+
}),
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource(JSON.stringify({
|
|
317
|
+
providers: ['@example/runtime-provider'],
|
|
318
|
+
}), 'json', '/tmp/runtime.json');
|
|
319
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader({
|
|
320
|
+
providerLoader: new FakeRuntimeProviderLoader(),
|
|
321
|
+
});
|
|
322
|
+
const loaded = await loader.load({ source });
|
|
323
|
+
const phases = loaded.catalog.resolveProfilePhases('provider.profile');
|
|
324
|
+
expect(phases).toHaveLength(1);
|
|
325
|
+
expect(phases[0]).toHaveLength(1);
|
|
326
|
+
expect(phases[0][0].serialize()).toEqual({
|
|
327
|
+
id: 'RemoveNode',
|
|
328
|
+
config: { node: { any: true } },
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
it('shoud throw a contextual error when loading a runtime provider fails', async () => {
|
|
332
|
+
class ThrowingRuntimeProviderLoader {
|
|
333
|
+
async load(_input) {
|
|
334
|
+
throw new Error('boom');
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
const source = new InMemoryRuntimeConfigSource_js_1.InMemoryRuntimeConfigSource(JSON.stringify({
|
|
338
|
+
providers: ['@example/broken-provider'],
|
|
339
|
+
}), 'json', '/tmp/runtime.json');
|
|
340
|
+
const loader = new RuntimeConfigLoader_js_1.RuntimeConfigLoader({
|
|
341
|
+
providerLoader: new ThrowingRuntimeProviderLoader(),
|
|
342
|
+
});
|
|
343
|
+
await expect(loader.load({ source })).rejects.toThrow("Failed to load runtime provider '@example/broken-provider': boom");
|
|
344
|
+
});
|
|
345
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.JsonRuntimeConfigParser = void 0;
|
|
4
|
+
const RuntimeConfigParser_js_1 = require("../RuntimeConfigParser.js");
|
|
5
|
+
class JsonRuntimeConfigParser {
|
|
6
|
+
supports(format) {
|
|
7
|
+
const normalized = (0, RuntimeConfigParser_js_1.normalizeRuntimeConfigParserFormat)(format);
|
|
8
|
+
return (normalized === 'json' ||
|
|
9
|
+
normalized === '.json' ||
|
|
10
|
+
normalized === 'application/json');
|
|
11
|
+
}
|
|
12
|
+
parse(content) {
|
|
13
|
+
return JSON.parse(content);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.JsonRuntimeConfigParser = JsonRuntimeConfigParser;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const JsonRuntimeConfigParser_js_1 = require("./JsonRuntimeConfigParser.js");
|
|
4
|
+
describe('JsonRuntimeConfigParser.supports', () => {
|
|
5
|
+
it('shoud support json aliases', () => {
|
|
6
|
+
const parser = new JsonRuntimeConfigParser_js_1.JsonRuntimeConfigParser();
|
|
7
|
+
expect(parser.supports('json')).toBe(true);
|
|
8
|
+
expect(parser.supports('.json')).toBe(true);
|
|
9
|
+
expect(parser.supports('application/json')).toBe(true);
|
|
10
|
+
expect(parser.supports('yaml')).toBe(false);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
describe('JsonRuntimeConfigParser.parse', () => {
|
|
14
|
+
it('shoud parse json content into an object', () => {
|
|
15
|
+
const parser = new JsonRuntimeConfigParser_js_1.JsonRuntimeConfigParser();
|
|
16
|
+
expect(parser.parse('{"value":1}')).toEqual({ value: 1 });
|
|
17
|
+
});
|
|
18
|
+
it('shoud throw when json is invalid', () => {
|
|
19
|
+
const parser = new JsonRuntimeConfigParser_js_1.JsonRuntimeConfigParser();
|
|
20
|
+
expect(() => parser.parse('{invalid-json')).toThrow();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.YamlRuntimeConfigParser = void 0;
|
|
4
|
+
const yaml_1 = require("yaml");
|
|
5
|
+
const RuntimeConfigParser_js_1 = require("../RuntimeConfigParser.js");
|
|
6
|
+
class YamlRuntimeConfigParser {
|
|
7
|
+
supports(format) {
|
|
8
|
+
const normalized = (0, RuntimeConfigParser_js_1.normalizeRuntimeConfigParserFormat)(format);
|
|
9
|
+
return (normalized === 'yaml' ||
|
|
10
|
+
normalized === '.yaml' ||
|
|
11
|
+
normalized === '.yml' ||
|
|
12
|
+
normalized === 'application/yaml' ||
|
|
13
|
+
normalized === 'application/x-yaml' ||
|
|
14
|
+
normalized === 'text/yaml');
|
|
15
|
+
}
|
|
16
|
+
parse(content) {
|
|
17
|
+
return (0, yaml_1.parse)(content);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.YamlRuntimeConfigParser = YamlRuntimeConfigParser;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const YamlRuntimeConfigParser_js_1 = require("./YamlRuntimeConfigParser.js");
|
|
4
|
+
describe('YamlRuntimeConfigParser.supports', () => {
|
|
5
|
+
it('shoud support yaml aliases and mime types', () => {
|
|
6
|
+
const parser = new YamlRuntimeConfigParser_js_1.YamlRuntimeConfigParser();
|
|
7
|
+
expect(parser.supports('yaml')).toBe(true);
|
|
8
|
+
expect(parser.supports('.yaml')).toBe(true);
|
|
9
|
+
expect(parser.supports('.yml')).toBe(true);
|
|
10
|
+
expect(parser.supports('application/yaml')).toBe(true);
|
|
11
|
+
expect(parser.supports('application/x-yaml')).toBe(true);
|
|
12
|
+
expect(parser.supports('text/yaml')).toBe(true);
|
|
13
|
+
expect(parser.supports('json')).toBe(false);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
describe('YamlRuntimeConfigParser.parse', () => {
|
|
17
|
+
it('shoud parse yaml documents into objects', () => {
|
|
18
|
+
const parser = new YamlRuntimeConfigParser_js_1.YamlRuntimeConfigParser();
|
|
19
|
+
expect(parser.parse('profiles:\n test:\n phases: []')).toEqual({
|
|
20
|
+
profiles: {
|
|
21
|
+
test: {
|
|
22
|
+
phases: [],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
it('shoud throw when yaml is invalid', () => {
|
|
28
|
+
const parser = new YamlRuntimeConfigParser_js_1.YamlRuntimeConfigParser();
|
|
29
|
+
expect(() => parser.parse('profiles: [')).toThrow();
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./JsonRuntimeConfigParser.js"), exports);
|
|
18
|
+
__exportStar(require("./YamlRuntimeConfigParser.js"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeRuntimeConfigParserFormat = void 0;
|
|
4
|
+
const RuntimeConfigSource_js_1 = require("./RuntimeConfigSource.js");
|
|
5
|
+
const normalizeRuntimeConfigParserFormat = (format) => (0, RuntimeConfigSource_js_1.normalizeRuntimeConfigFormat)(format);
|
|
6
|
+
exports.normalizeRuntimeConfigParserFormat = normalizeRuntimeConfigParserFormat;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const RuntimeConfigParser_js_1 = require("./RuntimeConfigParser.js");
|
|
4
|
+
describe('RuntimeConfigParser.normalizeRuntimeConfigParserFormat', () => {
|
|
5
|
+
it('shoud normalize parser format values by trimming and lowering case', () => {
|
|
6
|
+
expect((0, RuntimeConfigParser_js_1.normalizeRuntimeConfigParserFormat)(' APPLICATION/JSON ')).toBe('application/json');
|
|
7
|
+
});
|
|
8
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RuntimeConfigParser } from './RuntimeConfigParser.js';
|
|
2
|
+
export declare class RuntimeConfigParserRegistry {
|
|
3
|
+
private readonly parsers;
|
|
4
|
+
constructor(parsers?: RuntimeConfigParser[]);
|
|
5
|
+
static defaults(): RuntimeConfigParserRegistry;
|
|
6
|
+
register(parser: RuntimeConfigParser): RuntimeConfigParserRegistry;
|
|
7
|
+
use(registry: RuntimeConfigParserRegistry): RuntimeConfigParserRegistry;
|
|
8
|
+
resolve(format: string): RuntimeConfigParser;
|
|
9
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuntimeConfigParserRegistry = void 0;
|
|
4
|
+
const RuntimeConfigParser_js_1 = require("./RuntimeConfigParser.js");
|
|
5
|
+
const JsonRuntimeConfigParser_js_1 = require("./RuntimeConfigParser/JsonRuntimeConfigParser.js");
|
|
6
|
+
const YamlRuntimeConfigParser_js_1 = require("./RuntimeConfigParser/YamlRuntimeConfigParser.js");
|
|
7
|
+
class RuntimeConfigParserRegistry {
|
|
8
|
+
parsers;
|
|
9
|
+
constructor(parsers = []) {
|
|
10
|
+
this.parsers = Object.freeze([...parsers]);
|
|
11
|
+
}
|
|
12
|
+
static defaults() {
|
|
13
|
+
return new RuntimeConfigParserRegistry([
|
|
14
|
+
new JsonRuntimeConfigParser_js_1.JsonRuntimeConfigParser(),
|
|
15
|
+
new YamlRuntimeConfigParser_js_1.YamlRuntimeConfigParser(),
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
18
|
+
register(parser) {
|
|
19
|
+
return new RuntimeConfigParserRegistry([...this.parsers, parser]);
|
|
20
|
+
}
|
|
21
|
+
use(registry) {
|
|
22
|
+
return new RuntimeConfigParserRegistry([
|
|
23
|
+
...this.parsers,
|
|
24
|
+
...registry.parsers,
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
resolve(format) {
|
|
28
|
+
const normalized = (0, RuntimeConfigParser_js_1.normalizeRuntimeConfigParserFormat)(format);
|
|
29
|
+
const parser = this.parsers.find((candidate) => candidate.supports(normalized));
|
|
30
|
+
if (!parser) {
|
|
31
|
+
throw new Error(`No RuntimeConfigParser registered for format '${format}'`);
|
|
32
|
+
}
|
|
33
|
+
return parser;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.RuntimeConfigParserRegistry = RuntimeConfigParserRegistry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|