@digitalsee-ai/rcs 0.0.15 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/README.md +69 -237
  2. package/dist/components/digitalsee/workflow/Canvas/NextConfigModalWrapper.d.ts +9 -0
  3. package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvas.d.ts +4 -0
  4. package/dist/components/digitalsee/workflow/Canvas/NextWorkflowCanvasHeader.d.ts +15 -0
  5. package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvas.d.ts +1 -12
  6. package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvasBase.d.ts +4 -0
  7. package/dist/components/digitalsee/workflow/Canvas/WorkflowCanvasHeader.d.ts +2 -1
  8. package/dist/components/digitalsee/workflow/Canvas/color.d.ts +1 -1
  9. package/dist/components/digitalsee/workflow/Canvas/constants.d.ts +75 -0
  10. package/dist/components/digitalsee/workflow/Canvas/hooks/createNodeAddHandlerNext.d.ts +49 -0
  11. package/dist/components/digitalsee/workflow/Canvas/hooks/useCanvasApi.d.ts +22 -0
  12. package/dist/components/digitalsee/workflow/Canvas/hooks/useDataLoading.d.ts +21 -0
  13. package/dist/components/digitalsee/workflow/Canvas/hooks/useNodeAddCallback.d.ts +44 -0
  14. package/dist/components/digitalsee/workflow/Canvas/hooks/useNodeFormDraftCache.d.ts +14 -0
  15. package/dist/components/digitalsee/workflow/Canvas/hooks/useWorkflowCanvasState.d.ts +78 -0
  16. package/dist/components/digitalsee/workflow/Canvas/types.d.ts +91 -0
  17. package/dist/components/digitalsee/workflow/Edges/BaseEdge.d.ts +3 -2
  18. package/dist/components/digitalsee/workflow/Edges/EdgeFactory.d.ts +43 -0
  19. package/dist/components/digitalsee/workflow/NextNodesConfigModal/index.d.ts +13 -0
  20. package/dist/components/digitalsee/workflow/Nodes/ActionNode.d.ts +3 -3
  21. package/dist/components/digitalsee/workflow/Nodes/AgentNode.d.ts +2 -2
  22. package/dist/components/digitalsee/workflow/Nodes/BrowserNode.d.ts +2 -2
  23. package/dist/components/digitalsee/workflow/Nodes/CustomNode.d.ts +2 -2
  24. package/dist/components/digitalsee/workflow/Nodes/NextNodeFactory.d.ts +11 -0
  25. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextActionNode.d.ts +9 -0
  26. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextBaseNode.d.ts +15 -0
  27. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextConditionNode.d.ts +10 -0
  28. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextLoopNode.d.ts +10 -0
  29. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextSwitchNode.d.ts +10 -0
  30. package/dist/components/digitalsee/workflow/Nodes/NextNodes/NextTriggerNode.d.ts +9 -0
  31. package/dist/components/digitalsee/workflow/Nodes/NodeFactory.d.ts +3 -12
  32. package/dist/components/digitalsee/workflow/Nodes/StickyNoteNode.d.ts +2 -2
  33. package/dist/components/digitalsee/workflow/Nodes/SuperBaseNode.d.ts +1 -1
  34. package/dist/components/digitalsee/workflow/Nodes/components/NextNodeDescription.d.ts +16 -0
  35. package/dist/components/digitalsee/workflow/Nodes/components/NextNodeOperations.d.ts +11 -0
  36. package/dist/components/digitalsee/workflow/Nodes/components/NodeOperations.d.ts +1 -1
  37. package/dist/components/digitalsee/workflow/NodesConfig/ActionNodeConfig/index.d.ts +7 -1
  38. package/dist/components/digitalsee/workflow/NodesConfig/ConditionNodeConfig/index.d.ts +5 -4
  39. package/dist/components/digitalsee/workflow/NodesConfig/ErrorHandler.d.ts +17 -2
  40. package/dist/components/digitalsee/workflow/NodesConfig/LoopNodeConfig/index.d.ts +2 -3
  41. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CreateCredentialModal.d.ts +13 -0
  42. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/CredentialSelect.d.ts +17 -0
  43. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/ModifyCredentialModal.d.ts +17 -0
  44. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fieldSchemaAdapter.d.ts +10 -0
  45. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/fieldSchemaAdapter.test.d.ts +1 -0
  46. package/dist/components/digitalsee/workflow/NodesConfig/NextNodeConfig/index.d.ts +15 -0
  47. package/dist/components/digitalsee/workflow/NodesConfig/SwitchNodeConfig/index.d.ts +6 -5
  48. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/CreateAccountModal/index.d.ts +2 -0
  49. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/CredentialAccountForm.d.ts +10 -0
  50. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/DateField/index.d.ts +1 -1
  51. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/DateTimeField/index.d.ts +1 -1
  52. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/ExtendObjectField/index.d.ts +1 -1
  53. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/FixedObjectField/index.d.ts +1 -1
  54. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/PasswordField/index.d.ts +2 -1
  55. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/TextAreaField/index.d.ts +1 -1
  56. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/TextField/index.d.ts +1 -1
  57. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/fields/TimeField/index.d.ts +1 -1
  58. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/DynamicAccountForm/index.d.ts +1 -1
  59. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/components/ModifyAccountModal/index.d.ts +3 -0
  60. package/dist/components/digitalsee/workflow/NodesConfig/components/AccountSelect/index.d.ts +5 -3
  61. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/components/AIFormField.d.ts +1 -1
  62. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/DateField/index.d.ts +1 -1
  63. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/DateTimeField/index.d.ts +1 -1
  64. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/FixedObjectField/index.d.ts +1 -1
  65. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/HourMinuteField/index.d.ts +5 -0
  66. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/common-placeholder-theme.d.ts +11 -11
  67. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JavascriptTagEditorField/editor.d.ts +1 -0
  68. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/interface.d.ts +1 -1
  69. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/keywords.d.ts +2 -0
  70. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JsonTagField/common-placeholder-theme.d.ts +11 -11
  71. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JsonTagField/interface.d.ts +1 -1
  72. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JsonTagField/plugin/keywords.d.ts +2 -0
  73. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JsonTagField/plugin/keywords.test.d.ts +1 -0
  74. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{MutilRowAIExtractConfigField → MultiRowAIExtractConfigField}/index.d.ts +2 -2
  75. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/RichTagInput/index.d.ts +1 -1
  76. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/RichTagInput/useVariableInfo.d.ts +13 -0
  77. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/TextField/index.d.ts +2 -2
  78. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/TimeField/index.d.ts +1 -1
  79. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/index.d.ts +3 -3
  80. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/next-compatible.d.ts +2 -0
  81. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/next-compatible.test.d.ts +1 -0
  82. package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeSettings.d.ts +6 -0
  83. package/dist/components/digitalsee/workflow/NodesConfig/components/NextNodeTest.d.ts +6 -0
  84. package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/index.d.ts +6 -0
  85. package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/variable-tree-next.d.ts +49 -0
  86. package/dist/components/digitalsee/workflow/NodesConfig/components/NextVariableModal/variable-tree-next.test.d.ts +1 -0
  87. package/dist/components/digitalsee/workflow/NodesConfig/components/VariableModal/index.d.ts +2 -1
  88. package/dist/components/digitalsee/workflow/NodesConfig/context.d.ts +4 -0
  89. package/dist/components/digitalsee/workflow/NodesConfig/define/actions.d.ts +3 -3
  90. package/dist/components/digitalsee/workflow/NodesConfig/define/condition.d.ts +5 -58
  91. package/dist/components/digitalsee/workflow/NodesConfig/define/condition.test.d.ts +1 -0
  92. package/dist/components/digitalsee/workflow/NodesConfig/define/flow.d.ts +1 -26
  93. package/dist/components/digitalsee/workflow/NodesConfig/index.d.ts +3 -6
  94. package/dist/components/digitalsee/workflow/NodesConfig/utils/credentialRequirement.d.ts +17 -0
  95. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/components/CategoryTabs.d.ts +1 -1
  96. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/types.d.ts +17 -1
  97. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/dataTransformers.d.ts +2 -1
  98. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/dataTransformers.test.d.ts +1 -0
  99. package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/components/NodeListItem.d.ts +8 -0
  100. package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/hooks/useNodeList.d.ts +14 -0
  101. package/dist/components/digitalsee/workflow/Panels/SimpleNodeSelectorPanel/index.d.ts +9 -0
  102. package/dist/components/digitalsee/workflow/api/dip.d.ts +311 -0
  103. package/dist/components/digitalsee/workflow/api/dip.types.d.ts +996 -0
  104. package/dist/components/digitalsee/workflow/api/index.d.ts +38 -13
  105. package/dist/components/digitalsee/workflow/api/index.test.d.ts +1 -0
  106. package/dist/components/digitalsee/workflow/builtin/controls/MultiRowGuard/index.d.ts +13 -0
  107. package/dist/components/digitalsee/workflow/builtin/controls/{MutilRowGuard → MultiRowGuard}/types.d.ts +15 -23
  108. package/dist/components/digitalsee/workflow/builtin/controls/MutilRowGuard/index.d.ts +9 -9
  109. package/dist/components/digitalsee/workflow/builtin/globalConfig/index.d.ts +1 -0
  110. package/dist/components/digitalsee/workflow/builtin/globalConfig/service.d.ts +8 -0
  111. package/dist/components/digitalsee/workflow/builtin/globalConfig/service.test.d.ts +1 -0
  112. package/dist/components/digitalsee/workflow/builtin/globalConfig/types.d.ts +17 -0
  113. package/dist/components/digitalsee/workflow/config/globalConfig.d.ts +1 -1
  114. package/dist/components/digitalsee/workflow/constants/nextHandles.d.ts +1 -0
  115. package/dist/components/digitalsee/workflow/enums/canvas.d.ts +63 -0
  116. package/dist/components/digitalsee/workflow/enums/edge.d.ts +10 -0
  117. package/dist/components/digitalsee/workflow/enums/handle.d.ts +42 -0
  118. package/dist/components/digitalsee/workflow/enums/index.d.ts +5 -0
  119. package/dist/components/digitalsee/workflow/enums/node.d.ts +199 -0
  120. package/dist/components/digitalsee/workflow/enums/workflow.d.ts +90 -0
  121. package/dist/components/digitalsee/workflow/events/eventBus.d.ts +8 -2
  122. package/dist/components/digitalsee/workflow/hooks/use-before-unload.d.ts +1 -1
  123. package/dist/components/digitalsee/workflow/hooks/useCanvasLayout.d.ts +2 -1
  124. package/dist/components/digitalsee/workflow/hooks/useHandleConnections.d.ts +1 -1
  125. package/dist/components/digitalsee/workflow/hooks/usePanel.d.ts +26 -0
  126. package/dist/components/digitalsee/workflow/hooks/useVariables.d.ts +52 -0
  127. package/dist/components/digitalsee/workflow/hooks/useWorkflow.d.ts +3 -3
  128. package/dist/components/digitalsee/workflow/index.d.ts +23 -6
  129. package/dist/components/digitalsee/workflow/store/index.d.ts +17 -0
  130. package/dist/components/digitalsee/workflow/store/panelSlice.d.ts +5 -5
  131. package/dist/components/digitalsee/workflow/store/workflowSlice.d.ts +44 -0
  132. package/dist/components/digitalsee/workflow/store/workflowSlice.test.d.ts +1 -0
  133. package/dist/components/digitalsee/workflow/types/Edge.d.ts +1 -3
  134. package/dist/components/digitalsee/workflow/types/Handle.d.ts +3 -29
  135. package/dist/components/digitalsee/workflow/types/Node.d.ts +25 -63
  136. package/dist/components/digitalsee/workflow/types/NodeProtocol.d.ts +1 -12
  137. package/dist/components/digitalsee/workflow/types/Workflow.d.ts +4 -26
  138. package/dist/components/digitalsee/workflow/types/engine.d.ts +9 -0
  139. package/dist/components/digitalsee/workflow/utils/common.d.ts +1 -0
  140. package/dist/components/digitalsee/workflow/utils/flowDataAdapterNext.d.ts +13 -0
  141. package/dist/components/digitalsee/workflow/utils/glob.d.ts +1 -1
  142. package/dist/components/digitalsee/workflow/utils/layoutUtils.d.ts +2 -3
  143. package/dist/components/digitalsee/workflow/utils/mergeConfig.d.ts +3 -6
  144. package/dist/components/digitalsee/workflow/utils/nextNodeSchemaCache.d.ts +6 -0
  145. package/dist/components/digitalsee/workflow/utils/nextNodeSchemaCache.test.d.ts +1 -0
  146. package/dist/components/digitalsee/workflow/utils/nodeDataFormatter.d.ts +1 -1
  147. package/dist/components/digitalsee/workflow/utils/nodeDataFormatterNext.d.ts +11 -0
  148. package/dist/components/digitalsee/workflow/utils/nodeSummaryAdapter.d.ts +15 -0
  149. package/dist/components/dynamic-form/DynamicForm.d.ts +8 -3
  150. package/dist/components/dynamic-form/DynamicForm.test.d.ts +1 -0
  151. package/dist/components/dynamic-form/DynamicFormContext.d.ts +4 -0
  152. package/dist/components/dynamic-form/FieldRenderer.d.ts +6 -2
  153. package/dist/components/dynamic-form/components/ValueModeWrapper/index.d.ts +7 -1
  154. package/dist/components/dynamic-form/components/VariableInput/index.d.ts +1 -0
  155. package/dist/components/dynamic-form/fields/complex/KeyValueField.test.d.ts +1 -0
  156. package/dist/components/dynamic-form/fields/index.d.ts +12 -0
  157. package/dist/components/dynamic-form/index.d.ts +6 -6
  158. package/dist/components/dynamic-form/registry/createFieldComponent.test.d.ts +1 -0
  159. package/dist/components/dynamic-form/registry/index.d.ts +2 -2
  160. package/dist/components/dynamic-form/types/field-component.d.ts +12 -3
  161. package/dist/locales/en-US/common.d.ts +8 -17
  162. package/dist/locales/en-US/components.d.ts +28 -0
  163. package/dist/locales/en-US/link/flow.d.ts +9 -5
  164. package/dist/locales/en-US.d.ts +42 -22
  165. package/dist/locales/index.d.ts +2 -714
  166. package/dist/locales/zh-CN/common.d.ts +8 -17
  167. package/dist/locales/zh-CN/components.d.ts +28 -0
  168. package/dist/locales/zh-CN/link/flow.d.ts +9 -5
  169. package/dist/locales/zh-CN.d.ts +42 -22
  170. package/dist/locales/zh-TW/common.d.ts +8 -17
  171. package/dist/locales/zh-TW/components.d.ts +28 -0
  172. package/dist/locales/zh-TW/link/flow.d.ts +9 -5
  173. package/dist/locales/zh-TW.d.ts +42 -22
  174. package/dist/postcss.config.js +1 -0
  175. package/dist/rcs.css +1 -1
  176. package/dist/rcs.es.js +55726 -50708
  177. package/dist/rcs.es.js.map +1 -0
  178. package/dist/rcs.umd.js +68 -67
  179. package/dist/rcs.umd.js.map +1 -0
  180. package/package.json +148 -151
  181. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/HourMiniuteField/index.d.ts +0 -5
  182. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/JavscriptTagEditorField/editor.d.ts +0 -1
  183. package/dist/components/digitalsee/workflow/NodesConfig/define/config-form-item.d.ts +0 -40
  184. package/dist/components/digitalsee/workflow/de.d.ts +0 -1
  185. package/dist/components/digitalsee/workflow/types/SaveStatus.d.ts +0 -1
  186. /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/extensions.d.ts +0 -0
  187. /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/index.d.ts +0 -0
  188. /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/base-theme.d.ts +0 -0
  189. /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/custom-completions.d.ts +0 -0
  190. /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/functions.d.ts +0 -0
  191. /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/hint.d.ts +0 -0
  192. /package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/{JavscriptTagEditorField → JavascriptTagEditorField}/plugin/placeholders.d.ts +0 -0
  193. /package/dist/components/digitalsee/workflow/hooks/{use-wokflow-id.d.ts → use-workflow-id.d.ts} +0 -0
