diff --git a/api/app/core/workflow/nodes/code/config.py b/api/app/core/workflow/nodes/code/config.py index 8af13f12..a47586a3 100644 --- a/api/app/core/workflow/nodes/code/config.py +++ b/api/app/core/workflow/nodes/code/config.py @@ -44,7 +44,7 @@ class CodeNodeConfig(BaseNodeConfig): description="code content" ) - language: Literal['python3', 'nodejs'] = Field( + language: Literal['python3', 'javascript'] = Field( ..., description="language" ) diff --git a/api/app/core/workflow/nodes/code/node.py b/api/app/core/workflow/nodes/code/node.py index 892708f2..019fec84 100644 --- a/api/app/core/workflow/nodes/code/node.py +++ b/api/app/core/workflow/nodes/code/node.py @@ -110,7 +110,7 @@ class CodeNode(BaseNode): code=code, inputs_variable=input_variable_dict, ) - elif self.typed_config.language == 'nodejs': + elif self.typed_config.language == 'javascript': final_script = NODEJS_SCRIPT_TEMPLATE.substitute( code=code, inputs_variable=input_variable_dict, diff --git a/sandbox/app/controllers/sandbox_controller.py b/sandbox/app/controllers/sandbox_controller.py index c5cce40c..f9bc3fc0 100644 --- a/sandbox/app/controllers/sandbox_controller.py +++ b/sandbox/app/controllers/sandbox_controller.py @@ -33,7 +33,7 @@ async def run_code(request: RunCodeRequest): """Execute code in sandbox""" if request.language == "python3": return await run_python_code(request.code, request.preload, request.options) - elif request.language == "nodejs": + elif request.language == "javascript": return await run_nodejs_code(request.code, request.preload, request.options) else: return error_response(-400, "unsupported language")