From ff0feaf34ea76c91165c548970ae265d7d30e972 Mon Sep 17 00:00:00 2001 From: Yeuoly <45712896+Yeuoly@users.noreply.github.com> Date: Thu, 15 May 2025 13:59:43 +0800 Subject: [PATCH 01/13] fix: handle EndpointSetupFailedError in BasePluginClient (#19613) --- api/core/plugin/endpoint/exc.py | 6 ++++++ api/core/plugin/impl/base.py | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 api/core/plugin/endpoint/exc.py diff --git a/api/core/plugin/endpoint/exc.py b/api/core/plugin/endpoint/exc.py new file mode 100644 index 0000000000..aa29f1e9a1 --- /dev/null +++ b/api/core/plugin/endpoint/exc.py @@ -0,0 +1,6 @@ +class EndpointSetupFailedError(ValueError): + """ + Endpoint setup failed error + """ + + pass diff --git a/api/core/plugin/impl/base.py b/api/core/plugin/impl/base.py index 4f1d808a3e..591e7b0525 100644 --- a/api/core/plugin/impl/base.py +++ b/api/core/plugin/impl/base.py @@ -17,6 +17,7 @@ from core.model_runtime.errors.invoke import ( InvokeServerUnavailableError, ) from core.model_runtime.errors.validate import CredentialsValidateFailedError +from core.plugin.endpoint.exc import EndpointSetupFailedError from core.plugin.entities.plugin_daemon import PluginDaemonBasicResponse, PluginDaemonError, PluginDaemonInnerError from core.plugin.impl.exc import ( PluginDaemonBadRequestError, @@ -219,6 +220,8 @@ class BasePluginClient: raise InvokeServerUnavailableError(description=args.get("description")) case CredentialsValidateFailedError.__name__: raise CredentialsValidateFailedError(error_object.get("message")) + case EndpointSetupFailedError.__name__: + raise EndpointSetupFailedError(error_object.get("message")) case _: raise PluginInvokeError(description=message) case PluginDaemonInternalServerError.__name__: From bd7094b9f52b7165518fb20b4a0065c06d44ea0c Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 15 May 2025 14:13:49 +0800 Subject: [PATCH 02/13] chore: image allow "data:" in csp (#19728) --- web/middleware.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/middleware.ts b/web/middleware.ts index 01c78f1956..ac016945fd 100644 --- a/web/middleware.ts +++ b/web/middleware.ts @@ -37,7 +37,7 @@ export function middleware(request: NextRequest) { style-src 'self' 'unsafe-inline' ${scheme_source} ${whiteList}; worker-src 'self' ${scheme_source} ${csp} ${whiteList}; media-src 'self' ${scheme_source} ${csp} ${whiteList}; - img-src *; + img-src * data:; font-src 'self'; object-src 'none'; base-uri 'self'; From 95467a3f0b1bc62d9ef33cbb0a5381577591722e Mon Sep 17 00:00:00 2001 From: crazywoola <100913391+crazywoola@users.noreply.github.com> Date: Thu, 15 May 2025 14:37:00 +0800 Subject: [PATCH 03/13] fix: broken behavior of rendering (#19732) --- web/app/components/workflow/nodes/assigner/default.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/nodes/assigner/default.ts b/web/app/components/workflow/nodes/assigner/default.ts index 32dac73b36..cabf18af77 100644 --- a/web/app/components/workflow/nodes/assigner/default.ts +++ b/web/app/components/workflow/nodes/assigner/default.ts @@ -51,11 +51,12 @@ const nodeDefault: NodeDefault = { checkVarValid(payload: AssignerNodeType, varMap: Record, t: any) { const errorMessageArr: string[] = [] - const variables_warnings = getNotExistVariablesByArray(payload.items.map(item => item.variable_selector ?? []) ?? [], varMap) + const items = payload.items ?? [] + const variables_warnings = getNotExistVariablesByArray(items.map(item => item.variable_selector ?? []) ?? [], varMap) if (variables_warnings.length) errorMessageArr.push(`${t('workflow.nodes.assigner.assignedVariable')} ${t('workflow.common.referenceVar')}${variables_warnings.join('、')}${t('workflow.common.noExist')}`) - const value_warnings = getNotExistVariablesByArray(payload.items.map(item => item.value ?? []) ?? [], varMap) + const value_warnings = getNotExistVariablesByArray(items.map(item => item.value ?? []) ?? [], varMap) if (value_warnings.length) errorMessageArr.push(`${t('workflow.nodes.assigner.setVariable')} ${t('workflow.common.referenceVar')}${value_warnings.join('、')}${t('workflow.common.noExist')}`) From 6d7f43b901780e092438769777768b58c33eec0c Mon Sep 17 00:00:00 2001 From: Nite Knite Date: Thu, 15 May 2025 14:57:19 +0800 Subject: [PATCH 04/13] feat: update email templates (#19739) --- api/templates/clean_document_job_mail_template-US.html | 2 +- api/templates/delete_account_code_email_template_en-US.html | 2 +- api/templates/delete_account_success_template_en-US.html | 2 +- api/templates/email_code_login_mail_template_en-US.html | 2 +- api/templates/email_code_login_mail_template_zh-CN.html | 2 +- api/templates/invite_member_mail_template_en-US.html | 2 +- api/templates/invite_member_mail_template_zh-CN.html | 2 +- api/templates/reset_password_mail_template_en-US.html | 2 +- api/templates/reset_password_mail_template_zh-CN.html | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/templates/clean_document_job_mail_template-US.html b/api/templates/clean_document_job_mail_template-US.html index 0f7ddc62a9..2d8f78b46a 100644 --- a/api/templates/clean_document_job_mail_template-US.html +++ b/api/templates/clean_document_job_mail_template-US.html @@ -69,7 +69,7 @@