import { InversifyContainerFacade } from '../../InversifyContainerFacade'; import { ContainerModule, interfaces } from 'inversify'; import { ServiceIdentifiers } from '../../ServiceIdentifiers'; import { ICustomNode } from '../../../interfaces/custom-nodes/ICustomNode'; import { ICustomNodeGroup } from '../../../interfaces/custom-nodes/ICustomNodeGroup'; import { ControlFlowCustomNode } from "../../../enums/custom-nodes/ControlFlowCustomNode"; import { CustomNode } from '../../../enums/custom-nodes/CustomNode'; import { CustomNodeGroup } from '../../../enums/custom-nodes/CustomNodeGroup'; import { ConsoleOutputCustomNodeGroup } from '../../../custom-nodes/console-output-nodes/group/ConsoleOutputCustomNodeGroup'; import { DebugProtectionCustomNodeGroup } from '../../../custom-nodes/debug-protection-nodes/group/DebugProtectionCustomNodeGroup'; import { DomainLockCustomNodeGroup } from '../../../custom-nodes/domain-lock-nodes/group/DomainLockCustomNodeGroup'; import { SelfDefendingCustomNodeGroup } from '../../../custom-nodes/self-defending-nodes/group/SelfDefendingCustomNodeGroup'; import { StringArrayCustomNodeGroup } from '../../../custom-nodes/string-array-nodes/group/StringArrayCustomNodeGroup'; import { BinaryExpressionFunctionNode } from '../../../custom-nodes/control-flow-flattening-nodes/BinaryExpressionFunctionNode'; import { BlockStatementControlFlowFlatteningNode } from '../../../custom-nodes/control-flow-flattening-nodes/BlockStatementControlFlowFlatteningNode'; import { CallExpressionControlFlowStorageCallNode } from '../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/CallExpressionControlFlowStorageCallNode'; import { CallExpressionFunctionNode } from '../../../custom-nodes/control-flow-flattening-nodes/CallExpressionFunctionNode'; import { ControlFlowStorageNode } from '../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ControlFlowStorageNode'; import { ConsoleOutputDisableExpressionNode } from '../../../custom-nodes/console-output-nodes/ConsoleOutputDisableExpressionNode'; import { DebugProtectionFunctionCallNode } from '../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionCallNode'; import { DebugProtectionFunctionIntervalNode } from '../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionIntervalNode'; import { DebugProtectionFunctionNode } from '../../../custom-nodes/debug-protection-nodes/DebugProtectionFunctionNode'; import { DomainLockNode } from '../../../custom-nodes/domain-lock-nodes/DomainLockNode'; import { ExpressionWithOperatorControlFlowStorageCallNode } from '../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/ExpressionWithOperatorControlFlowStorageCallNode'; import { LogicalExpressionFunctionNode } from '../../../custom-nodes/control-flow-flattening-nodes/LogicalExpressionFunctionNode'; import { NodeCallsControllerFunctionNode } from '../../../custom-nodes/node-calls-controller-nodes/NodeCallsControllerFunctionNode'; import { SelfDefendingUnicodeNode } from '../../../custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode'; import { StringArrayCallsWrapper } from '../../../custom-nodes/string-array-nodes/StringArrayCallsWrapper'; import { StringArrayNode } from '../../../custom-nodes/string-array-nodes/StringArrayNode'; import { StringArrayRotateFunctionNode } from '../../../custom-nodes/string-array-nodes/StringArrayRotateFunctionNode'; import { StringLiteralControlFlowStorageCallNode } from '../../../custom-nodes/control-flow-flattening-nodes/control-flow-storage-nodes/StringLiteralControlFlowStorageCallNode'; import { StringLiteralNode } from '../../../custom-nodes/control-flow-flattening-nodes/StringLiteralNode'; export const customNodesModule: interfaces.ContainerModule = new ContainerModule((bind: interfaces.Bind) => { // custom nodes bind(ServiceIdentifiers.ICustomNode) .to(ConsoleOutputDisableExpressionNode) .whenTargetNamed(CustomNode.ConsoleOutputDisableExpressionNode); bind(ServiceIdentifiers.ICustomNode) .to(DebugProtectionFunctionCallNode) .whenTargetNamed(CustomNode.DebugProtectionFunctionCallNode); bind(ServiceIdentifiers.ICustomNode) .to(DebugProtectionFunctionIntervalNode) .whenTargetNamed(CustomNode.DebugProtectionFunctionIntervalNode); bind(ServiceIdentifiers.ICustomNode) .to(DebugProtectionFunctionNode) .whenTargetNamed(CustomNode.DebugProtectionFunctionNode); bind(ServiceIdentifiers.ICustomNode) .to(DomainLockNode) .whenTargetNamed(CustomNode.DomainLockNode); bind(ServiceIdentifiers.ICustomNode) .to(NodeCallsControllerFunctionNode) .whenTargetNamed(CustomNode.NodeCallsControllerFunctionNode); bind(ServiceIdentifiers.ICustomNode) .to(SelfDefendingUnicodeNode) .whenTargetNamed(CustomNode.SelfDefendingUnicodeNode); bind(ServiceIdentifiers.ICustomNode) .to(StringArrayCallsWrapper) .whenTargetNamed(CustomNode.StringArrayCallsWrapper); bind(ServiceIdentifiers.ICustomNode) .to(StringArrayNode) .whenTargetNamed(CustomNode.StringArrayNode); bind(ServiceIdentifiers.ICustomNode) .to(StringArrayRotateFunctionNode) .whenTargetNamed(CustomNode.StringArrayRotateFunctionNode); // control flow custom nodes bind>(ServiceIdentifiers.Newable__ICustomNode) .toConstructor(BinaryExpressionFunctionNode) .whenTargetNamed(ControlFlowCustomNode.BinaryExpressionFunctionNode); bind>(ServiceIdentifiers.Newable__ICustomNode) .toConstructor(BlockStatementControlFlowFlatteningNode) .whenTargetNamed(ControlFlowCustomNode.BlockStatementControlFlowFlatteningNode); bind>(ServiceIdentifiers.Newable__ICustomNode) .toConstructor(CallExpressionControlFlowStorageCallNode) .whenTargetNamed(ControlFlowCustomNode.CallExpressionControlFlowStorageCallNode); bind>(ServiceIdentifiers.Newable__ICustomNode) .toConstructor(CallExpressionFunctionNode) .whenTargetNamed(ControlFlowCustomNode.CallExpressionFunctionNode); bind>(ServiceIdentifiers.Newable__ICustomNode) .toConstructor(ControlFlowStorageNode) .whenTargetNamed(ControlFlowCustomNode.ControlFlowStorageNode); bind>(ServiceIdentifiers.Newable__ICustomNode) .toConstructor(ExpressionWithOperatorControlFlowStorageCallNode) .whenTargetNamed(ControlFlowCustomNode.ExpressionWithOperatorControlFlowStorageCallNode); bind>(ServiceIdentifiers.Newable__ICustomNode) .toConstructor(LogicalExpressionFunctionNode) .whenTargetNamed(ControlFlowCustomNode.LogicalExpressionFunctionNode); bind>(ServiceIdentifiers.Newable__ICustomNode) .toConstructor(StringLiteralNode) .whenTargetNamed(ControlFlowCustomNode.StringLiteralNode); bind>(ServiceIdentifiers.Newable__ICustomNode) .toConstructor(StringLiteralControlFlowStorageCallNode) .whenTargetNamed(ControlFlowCustomNode.StringLiteralControlFlowStorageCallNode); // node groups bind(ServiceIdentifiers.ICustomNodeGroup) .to(ConsoleOutputCustomNodeGroup) .whenTargetNamed(CustomNodeGroup.ConsoleOutputCustomNodeGroup); bind(ServiceIdentifiers.ICustomNodeGroup) .to(DebugProtectionCustomNodeGroup) .whenTargetNamed(CustomNodeGroup.DebugProtectionCustomNodeGroup); bind(ServiceIdentifiers.ICustomNodeGroup) .to(DomainLockCustomNodeGroup) .whenTargetNamed(CustomNodeGroup.DomainLockCustomNodeGroup); bind(ServiceIdentifiers.ICustomNodeGroup) .to(SelfDefendingCustomNodeGroup) .whenTargetNamed(CustomNodeGroup.SelfDefendingCustomNodeGroup); bind(ServiceIdentifiers.ICustomNodeGroup) .to(StringArrayCustomNodeGroup) .whenTargetNamed(CustomNodeGroup.StringArrayCustomNodeGroup); // customNode factory bind(ServiceIdentifiers.Factory__ICustomNode) .toFactory(InversifyContainerFacade .getFactory(ServiceIdentifiers.ICustomNode)); // control flow storage customNode constructor factory bind(ServiceIdentifiers.Factory__IControlFlowCustomNode) .toFactory(InversifyContainerFacade .getConstructorFactory( ServiceIdentifiers.Newable__ICustomNode, ServiceIdentifiers.IRandomGenerator, ServiceIdentifiers.IOptions )); // customNodeGroup factory bind(ServiceIdentifiers.Factory__ICustomNodeGroup) .toFactory(InversifyContainerFacade .getFactory(ServiceIdentifiers.ICustomNodeGroup)); });