From dbf3b7ad6d768bf28a601c9c785da74cef4b7fe2 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 21 Feb 2024 18:38:52 +0800 Subject: [PATCH] feat: end node typs and mock --- web/app/components/workflow/nodes/end/mock.ts | 18 ++++++++++++++++++ web/app/components/workflow/nodes/end/types.ts | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 web/app/components/workflow/nodes/end/mock.ts create mode 100644 web/app/components/workflow/nodes/end/types.ts diff --git a/web/app/components/workflow/nodes/end/mock.ts b/web/app/components/workflow/nodes/end/mock.ts new file mode 100644 index 0000000000..effe7c3182 --- /dev/null +++ b/web/app/components/workflow/nodes/end/mock.ts @@ -0,0 +1,18 @@ +import { EndVarType } from './types' +import type { EndNodeType } from './types' + +export const mockData: EndNodeType = { + title: 'Test', + desc: 'Test', + type: 'Test', + outputs: { + type: EndVarType.none, + plain_text_selector: ['test'], + structured_variables: [ + { + variable: 'test', + value_selector: ['aaa', 'name'], + }, + ], + }, +} diff --git a/web/app/components/workflow/nodes/end/types.ts b/web/app/components/workflow/nodes/end/types.ts new file mode 100644 index 0000000000..3386ed9ec6 --- /dev/null +++ b/web/app/components/workflow/nodes/end/types.ts @@ -0,0 +1,15 @@ +import type { CommonNodeType, Variable } from '@/app/components/workflow/types' + +export enum EndVarType { + none = 'none', + plainText = 'plain-text', + structured = 'structured', +} + +export type EndNodeType = CommonNodeType & { + outputs: { + type: EndVarType + plain_text_selector?: string[] + structured_variables?: Variable[] + } +}