Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
switch (transport) {
case TransportMedium.Websocket:
bind(TYPES.ModelSource).to(ExampleWebsocketDiagramServer).inSingletonScope();
break;
case TransportMedium.LSP:
bind(TYPES.ModelSource).to(VSCodeWebViewDiagramServer).inSingletonScope();
break;
default:
bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
}
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, ExampleGraphView);
configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
configureModelElement(context, 'node:bean', BeanNode, BeanNodeView);
configureModelElement(context, 'node:label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
configureViewerOptions(context, {
needsClientLayout: true,
needsServerLayout: true,
baseDiv: clientId,
});
console.log('di.config.ts : ' + clientId);
});
break;
case TransportMedium.LSP:
bind(TYPES.ModelSource).to(VSCodeWebViewDiagramServer).inSingletonScope();
break;
default:
bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
}
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, ExampleGraphView);
configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
configureModelElement(context, 'node:bean', BeanNode, BeanNodeView);
configureModelElement(context, 'node:label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
configureViewerOptions(context, {
needsClientLayout: true,
needsServerLayout: true,
baseDiv: clientId,
});
console.log('di.config.ts : ' + clientId);
});
bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
}
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, ExampleGraphView);
configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
configureModelElement(context, 'node:integration', RectangularNode, IntegrationNodeView, {disable: [boundsFeature]});
configureModelElement(context, 'node:channel', RectangularNode, ChannelNodeView);
configureModelElement(context, 'node:label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
configureModelElement(context, 'input-port', RectangularPort, PortView);
configureModelElement(context, 'output-port', RectangularPort, PortView);
configureModelElement(context, 'error-port', RectangularPort, ErrorPortView);
configureViewerOptions(context, {
needsClientLayout: true,
needsServerLayout: true,
baseDiv: clientId,
});
});
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.warn);
rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, SGraphView);
configureModelElement(context, 'node', DependencyGraphNode, DependencyNodeView, {
disable: [moveFeature]
});
configureModelElement(context, 'edge', DependencyGraphEdge, DependencyEdgeView, {
disable: [editFeature]
});
configureModelElement(context, 'label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
if (additionalBindings) {
additionalBindings(bind, unbind, isBound, rebind);
}
});
const integrationGaphModule = new ContainerModule((bind, unbind, isBound, rebind) => {
switch (transport) {
case TransportMedium.Websocket:
bind(TYPES.ModelSource).to(ExampleWebsocketDiagramServer).inSingletonScope();
break;
case TransportMedium.LSP:
bind(TYPES.ModelSource).to(VSCodeWebViewDiagramServer).inSingletonScope();
break;
default:
bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
}
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, ExampleGraphView);
configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
configureModelElement(context, 'node:integration', RectangularNode, IntegrationNodeView, {disable: [boundsFeature]});
configureModelElement(context, 'node:channel', RectangularNode, ChannelNodeView);
configureModelElement(context, 'node:label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
configureModelElement(context, 'input-port', RectangularPort, PortView);
configureModelElement(context, 'output-port', RectangularPort, PortView);
configureModelElement(context, 'error-port', RectangularPort, ErrorPortView);
configureViewerOptions(context, {
needsClientLayout: true,
needsServerLayout: true,
baseDiv: clientId,
});
});
default:
bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
}
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, ExampleGraphView);
configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
configureModelElement(context, 'node:integration', RectangularNode, IntegrationNodeView, {disable: [boundsFeature]});
configureModelElement(context, 'node:channel', RectangularNode, ChannelNodeView);
configureModelElement(context, 'node:label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
configureModelElement(context, 'input-port', RectangularPort, PortView);
configureModelElement(context, 'output-port', RectangularPort, PortView);
configureModelElement(context, 'error-port', RectangularPort, ErrorPortView);
configureViewerOptions(context, {
needsClientLayout: true,
needsServerLayout: true,
baseDiv: clientId,
});
});
const depGraphModule = new ContainerModule((bind, unbind, isBound, rebind) => {
bind(DependencyGraphFilter).toSelf();
bind(IGraphGenerator).to(NpmDependencyGraphGenerator).inSingletonScope();
bind(TYPES.ModelSource).to(DepGraphModelSource).inSingletonScope();
rebind(ILayoutConfigurator).to(DepGraphLayoutConfigurator);
bind(TYPES.IPopupModelProvider).to(PopupModelProvider);
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.warn);
rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, SGraphView);
configureModelElement(context, 'node', DependencyGraphNode, DependencyNodeView, {
disable: [moveFeature]
});
configureModelElement(context, 'edge', DependencyGraphEdge, DependencyEdgeView, {
disable: [editFeature]
});
configureModelElement(context, 'label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
if (additionalBindings) {
additionalBindings(bind, unbind, isBound, rebind);
}
});
switch (transport) {
case TransportMedium.Websocket:
bind(TYPES.ModelSource).to(ExampleWebsocketDiagramServer).inSingletonScope();
break;
case TransportMedium.LSP:
bind(TYPES.ModelSource).to(VSCodeWebViewDiagramServer).inSingletonScope();
break;
default:
bind(TYPES.ModelSource).to(LocalModelSource).inSingletonScope();
}
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.log);
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, ExampleGraphView);
configureModelElement(context, 'node:circle', CircularNode, CircleNodeView);
configureModelElement(context, 'node:integration', RectangularNode, IntegrationNodeView, {disable: [boundsFeature]});
configureModelElement(context, 'node:channel', RectangularNode, ChannelNodeView);
configureModelElement(context, 'node:label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'edge:straight', /*OrthogonalEgde*/ SEdge, EdgeView);
configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
configureModelElement(context, 'input-port', RectangularPort, PortView);
configureModelElement(context, 'output-port', RectangularPort, PortView);
configureModelElement(context, 'error-port', RectangularPort, ErrorPortView);
configureViewerOptions(context, {
needsClientLayout: true,
needsServerLayout: true,
baseDiv: clientId,
});
});
bind(TYPES.ModelSource).to(DepGraphModelSource).inSingletonScope();
rebind(ILayoutConfigurator).to(DepGraphLayoutConfigurator);
bind(TYPES.IPopupModelProvider).to(PopupModelProvider);
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.warn);
rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, SGraphView);
configureModelElement(context, 'node', DependencyGraphNode, DependencyNodeView, {
disable: [moveFeature]
});
configureModelElement(context, 'edge', DependencyGraphEdge, DependencyEdgeView, {
disable: [editFeature]
});
configureModelElement(context, 'label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
if (additionalBindings) {
additionalBindings(bind, unbind, isBound, rebind);
}
});
bind(TYPES.IPopupModelProvider).to(PopupModelProvider);
rebind(TYPES.ILogger).to(ConsoleLogger).inSingletonScope();
rebind(TYPES.LogLevel).toConstantValue(LogLevel.warn);
rebind(TYPES.IModelFactory).to(SGraphFactory).inSingletonScope();
const context = { bind, unbind, isBound, rebind };
configureModelElement(context, 'graph', SGraph, SGraphView);
configureModelElement(context, 'node', DependencyGraphNode, DependencyNodeView, {
disable: [moveFeature]
});
configureModelElement(context, 'edge', DependencyGraphEdge, DependencyEdgeView, {
disable: [editFeature]
});
configureModelElement(context, 'label', SLabel, SLabelView);
configureModelElement(context, 'compartment', SCompartment, SCompartmentView);
configureModelElement(context, 'html', HtmlRoot, HtmlRootView);
configureModelElement(context, 'pre-rendered', PreRenderedElement, PreRenderedView);
if (additionalBindings) {
additionalBindings(bind, unbind, isBound, rebind);
}
});