@@ -0,0 +1,996 @@
1
+ import { VisibleWhen } from '../../../dynamic-form';
2
+ /**
3
+ * 画布坐标位置
4
+ *
5
+ * 对应后端 {@link Position} record,用于记录节点在工作流画布上的位置。
6
+ * 后端默认值为 `Position.origin()` 即 `(0, 0)`。
7
+ */
8
+ export interface DipPosition {
9
+ /** X 轴坐标(像素) */
10
+ x: number;
11
+ /** Y 轴坐标(像素) */
12
+ y: number;
13
+ }
14
+ /**
15
+ * 节点执行模式。
16
+ *
17
+ * 这些值会原样写入 DIP 后端的 NodeInstanceSettings.executeMode,前端表单、
18
+ * 保存数据和运行时都应引用这个枚举,避免散落字符串导致协议值写错。
19
+ */
20
+ export declare enum DipExecuteMode {
21
+ /** 将所有输入合并后执行一次(默认) */
22
+ ONCE = "ONCE",
23
+ /** 对每条输入数据分别执行一次 */
24
+ EACH = "EACH"
25
+ }
26
+ /**
27
+ * 节点错误处理策略。
28
+ *
29
+ * CONTINUE_ERROR_OUTPUT 是前端显示 error 输出锚点的唯一条件;切回
30
+ * STOP_WORKFLOW 时,设置面板会断开该节点 error 锚点上的连线。
31
+ */
32
+ export declare enum DipNodeOnErrorStrategy {
33
+ /** 节点失败时停止工作流(默认) */
34
+ STOP_WORKFLOW = "STOP_WORKFLOW",
35
+ /** 节点失败时从 error 输出口继续错误处理流程 */
36
+ CONTINUE_ERROR_OUTPUT = "CONTINUE_ERROR_OUTPUT"
37
+ }
38
+ /**
39
+ * 节点实例运行时设置
40
+ *
41
+ * 对应后端 {@link NodeInstanceSettings} record,控制节点的重试、超时、
42
+ * 失败策略等运行时行为。
43
+ */
44
+ export interface DipNodeInstanceSettings {
45
+ /** 失败后重试次数,默认 0(不重试) */
46
+ retryCount?: number;
47
+ /** 重试间隔(毫秒),默认 1000 */
48
+ retryInterval?: number;
49
+ /** 执行超时时间(秒),0 表示无限制,默认 0 */
50
+ timeout?: number;
51
+ /** 节点错误处理策略,默认 STOP_WORKFLOW */
52
+ onError?: DipNodeOnErrorStrategy;
53
+ /** 执行模式:ONCE 合并所有输入执行一次 / EACH 逐条输入分别执行 */
54
+ executeMode?: DipExecuteMode;
55
+ }
56
+ /**
57
+ * 工作流中的节点实例
58
+ *
59
+ * 对应后端 {@link NodeInstance} record,表示工作流画布上的一个具体节点。
60
+ * 每个节点通过 `nodeKey` 关联到 {@link DipNodeSchema},通过 `credentialInstanceId`
61
+ * 关联到 {@link DipCredentialInstanceEntity}。
62
+ *
63
+ * 后端默认值:`params` 为空 Map,`settings` 为 `NodeInstanceSettings.defaults()`,
64
+ * `position` 为 `Position.origin()`。
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const node: DipNodeInstance = {
69
+ * id: 'node-1',
70
+ * name: 'Send Slack Message',
71
+ * nodeKey: 'slack.sendMessage',
72
+ * nodeVersion: 1,
73
+ * position: { x: 200, y: 100 },
74
+ * params: { channel: '#general', text: 'Hello' },
75
+ * }
76
+ * ```
77
+ */
78
+ export interface DipNodeInstance {
79
+ /** 节点实例唯一标识(UUID) */
80
+ id: string;
81
+ /** 节点显示名称,用户可自定义 */
82
+ name: string;
83
+ /**
84
+ * 节点类型标识符,DIP 体系中的全局唯一 key
85
+ *
86
+ * 格式通常为 `"provider.action"`,如 `"slack.sendMessage"`、`"http.request"`。
87
+ * 对应 {@link DipNodeSummary.key} / {@link DipNodeSchema.key}。
88
+ *
89
+ * 注意:此字段与 ReactFlow 的节点渲染类型(如 `"ActionNode"`)不同,
90
+ * ReactFlow 类型通过 `params._uiNodeType` 持久化。
91
+ */
92
+ nodeKey: string;
93
+ /** 节点 Schema 版本号,用于匹配对应版本的 {@link DipNodeSchema} */
94
+ nodeVersion: number;
95
+ /** 节点在画布上的坐标位置 */
96
+ position: DipPosition;
97
+ /**
98
+ * 节点参数键值对,对应 {@link DipNodeSchema.input_fields} 中定义的字段。
99
+ * key 为 {@link DipFieldSchema.key},value 为用户填写的值。
100
+ */
101
+ params: Record<string, unknown>;
102
+ /** 关联的凭据实例 ID,引用 {@link DipCredentialInstanceEntity.id} */
103
+ credentialInstanceId?: string;
104
+ /** 节点运行时设置(重试、超时等) */
105
+ settings?: DipNodeInstanceSettings;
106
+ }
107
+ /**
108
+ * 节点间的数据连线
109
+ *
110
+ * 对应后端 {@link Connection} record,表示工作流中两个节点之间的数据流向。
111
+ * 默认端口名为 `"main"`(后端常量 `Connection.DEFAULT_OUTPUT` / `Connection.DEFAULT_INPUT`)。
112
+ * 后端提供 `Connection.simple(sourceNodeId, targetNodeId)` 快捷方法创建默认端口连线。
113
+ */
114
+ export interface DipConnection {
115
+ /** 源节点实例 ID */
116
+ sourceNodeId: string;
117
+ /**
118
+ * 源节点输出端口名
119
+ *
120
+ * 默认为 `"main"`;条件节点可能有 `"true"` / `"false"` 等分支端口,
121
+ * Switch 节点可能有多个自定义输出端口。
122
+ * @see {@link DipPortSchema.name}
123
+ */
124
+ sourceOutput: string;
125
+ /** 目标节点实例 ID */
126
+ targetNodeId: string;
127
+ /**
128
+ * 目标节点输入端口名
129
+ *
130
+ * 通常为 `"main"`,大多数节点只有一个输入端口。
131
+ * @see {@link DipPortSchema.name}
132
+ */
133
+ targetInput: string;
134
+ }
135
+ /**
136
+ * 工作流错误处理策略
137
+ *
138
+ * 对应后端 {@link ErrorStrategy} enum,控制工作流执行遇到错误时的全局行为。
139
+ *
140
+ * - `'STOP_WORKFLOW'` — 立即停止整个工作流执行(默认)
141
+ * - `'CONTINUE'` — 跳过失败节点,继续执行后续节点
142
+ */
143
+ export type DipErrorStrategy = 'STOP_WORKFLOW' | 'CONTINUE';
144
+ /**
145
+ * 工作流全局设置
146
+ *
147
+ * 对应后端 {@link WorkflowSettings} record,控制工作流级别的执行策略。
148
+ * 后端默认值通过 `WorkflowSettings.defaults()` 提供:
149
+ * `(maxExecutionTimeMs=0, errorStrategy=STOP_WORKFLOW, timezone="UTC", saveExecutionData=true, errorWorkflowId=null)`
150
+ */
151
+ export interface DipWorkflowSettings {
152
+ /** 工作流最大执行时间(毫秒),0 表示无限制,默认 0 */
153
+ maxExecutionTimeMs?: number;
154
+ /** 错误处理策略,默认 STOP_WORKFLOW */
155
+ errorStrategy?: DipErrorStrategy;
156
+ /** 时区标识(IANA 格式),用于 Cron 触发器的时间计算,默认 "UTC" */
157
+ timezone?: string;
158
+ /** 是否保存执行数据(输入/输出),默认 true */
159
+ saveExecutionData?: boolean;
160
+ /** 执行失败时自动触发的错误处理工作流 ID */
161
+ errorWorkflowId?: string;
162
+ }
163
+ /**
164
+ * 触发器类型标识
165
+ *
166
+ * 对应后端 {@link TriggerConfig} sealed interface 的 `type()` 方法返回值。
167
+ *
168
+ * - `'manual'` — 手动触发({@link DipManualTrigger})
169
+ * - `'cron'` — 定时触发({@link DipCronTrigger})
170
+ * - `'webhook'` — Webhook 触发({@link DipWebhookTrigger})
171
+ */
172
+ export type DipTriggerType = 'manual' | 'cron' | 'webhook';
173
+ /**
174
+ * 手动触发器配置
175
+ *
176
+ * 对应后端 {@link ManualTrigger} record,无额外配置字段。
177
+ * 工作流需通过 API 调用 `/api/executions/trigger/{workflowId}` 手动触发执行。
178
+ */
179
+ export interface DipManualTrigger {
180
+ type: 'manual';
181
+ }
182
+ /**
183
+ * 定时触发器配置
184
+ *
185
+ * 对应后端 {@link CronTrigger} record,基于 Cron 表达式定时触发工作流。
186
+ * 后端在 `timezone` 为空时默认使用 `"UTC"`。
187
+ */
188
+ export interface DipCronTrigger {
189
+ type: 'cron';
190
+ /** 标准 Cron 表达式,如 `"0 0/5 * * * ?"` 表示每 5 分钟执行一次 */
191
+ expression: string;
192
+ /** 时区标识(IANA 格式),默认 "UTC" */
193
+ timezone?: string;
194
+ }
195
+ /**
196
+ * Webhook 响应模式
197
+ *
198
+ * 对应后端 {@link WebhookTrigger.ResponseMode} enum,控制 Webhook 触发后的 HTTP 响应时机。
199
+ *
200
+ * - `'IMMEDIATE'` — 立即返回响应,工作流异步执行(默认)
201
+ * - `'LAST_NODE'` — 等待工作流执行完成,返回最后一个节点的输出
202
+ * - `'CUSTOM'` — 使用自定义响应数据
203
+ */
204
+ export type DipWebhookResponseMode = 'IMMEDIATE' | 'LAST_NODE' | 'CUSTOM';
205
+ /**
206
+ * Webhook 触发器配置
207
+ *
208
+ * 对应后端 {@link WebhookTrigger} record,通过 HTTP 请求触发工作流执行。
209
+ * 后端默认值:`httpMethod="POST"`, `responseMode=IMMEDIATE`。
210
+ */
211
+ export interface DipWebhookTrigger {
212
+ type: 'webhook';
213
+ /** Webhook 路径,拼接到平台 Webhook 基础 URL 后面 */
214
+ path: string;
215
+ /** 接受的 HTTP 方法,默认 "POST" */
216
+ httpMethod: 'GET' | 'POST';
217
+ /** 响应模式,控制何时返回 HTTP 响应,默认 IMMEDIATE */
218
+ responseMode?: DipWebhookResponseMode;
219
+ /** 自定义响应数据(仅 responseMode 为 CUSTOM 时生效) */
220
+ responseData?: string;
221
+ /** 是否要求认证,启用后需提供 authHeaderName 和 authHeaderValue */
222
+ authRequired?: boolean;
223
+ /** 认证请求头名称,如 `"X-API-Key"` */
224
+ authHeaderName?: string;
225
+ /** 认证请求头期望值 */
226
+ authHeaderValue?: string;
227
+ }
228
+ /**
229
+ * 触发器配置联合类型
230
+ *
231
+ * 对应后端 {@link TriggerConfig} sealed interface,使用 `type` 字段作为判别标识。
232
+ * @see {@link DipManualTrigger} | {@link DipCronTrigger} | {@link DipWebhookTrigger}
233
+ */
234
+ export type DipTriggerConfig = DipManualTrigger | DipCronTrigger | DipWebhookTrigger;
235
+ /**
236
+ * 工作流完整实体(GET 响应)
237
+ *
238
+ * 对应后端 {@link WorkflowDefinitionEntity},包含工作流的完整定义及元数据。
239
+ * 由 `GET /api/workflows/{id}` 返回,包含服务端生成的 `id`、`version`、时间戳等字段。
240
+ */
241
+ export interface DipWorkflowDefinitionEntity {
242
+ /** 工作流唯一标识(UUID,服务端生成) */
243
+ id: string;
244
+ /** 工作流名称 */
245
+ name: string;
246
+ /** 版本号,每次更新自动递增 */
247
+ version: number;
248
+ /** 是否已激活(激活后触发器生效) */
249
+ active: boolean;
250
+ /** 工作流中的所有节点实例 */
251
+ nodes: DipNodeInstance[];
252
+ /** 节点间的所有连线 */
253
+ connections: DipConnection[];
254
+ /** 工作流全局设置 */
255
+ settings?: DipWorkflowSettings;
256
+ /** 触发器配置 */
257
+ triggerConfig?: DipTriggerConfig;
258
+ /** 创建时间(ISO 8601 格式) */
259
+ createdAt?: string;
260
+ /** 最后更新时间(ISO 8601 格式) */
261
+ updatedAt?: string;
262
+ }
263
+ /**
264
+ * 工作流定义(PUT/POST 请求体)
265
+ *
266
+ * 对应后端 {@link WorkflowDefinition} record 的部分字段,用于创建或更新工作流。
267
+ * 所有字段均为可选,支持部分更新。
268
+ */
269
+ export interface DipWorkflowDefinition {
270
+ /** 工作流 ID(更新时必填) */
271
+ id?: string;
272
+ /** 工作流名称 */
273
+ name?: string;
274
+ /** 版本号(乐观锁,更新时应传入当前版本) */
275
+ version?: number;
276
+ /** 是否激活 */
277
+ active?: boolean;
278
+ /** 节点实例列表 */
279
+ nodes?: DipNodeInstance[];
280
+ /** 连线列表 */
281
+ connections?: DipConnection[];
282
+ /** 工作流全局设置 */
283
+ settings?: DipWorkflowSettings;
284
+ /** 触发器配置 */
285
+ triggerConfig?: DipTriggerConfig;
286
+ }
287
+ /**
288
+ * 字段类型枚举
289
+ *
290
+ * 对应后端 {@link FieldType} enum,决定字段在 UI 上的渲染方式。
291
+ *
292
+ * | 值 | 说明 | UI 组件 |
293
+ * |---|---|---|
294
+ * | `STRING` | 单行文本 | Input |
295
+ * | `TEXTAREA` | 多行文本 | TextArea |
296
+ * | `PASSWORD` | 密码/敏感信息 | Password Input |
297
+ * | `HIDDEN` | 隐藏字段(不渲染) | — |
298
+ * | `NUMBER` | 数值 | InputNumber |
299
+ * | `BOOLEAN` | 布尔开关 | Switch |
300
+ * | `SELECT` | 下拉选择 | Select |
301
+ * | `DATETIME` | 日期时间 | DatePicker |
302
+ * | `OBJECT` | 嵌套对象 | 递归渲染子字段 |
303
+ * | `ARRAY` | 数组/列表 | 动态增减表单项 |
304
+ * | `KEYVALUE` | 键值对列表 | Key-Value 编辑器 |
305
+ */
306
+ export type DipFieldType = 'STRING' | 'TEXTAREA' | 'PASSWORD' | 'HIDDEN' | 'NUMBER' | 'BOOLEAN' | 'SELECT' | 'DATETIME' | 'OBJECT' | 'ARRAY' | 'KEYVALUE';
307
+ /**
308
+ * 数组元素类型
309
+ *
310
+ * 对应后端 {@link ItemType} enum,当 {@link DipFieldSchema.type} 为 `ARRAY` 时,
311
+ * 指定数组中每个元素的数据类型。
312
+ */
313
+ export type DipItemType = 'STRING' | 'NUMBER' | 'BOOLEAN' | 'OBJECT';
314
+ /**
315
+ * 日期选择器模式
316
+ *
317
+ * 对应后端 {@link PickerMode} enum,当 {@link DipFieldSchema.type} 为 `DATETIME` 时,
318
+ * 控制日期选择器的粒度。
319
+ *
320
+ * - `'DATE'` — 仅选择日期
321
+ * - `'TIME'` — 仅选择时间
322
+ * - `'DATETIME'` — 同时选择日期和时间
323
+ */
324
+ export type DipPickerMode = 'DATE' | 'TIME' | 'DATETIME';
325
+ /**
326
+ * 下拉选项
327
+ *
328
+ * 对应后端 {@link SelectOption} record,当 {@link DipFieldSchema.type} 为 `SELECT` 时,
329
+ * 定义可选项列表。
330
+ */
331
+ export interface DipSelectOption {
332
+ /** 选项显示文本 */
333
+ label: string;
334
+ /** 选项值(提交到后端的实际值) */
335
+ value: string;
336
+ }
337
+ /**
338
+ * 字段条件显示规则
339
+ *
340
+ * 对应后端 {@link DisplayCondition} record,控制字段在 UI 上的条件可见性。
341
+ * 当指定的依赖字段满足条件时,当前字段才会显示。
342
+ *
343
+ * @example
344
+ * ```ts
345
+ * // 当 authType 字段值为 "oauth2" 时显示
346
+ * { field: 'authType', operator: 'eq', value: 'oauth2' }
347
+ *
348
+ * // 当 retryCount 大于 0 时显示
349
+ * { field: 'retryCount', operator: 'gt', value: 0 }
350
+ * ```
351
+ */
352
+ export interface DipDisplayCondition {
353
+ /** 依赖的字段 key,引用同级 {@link DipFieldSchema.key} */
354
+ field: string;
355
+ /**
356
+ * 比较操作符
357
+ *
358
+ * 支持的操作符:
359
+ * - `eq` — 等于
360
+ * - `ne` — 不等于
361
+ * - `in` — 包含在数组中
362
+ * - `notIn` — 不包含在数组中
363
+ * - `gt` / `lt` / `gte` / `lte` — 数值比较
364
+ */
365
+ operator: string;
366
+ /** 比较值,单值或数组(配合 `in` / `notIn` 操作符使用) */
367
+ value: unknown;
368
+ }
369
+ /**
370
+ * 字段校验规则
371
+ *
372
+ * 对应后端 {@link FieldValidation} record,定义字段值的约束条件。
373
+ * 前端应将这些规则转换为对应的 Ant Design Form 校验规则。
374
+ */
375
+ export interface DipFieldValidation {
376
+ /** 最小数值(NUMBER 类型) */
377
+ min?: number;
378
+ /** 最大数值(NUMBER 类型) */
379
+ max?: number;
380
+ /** 正则表达式模式(STRING / TEXTAREA 类型) */
381
+ pattern?: string;
382
+ /** 最小字符长度(STRING / TEXTAREA 类型) */
383
+ minLength?: number;
384
+ /** 最大字符长度(STRING / TEXTAREA 类型) */
385
+ maxLength?: number;
386
+ }
387
+ /**
388
+ * 字段 Schema 定义
389
+ *
390
+ * 对应后端 {@link FieldSchema} record,是 DIP Schema 体系的核心类型。
391
+ * 描述节点输入字段或凭据字段的完整定义,包括类型、校验、条件显示等。
392
+ * 前端根据此 Schema 动态渲染表单控件。
393
+ *
394
+ * 不同 {@link DipFieldType} 使用不同的可选字段:
395
+ * - `SELECT` → `options`
396
+ * - `ARRAY` → `item_type`, `item_schema`, `item_label`, `min_items`, `max_items`
397
+ * - `OBJECT` → `properties`
398
+ * - `KEYVALUE` → `key_placeholder`, `value_placeholder`
399
+ * - `DATETIME` → `picker_mode`
400
+ */
401
+ export interface DipFieldSchema {
402
+ /** 字段唯一标识,对应节点 params 中的 key */
403
+ key: string;
404
+ /** 字段显示标签 */
405
+ label?: string;
406
+ /** 字段类型,决定 UI 渲染方式 */
407
+ type: DipFieldType;
408
+ /** 是否必填 */
409
+ required?: boolean;
410
+ /** 是否禁用(只读) */
411
+ disabled?: boolean;
412
+ /** 输入框占位提示文本 */
413
+ placeholder?: string;
414
+ /** 帮助说明文本,通常显示在字段下方或 Tooltip 中 */
415
+ help_text?: string;
416
+ /** 默认值,类型应与 {@link type} 匹配 */
417
+ default_value?: unknown;
418
+ /** 示例值,用于辅助用户理解期望的输入格式 */
419
+ example?: string;
420
+ /** 下拉选项列表(仅 type 为 SELECT 时使用) */
421
+ options?: DipSelectOption[];
422
+ /** 数组元素类型(仅 type 为 ARRAY 时使用) */
423
+ item_type?: DipItemType;
424
+ /** 数组元素为 OBJECT 时的子字段 Schema(递归定义) */
425
+ item_schema?: DipFieldSchema[];
426
+ /** 数组项的显示标签模板 */
427
+ item_label?: string;
428
+ /** 数组最少元素数量 */
429
+ min_items?: number;
430
+ /** 数组最多元素数量 */
431
+ max_items?: number;
432
+ /** 嵌套对象的子字段列表(仅 type 为 OBJECT 时使用,递归定义) */
433
+ properties?: DipFieldSchema[];
434
+ /** Key 输入框占位文本(仅 type 为 KEYVALUE 时使用) */
435
+ key_placeholder?: string;
436
+ /** Value 输入框占位文本(仅 type 为 KEYVALUE 时使用) */
437
+ value_placeholder?: string;
438
+ /** 日期选择器模式(仅 type 为 DATETIME 时使用) */
439
+ picker_mode?: DipPickerMode;
440
+ /** 条件显示规则,满足条件时字段才可见 */
441
+ visible_when?: VisibleWhen;
442
+ /** 是否支持变量插值(如 `{{node1.output.field}}`) */
443
+ supports_variables?: boolean;
444
+ /** 字段值校验规则 */
445
+ validation?: DipFieldValidation;
446
+ }
447
+ /**
448
+ * 端口 Schema 定义
449
+ *
450
+ * 对应后端 {@link PortSchema} record,描述节点的输入/输出端口。
451
+ * 后端提供默认常量:`PortSchema.MAIN_INPUT`、`PortSchema.MAIN_OUTPUT`,
452
+ * 以及 `DEFAULT_INPUTS` / `DEFAULT_OUTPUTS` 列表(均为单个 "main" 端口)。
453
+ */
454
+ export interface DipPortSchema {
455
+ /**
456
+ * 端口标识符
457
+ *
458
+ * 用于 {@link DipConnection} 中的 `sourceOutput` / `targetInput` 匹配。
459
+ * 常见值:`"main"`(默认)、`"true"` / `"false"`(条件节点)。
460
+ */
461
+ name: string;
462
+ /** UI 显示名称,如 "输入"、"True 分支"、"默认输出" */
463
+ displayName?: string;
464
+ }
465
+ /**
466
+ * 节点输出字段 Schema
467
+ *
468
+ * 对应后端 {@link OutputFieldSchema} record,描述节点执行后输出数据的结构。
469
+ * 用于下游节点的变量引用提示和数据映射。
470
+ */
471
+ export interface DipOutputFieldSchema {
472
+ /** 输出字段标识符 */
473
+ key: string;
474
+ /** 字段显示标签 */
475
+ label?: string;
476
+ /** 字段数据类型(如 "string"、"number"、"object") */
477
+ type: string;
478
+ /** 字段说明 */
479
+ description?: string;
480
+ }
481
+ /**
482
+ * 凭据需求声明
483
+ *
484
+ * 对应后端 {@link CredentialRequirement} record,声明节点所需的凭据类型。
485
+ * 节点可以声明多个凭据需求,用户在配置节点时需选择对应的凭据实例。
486
+ */
487
+ export interface DipCredentialRequirement {
488
+ /** 凭据 Schema key,引用 {@link DipCredentialSchema.key} */
489
+ key: string;
490
+ /** 是否必须配置凭据 */
491
+ required: boolean;
492
+ }
493
+ /**
494
+ * 节点 Schema 完整定义
495
+ *
496
+ * 对应后端 {@link NodeSchema} record,是节点类型的完整描述。
497
+ * 包含节点的输入/输出端口、输入字段、输出字段、凭据需求等信息。
498
+ * 由 `GET /api/nodes/{nodeKey}` 返回。
499
+ *
500
+ * 后端默认值:`inputs` 和 `outputs` 各包含一个 `"main"` 端口,
501
+ * `credentials` 为空列表。
502
+ */
503
+ export interface DipNodeSchema {
504
+ /** 节点类型全局唯一标识,如 `"slack.sendMessage"` */
505
+ key: string;
506
+ /** Schema 版本号 */
507
+ version: number;
508
+ /** 节点显示名称 */
509
+ name: string;
510
+ /** 节点功能描述 */
511
+ description?: string;
512
+ /** 输入端口列表,默认为单个 "main" 端口 */
513
+ inputs?: DipPortSchema[];
514
+ /** 输出端口列表,默认为单个 "main" 端口 */
515
+ outputs?: DipPortSchema[];
516
+ /** 输入字段 Schema 列表,定义节点的配置表单 */
517
+ input_fields?: DipFieldSchema[];
518
+ /** 输出字段 Schema 列表,描述节点执行后的输出数据结构 */
519
+ output_fields?: DipOutputFieldSchema[];
520
+ /** 示例输出数据,用于预览和调试 */
521
+ sample?: Record<string, unknown>;
522
+ /** 节点所需的凭据声明列表 */
523
+ credentials?: DipCredentialRequirement[];
524
+ }
525
+ /**
526
+ * 凭据认证类型
527
+ *
528
+ * 对应后端 {@link CredentialType} enum,标识凭据的认证方式。
529
+ *
530
+ * - `'API_KEY'` — API 密钥认证
531
+ * - `'TOKEN_EXCHANGE'` — Token 交换认证(如 OAuth1)
532
+ * - `'OAUTH2'` — OAuth 2.0 认证
533
+ * - `'BASIC'` — HTTP Basic 认证(用户名/密码)
534
+ * - `'CUSTOM'` — 自定义认证方式
535
+ */
536
+ export type DipCredentialType = 'API_KEY' | 'TOKEN_EXCHANGE' | 'OAUTH2' | 'BASIC' | 'CUSTOM';
537
+ /**
538
+ * 凭据 Schema 定义
539
+ *
540
+ * 对应后端 {@link CredentialSchema} record,描述凭据类型的完整配置。
541
+ * 由 `GET /api/credentials/{credentialKey}` 返回。
542
+ * 前端根据 `fields` 动态渲染凭据配置表单。
543
+ */
544
+ export interface DipCredentialSchema {
545
+ /** 凭据类型全局唯一标识 */
546
+ key: string;
547
+ /** Schema 版本号 */
548
+ version: number;
549
+ /** 凭据类型显示名称 */
550
+ name: string;
551
+ /** 凭据类型描述 */
552
+ description?: string;
553
+ /** 认证方式 */
554
+ type: DipCredentialType;
555
+ /** 凭据配置字段列表,复用 {@link DipFieldSchema} 定义 */
556
+ fields?: DipFieldSchema[];
557
+ /**
558
+ * 连接标签模板
559
+ *
560
+ * 支持 `{{field}}` 占位符,用于在 UI 上显示凭据实例的简短标识。
561
+ * 例如 `"{{email}}"` 会替换为用户填写的 email 字段值。
562
+ */
563
+ connectionLabel?: string;
564
+ }
565
+ /**
566
+ * 凭据实例实体
567
+ *
568
+ * 对应后端 {@link CredentialInstanceEntity},存储用户创建的具体凭据配置。
569
+ * 由 `GET /api/credential-instances` 返回。
570
+ * 注意:`data` 字段在 GET 请求中不返回明文,仅在创建时提交。
571
+ */
572
+ export interface DipCredentialInstanceEntity {
573
+ /** 凭据实例唯一标识(UUID) */
574
+ id: string;
575
+ /** 凭据实例名称(用户自定义) */
576
+ name: string;
577
+ /** 关联的凭据 Schema key,引用 {@link DipCredentialSchema.key} */
578
+ credentialKey: string;
579
+ /** 关联的凭据 Schema 版本号 */
580
+ credentialVersion: number;
581
+ /** 加密后的凭据数据 JSON(GET 响应中不包含明文) */
582
+ data?: string;
583
+ /** 创建时间(ISO 8601 格式) */
584
+ createdAt?: string;
585
+ /** 最后更新时间(ISO 8601 格式) */
586
+ updatedAt?: string;
587
+ }
588
+ /**
589
+ * 节点摘要信息(列表用)
590
+ *
591
+ * 对应后端 {@link NodeSummary} record,由 `GET /api/nodes` 返回。
592
+ * 每个节点类型只返回最高版本的摘要,用于节点选择面板展示。
593
+ */
594
+ export interface DipNodeSummary {
595
+ /** 节点类型全局唯一标识,如 `"slack.sendMessage"` */
596
+ key: string;
597
+ /** 最高版本号 */
598
+ version: number;
599
+ /** 节点显示名称 */
600
+ name: string;
601
+ /** 节点功能描述 */
602
+ description?: string;
603
+ }
604
+ /**
605
+ * 凭据摘要信息
606
+ *
607
+ * 对应后端 {@link CredentialSummary} record,用于凭据列表展示。
608
+ */
609
+ export interface DipCredentialSummary {
610
+ /** 凭据类型唯一标识 */
611
+ key: string;
612
+ /** 最高版本号 */
613
+ version: number;
614
+ /** 凭据类型显示名称 */
615
+ name: string;
616
+ /** 凭据类型描述 */
617
+ description?: string;
618
+ }
619
+ /**
620
+ * 插件摘要信息
621
+ *
622
+ * 对应后端 {@link PluginSummary} record,由 `GET /api/plugins` 返回。
623
+ * 描述已加载插件的元数据,包括其提供的节点和凭据数量。
624
+ */
625
+ export interface DipPluginSummary {
626
+ /** 插件内部名称(唯一标识) */
627
+ name: string;
628
+ /** 插件显示名称 */
629
+ displayName?: string;
630
+ /** 插件版本号 */
631
+ version: string;
632
+ /** 插件功能描述 */
633
+ description?: string;
634
+ /** 插件分类,如 "communication"、"database" */
635
+ category?: string;
636
+ /** 标签列表,用于搜索和筛选 */
637
+ tags?: string[];
638
+ /** 是否为官方插件 */
639
+ official?: boolean;
640
+ /** 插件提供的节点类型数量 */
641
+ nodeCount: number;
642
+ /** 插件提供的凭据类型数量 */
643
+ credentialCount: number;
644
+ }
645
+ /**
646
+ * 工作流执行状态
647
+ *
648
+ * 对应后端 {@link ExecutionStatus} enum,表示工作流整体执行的生命周期状态。
649
+ *
650
+ * 状态流转:`CREATED` → `RUNNING` → `COMPLETED` / `FAILED` / `CANCELLED`
651
+ */
652
+ export type DipExecutionStatus = 'CREATED' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED';
653
+ /**
654
+ * 节点执行状态
655
+ *
656
+ * 对应后端 {@link NodeExecutionStatus} enum,表示单个节点在工作流执行中的状态。
657
+ *
658
+ * 状态流转:`PENDING` → `RUNNING` → `COMPLETED` / `FAILED` / `SKIPPED`
659
+ *
660
+ * - `SKIPPED` — 节点因条件不满足或上游失败(且配置了 continueOnFail)而被跳过
661
+ */
662
+ export type DipNodeExecutionStatus = 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'SKIPPED';
663
+ /**
664
+ * 工作流执行记录
665
+ *
666
+ * 对应后端 {@link WorkflowExecutionEntity},记录一次工作流执行的完整信息。
667
+ * 由 `GET /api/executions/{executionId}` 或 `GET /api/executions/workflow/{workflowId}` 返回。
668
+ */
669
+ export interface DipWorkflowExecutionEntity {
670
+ /** 执行记录唯一标识(UUID) */
671
+ id: string;
672
+ /** 关联的工作流 ID */
673
+ workflowId: string;
674
+ /** 执行时的工作流版本号 */
675
+ workflowVersion: number;
676
+ /** 执行状态 */
677
+ status: DipExecutionStatus;
678
+ /** 触发类型标识(如 "manual"、"cron"、"webhook") */
679
+ triggerType?: string;
680
+ /** 触发时传入的数据 */
681
+ triggerData?: Record<string, unknown>;
682
+ /** 执行开始时间(ISO 8601 格式) */
683
+ startTime?: string;
684
+ /** 执行结束时间(ISO 8601 格式) */
685
+ endTime?: string;
686
+ /** 执行失败时的错误信息 */
687
+ errorMessage?: string;
688
+ /** 记录创建时间(ISO 8601 格式) */
689
+ createdAt?: string;
690
+ }
691
+ /**
692
+ * 节点执行记录
693
+ *
694
+ * 对应后端 {@link NodeExecutionEntity},记录工作流执行中单个节点的执行详情。
695
+ * 由 `GET /api/executions/{executionId}/nodes` 返回。
696
+ */
697
+ export interface DipNodeExecutionEntity {
698
+ /** 节点执行记录唯一标识(UUID) */
699
+ id: string;
700
+ /** 所属工作流执行记录 ID,引用 {@link DipWorkflowExecutionEntity.id} */
701
+ executionId: string;
702
+ /** 节点实例 ID,引用 {@link DipNodeInstance.id} */
703
+ nodeInstanceId: string;
704
+ /** 节点类型标识,引用 {@link DipNodeSchema.key} */
705
+ nodeKey: string;
706
+ /** 执行时的节点 Schema 版本号 */
707
+ nodeVersion: number;
708
+ /** 节点执行状态 */
709
+ status: DipNodeExecutionStatus;
710
+ /** 节点接收到的输入数据列表(每条输入为一个 Map) */
711
+ inputData?: Record<string, unknown>[];
712
+ /** 节点执行后的输出数据列表(每条输出为一个 Map) */
713
+ outputData?: Record<string, unknown>[];
714
+ /** 执行失败时的错误信息 */
715
+ errorMessage?: string;
716
+ /** 已重试次数 */
717
+ retryCount?: number;
718
+ /** 节点执行开始时间(ISO 8601 格式) */
719
+ startTime?: string;
720
+ /** 节点执行结束时间(ISO 8601 格式) */
721
+ endTime?: string;
722
+ }
723
+ /**
724
+ * 凭据连接测试结果
725
+ *
726
+ * 对应后端 {@link CredentialTestResult},由 `POST /api/credential-instances/{id}/test` 返回。
727
+ * 后端提供工厂方法:`CredentialTestResult.ok()` / `CredentialTestResult.fail(message)`。
728
+ */
729
+ export interface DipCredentialTestResult {
730
+ /** 测试是否成功 */
731
+ success: boolean;
732
+ /** 测试结果消息(失败时包含错误详情) */
733
+ message?: string;
734
+ }
735
+ /**
736
+ * 导出的节点实例(环境无关)
737
+ *
738
+ * 对应后端 {@link ExportedNode},与 {@link DipNodeInstance} 类似,
739
+ * 但 `credentialInstanceId` 被替换为 `credentialRef`(引用导出数据中的凭据 key)。
740
+ */
741
+ export interface DipExportedNode {
742
+ /** 节点实例 ID */
743
+ id: string;
744
+ /** 节点显示名称 */
745
+ name: string;
746
+ /** 节点类型标识 */
747
+ nodeKey: string;
748
+ /** 节点 Schema 版本号 */
749
+ nodeVersion: number;
750
+ /** 节点在画布上的坐标位置 */
751
+ position: DipPosition;
752
+ /** 节点参数键值对 */
753
+ params: Record<string, unknown>;
754
+ /** 凭据引用 key(指向 {@link DipWorkflowExportData.credentialRefs}) */
755
+ credentialRef?: string;
756
+ /** 节点运行时设置 */
757
+ settings?: DipNodeInstanceSettings;
758
+ }
759
+ /**
760
+ * 导出的工作流定义(环境无关)
761
+ *
762
+ * 对应后端 {@link ExportedWorkflow},与 {@link DipWorkflowDefinition} 类似,
763
+ * 但节点使用 {@link DipExportedNode}(凭据引用而非实例 ID)。
764
+ */
765
+ export interface DipExportedWorkflow {
766
+ /** 工作流名称 */
767
+ name: string;
768
+ /** 版本号 */
769
+ version: number;
770
+ /** 节点列表(使用凭据引用) */
771
+ nodes: DipExportedNode[];
772
+ /** 连线列表 */
773
+ connections: DipConnection[];
774
+ /** 工作流全局设置 */
775
+ settings?: DipWorkflowSettings;
776
+ /** 触发器配置 */
777
+ trigger?: DipTriggerConfig;
778
+ }
779
+ /**
780
+ * 凭据引用信息
781
+ *
782
+ * 对应后端 {@link CredentialRef},描述导出数据中引用的凭据类型。
783
+ */
784
+ export interface DipCredentialRef {
785
+ /** 凭据类型标识 */
786
+ credentialKey: string;
787
+ /** 凭据 Schema 版本号 */
788
+ credentialVersion: number;
789
+ /** 凭据类型显示名称 */
790
+ displayName?: string;
791
+ }
792
+ /**
793
+ * 节点依赖需求
794
+ *
795
+ * 对应后端 {@link NodeRequirement},声明工作流依赖的节点类型及版本。
796
+ */
797
+ export interface DipNodeRequirement {
798
+ /** 节点类型标识 */
799
+ key: string;
800
+ /** 节点 Schema 版本号 */
801
+ version: number;
802
+ }
803
+ /**
804
+ * 工作流依赖需求
805
+ *
806
+ * 对应后端 {@link Requirements},汇总工作流的所有依赖项。
807
+ */
808
+ export interface DipRequirements {
809
+ /** 最低平台版本要求 */
810
+ minPlatformVersion?: string;
811
+ /** 所需节点类型列表 */
812
+ requiredNodes?: DipNodeRequirement[];
813
+ /** 所需凭据类型列表 */
814
+ requiredCredentials?: DipCredentialRequirement[];
815
+ }
816
+ /**
817
+ * 工作流导出数据
818
+ *
819
+ * 对应后端 {@link WorkflowExportData},由 `GET /api/workflows/{id}/export` 返回。
820
+ * 包含工作流定义及其依赖的凭据信息,可跨环境导入。
821
+ */
822
+ export interface DipWorkflowExportData {
823
+ /** 导出格式版本号 */
824
+ formatVersion: string;
825
+ /** 导出时间(ISO 8601 格式) */
826
+ exportedAt: string;
827
+ /** 工作流定义(环境无关) */
828
+ workflow: DipExportedWorkflow;
829
+ /** 凭据引用映射表(key → 凭据信息) */
830
+ credentialRefs: Record<string, DipCredentialRef>;
831
+ /** 工作流依赖需求 */
832
+ requirements: DipRequirements;
833
+ }
834
+ /**
835
+ * 可用的凭据实例(导入时选择用)
836
+ *
837
+ * 对应后端 {@link AvailableInstance},列出目标环境中可用的凭据实例。
838
+ */
839
+ export interface DipAvailableInstance {
840
+ /** 凭据实例 ID */
841
+ id: string;
842
+ /** 凭据实例名称 */
843
+ name: string;
844
+ /** 创建时间 */
845
+ createdAt: string;
846
+ }
847
+ /**
848
+ * 凭据映射关系
849
+ *
850
+ * 对应后端 {@link CredentialMapping},描述导入时需要映射的凭据。
851
+ */
852
+ export interface DipCredentialMapping {
853
+ /** 导出数据中的凭据引用 key */
854
+ ref: string;
855
+ /** 凭据类型标识 */
856
+ credentialKey: string;
857
+ /** 凭据 Schema 版本号 */
858
+ credentialVersion: number;
859
+ /** 凭据类型显示名称 */
860
+ displayName?: string;
861
+ /** 目标环境中可用的凭据实例列表 */
862
+ availableInstances: DipAvailableInstance[];
863
+ }
864
+ /**
865
+ * 缺失的依赖项
866
+ *
867
+ * 对应后端 {@link MissingDependencies},列出导入时缺失的节点或凭据类型。
868
+ */
869
+ export interface DipMissingDependencies {
870
+ /** 缺失的节点类型列表(格式:`"nodeKey@version"`) */
871
+ nodes?: string[];
872
+ /** 缺失的凭据类型列表(格式:`"credentialKey@version"`) */
873
+ credentials?: string[];
874
+ }
875
+ /**
876
+ * 工作流摘要信息
877
+ *
878
+ * 对应后端 {@link WorkflowSummary},用于导入验证结果展示。
879
+ */
880
+ export interface DipWorkflowSummary {
881
+ /** 工作流名称 */
882
+ name: string;
883
+ /** 版本号 */
884
+ version: number;
885
+ /** 节点数量 */
886
+ nodeCount: number;
887
+ }
888
+ /**
889
+ * 导入验证结果
890
+ *
891
+ * 对应后端 {@link ImportValidationResult},由 `POST /api/workflows/import/validate` 返回。
892
+ * 包含工作流摘要、凭据映射需求、缺失依赖等信息。
893
+ */
894
+ export interface DipImportValidationResult {
895
+ /** 验证是否通过 */
896
+ valid: boolean;
897
+ /** 工作流摘要信息 */
898
+ workflow: DipWorkflowSummary;
899
+ /** 需要映射的凭据列表 */
900
+ credentialMappings: DipCredentialMapping[];
901
+ /** 缺失的依赖项 */
902
+ missingDependencies?: DipMissingDependencies;
903
+ /** 验证错误信息列表 */
904
+ errors?: string[];
905
+ }
906
+ /**
907
+ * 导入执行请求
908
+ *
909
+ * 对应后端 {@link ImportExecuteRequest},提交给 `POST /api/workflows/import/execute`。
910
+ */
911
+ export interface DipImportExecuteRequest {
912
+ /** 导出的工作流 JSON 数据 */
913
+ workflowJson: DipWorkflowExportData;
914
+ /** 凭据映射关系(导出凭据 ref → 本地凭据实例 ID) */
915
+ credentialMappings: Record<string, string>;
916
+ }
917
+ /**
918
+ * 分页结果(工作流定义)
919
+ *
920
+ * 对应后端 {@link PageWorkflowDefinitionEntity},由 `GET /api/workflows/page` 返回。
921
+ */
922
+ export interface DipPageWorkflowDefinitionEntity {
923
+ /** 当前页数据 */
924
+ records: DipWorkflowDefinitionEntity[];
925
+ /** 总记录数 */
926
+ total: number;
927
+ /** 每页大小 */
928
+ size: number;
929
+ /** 当前页码(从 1 开始) */
930
+ current: number;
931
+ /** 总页数 */
932
+ pages: number;
933
+ }
934
+ /**
935
+ * 节点测试请求(无状态设计)
936
+ *
937
+ * 对应后端 {@link NodeTestRequest} record,提交给 `POST /api/nodes/test`。
938
+ * 前端负责管理测试历史和上下文,后端完全无状态,支持集群部署。
939
+ *
940
+ * @see docs/reference/node-test-api.md
941
+ */
942
+ export interface DipNodeTestRequest {
943
+ /** 节点类型标识(必填),如 `"http_request"` */
944
+ nodeKey: string;
945
+ /** 节点版本,0 或不传表示最新版本 */
946
+ nodeVersion?: number;
947
+ /** 节点名称(必填),用于表达式中的 `$node["名称"]` 引用 */
948
+ nodeName: string;
949
+ /** 节点参数,支持 `{{ }}` 表达式 */
950
+ params?: Record<string, unknown>;
951
+ /** 模拟输入数据(上游节点输出) */
952
+ inputData?: Record<string, unknown>[];
953
+ /** 凭据实例 ID(可选) */
954
+ credentialInstanceId?: string;
955
+ /**
956
+ * 其他节点的输出,用于表达式引用
957
+ * key 为节点名称,value 为该节点的输出数据列表
958
+ */
959
+ contextNodes?: Record<string, Record<string, unknown>[]>;
960
+ /** 超时秒数,默认 30 秒 */
961
+ timeoutSeconds?: number;
962
+ }
963
+ /**
964
+ * 节点测试结果
965
+ *
966
+ * 对应后端 {@link NodeTestResult} record,由 `POST /api/nodes/test` 返回。
967
+ */
968
+ export interface DipNodeTestResult {
969
+ /** 是否执行成功 */
970
+ success: boolean;
971
+ /** 失败时的错误信息 */
972
+ error: string | null;
973
+ /** 按端口分组的输出数据(成功时);失败时为 null */
974
+ outputData: Record<string, Record<string, unknown>[]> | null;
975
+ /** 表达式解析后的实际参数(方便调试) */
976
+ resolvedParams: Record<string, unknown> | null;
977
+ /** 执行耗时(毫秒) */
978
+ executionTimeMs: number;
979
+ }
980
+ /**
981
+ * 分页结果(工作流执行记录)
982
+ *
983
+ * 对应后端 {@link PageWorkflowExecutionEntity},由 `GET /api/executions/workflow/{workflowId}/page` 返回。
984
+ */
985
+ export interface DipPageWorkflowExecutionEntity {
986
+ /** 当前页数据 */
987
+ records: DipWorkflowExecutionEntity[];
988
+ /** 总记录数 */
989
+ total: number;
990
+ /** 每页大小 */
991
+ size: number;
992
+ /** 当前页码(从 1 开始) */
993
+ current: number;
994
+ /** 总页数 */
995
+ pages: number;
996
+ }