import * as vue from 'vue'; import { ComputedRef, Ref } from 'vue'; import { AxiosInstance, AxiosRequestConfig } from 'axios'; import * as _blueking_flow_canvas from '@blueking/flow-canvas'; import { ZoomToFitOptions, CanvasUiEvent, QuickAddConfig, FlowModel, FlowNodeModel, NodeActionsConfig, ConnectionValidator, CanvasPlugin, CommandEnvelope, CanvasSchema } from '@blueking/flow-canvas'; export { InsertDirection, QuickAddConfig, QuickAddInsertDirectionResolver, QuickAddPortResolver } from '@blueking/flow-canvas'; type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED'; type ExecutionNodeAction = 'retry' | 'skip' | 'resume' | 'approve' | 'forceFail' | 'gatewaySkip'; interface NodeExecutionState { status: NodeExecutionStatus; /** 旧版任务引擎的 task 状态,优先用于识别 REVOKED */ taskState?: string; /** 兼容旧版 snake_case 字段 */ task_state?: string; /** 节点组件 code,如 pause_node / bk_approve,用于动作分流 */ nodeCode?: string; /** 兼容旧版 snake_case 字段 */ code?: string; /** 编辑态配置:失败可重试 */ retryable?: boolean; /** 编辑态配置:失败可跳过 */ skippable?: boolean; /** 编辑态配置:自动忽略错误(隐含 retry/skip 权限) */ errorIgnorable?: boolean; /** 兼容旧版 snake_case 字段 */ error_ignorable?: boolean; /** 是否有管理员权限,影响强制终止按钮 */ hasAdminPerm?: boolean; /** 兼容旧版 snake_case 字段 */ has_admin_perm?: boolean; /** 运行时信息:实际重试次数 */ retry?: number; /** 运行时信息:是否已跳过 */ skip?: boolean; /** 运行时信息:是否自动忽略错误 */ errorIgnored?: boolean; /** 兼容旧版 snake_case 字段 */ error_ignored?: boolean; /** 运行时信息:循环次数 */ loop?: number; /** 运行时信息:生命周期阶段 */ phase?: number; /** 若由上游直接给出操作列表,则 resolver 不再推导 */ actions?: ExecutionNodeAction[]; /** 兼容旧版后端直接透出的动作数组字段 */ action_list?: ExecutionNodeAction[]; } type TaskExecutionStates = Record; type PortOrientation = 'Top' | 'Right' | 'Bottom' | 'Left'; type GatewayType = 'ExclusiveGateway' | 'ParallelGateway' | 'ConditionalParallelGateway' | 'ConvergeGateway'; interface PluginInputDataItem { value: | string | boolean | number | string[] | boolean[] | number[] | Record | Record; hook?: boolean; need_render?: boolean; } type ActivityComponentData = Record; interface ActivityComponent { code: string; data: ActivityComponentData; version: string; api_meta?: { id: string; name: string; alias?: string; meta_url: string; api_key: string; category: { id: string; name: string; }; }; } interface Activity { component: ActivityComponent; error_ignorable: boolean; id: string; incoming: string[]; name: string; stage_name?: string; outgoing: string; type: 'ServiceActivity'; retryable: boolean; skippable: boolean; auto_retry: { enable: boolean; interval: number; times: number; }; timeout_config: { enable: boolean; seconds: number; action: string; }; status?: NodeExecutionStatus; /** 执行态:实际重试次数 */ retry?: number; /** 执行态:是否被跳过 */ skip?: boolean; /** 执行态:是否自动忽略错误 */ error_ignored?: boolean; /** 执行态:循环执行次数 */ loop?: number; /** 执行态:生命周期阶段 */ phase?: number; } interface StartEvent { id: string; name: string; incoming: ''; outgoing: string; type: 'EmptyStartEvent'; labels: []; status?: NodeExecutionStatus; } interface EndEvent { id: string; name: string; incoming: string[]; outgoing: string; type: 'EmptyEndEvent'; labels: []; status?: NodeExecutionStatus; } interface GatewayCondition { name: string; tag: string; evaluate?: string; // 只有自定义分支需要 loc?: number; flow_id?: string; // 只有默认分支需要 } interface Gateway { id: string; name: string; incoming: string[]; outgoing: string[] | string; type: GatewayType; conditions?: Record; default_condition?: GatewayCondition; converge_gateway_id?: string; extra_info?: { parse_lang?: 'boolrule' | 'FEEL' | 'MAKO'; }; status?: NodeExecutionStatus; } interface Flow { id: string; is_default: boolean; source: string; target: string; } interface Location { id: string; type: | 'startpoint' | 'endpoint' | 'tasknode' | 'branchgateway' | 'convergegateway' | 'parallelgateway' | 'conditionalparallelgateway'; x: number; y: number; group?: string; icon?: string; name?: string; } interface Line { id: string; source: { arrow: PortOrientation; id: string; }; target: { arrow: PortOrientation; id: string; }; } interface Variable { custom_type: string; desc: string; index: number; key: string; name: string; show_type: 'show' | 'hide'; source_info: Record; source_tag: string; source_type: 'custom' | 'component_inputs' | 'component_outputs' | 'system' | 'space'; validation: string; value?: string | number | boolean | Record; version?: string; form_schema?: Record; pre_render_mako?: boolean; plugin_code?: string; } interface PipelineTree { activities: Record; end_event: EndEvent; flows: Record; gateways: Record; line: Line[]; location: Location[]; start_event: StartEvent; outputs: string[]; constants: Record; canvas_mode: 'horizontal'; canvas_version?: string; } // 通知配置 interface NotifyConfig { notify_type: { fail: string[]; success: string[]; }; notify_receivers: { more_receiver: string; receiver_group: string[]; }; } // 触发器 Cron 配置 interface TriggerCron { minute: string; hour: string; day_of_week: string; day_of_month: string; month_of_year: string; } // 触发器配置项 interface TriggerItem { id: number | null; name: string; type: string; is_enabled: boolean; is_deleted: boolean; space_id: number | string; template_id: number | string; config: { cron: TriggerCron; mode?: string; constants?: Record; [key: string]: any; }; isNewTrigger?: boolean; [key: string]: any; } // 流程模板基础配置 interface TemplateConfigs { name: string; desc: string; notify_config: NotifyConfig; triggers?: TriggerItem[]; } // 变量引用统计 interface VariableReference { defined: Record< string, { activities: string; conditions: string[]; constants: string[]; } >; nodefined: Record< string, { activities: string; conditions: string[]; constants: string[]; } >; } // 值约束配置 interface ConditionConfig { enum?: (string | number | boolean)[]; range?: [number, number]; } // 输入参数字段配置(data._slots) interface SlotFieldConfig { name: string; desc: string; required: boolean; type: 'string' | 'integer' | 'float' | 'boolean'; role: 'timestamp' | 'feature' | string; } // 应用参数配置(predict_args._slots) interface SlotArgConfig { name: string; desc: string; required: boolean; type: 'string' | 'integer' | 'float' | 'boolean'; condition?: ConditionConfig; default?: string | number | boolean; } // uniform api 插件输入参数项表单配置 interface UniformApiPluginInputsItem$1 { desc: string; form_type?: string; key: string; name: string; required: boolean; type: string; default?: string | boolean | number | string[] | boolean[] | number[] | Record; _slots?: Record; } interface FlowTemplate { id: number; name: string; desc: string; notify_config: NotifyConfig; pipeline_tree: PipelineTree; extra_info: Record; triggers: TriggerItem[]; version: string; } interface FlowDetailByVersion { constants_not_referred: Record; name: string; outputs: Record; pipeline_tree: PipelineTree; version: string; } interface FlowDraftDetail { create_time: string; update_time: string; version: string | null; template_id: number; desc: string | null; draft: boolean; creator: string; operator: string; md5sum: string; pipeline_tree: PipelineTree; } interface SpaceFlowConfig { gateway_expression?: 'boolrule' | 'FEEL' | 'MAKO'; uiform_api?: { api: Record; }; } interface UpdateFlowParams { name: string; desc: string; notify_config: NotifyConfig; pipeline_tree: PipelineTree; triggers: TriggerItem[]; } interface PluginGroupConfig { id: string; name: string; alias: string; properties: Record; iconUrl: string; } interface PluginMetaItem { alias: string; category: string; display_content: Record; group: string; id: string; meta_url: string; name: string; plugin_type: string; api_key?: string; version?: string; icon?: string; category_id: string; } interface BkflowThirdPartyPluginGroupItem { code_name: string; id: number; name: string; priority: number; } interface BkflowInnerPluginMetaItem { output: { name: string; key: string; type: string; schema: { type: string; description: string; enum: string[]; }; }[]; form: string; output_form: null; desc: string; form_is_embedded: boolean; group_name: string; group_icon: string; name: string; sort_key_group_en: string; code: string; version: string; is_default_version: boolean; } interface BkflowThirdPartyPluginMetaItem { code: string; name: string; tag: number; logo_url: string; created_time: string; updated_time: string; introduction: string; managers: string[]; extra_info: Record; } interface BkflowThirdPartyPluginMetaDetail { code: string; versions: string[]; language: string; description: string; framework_version: string; runtime_version: string; } interface BkflowThirdPartyPluginDetail { desc: string; version: string; inputs: { type: string; properties: Record; required: string[]; definitions: Record; }; outputs: { type: string; properties: Record; required: string[]; definitions: Record; }; forms: { renderform: string; }; app: BkflowThirdPartyPluginAppDetail; } interface BkflowThirdPartyPluginAppDetail { url: string; urls: string[]; name: string; code: string; updated: string; apigw_name: string; tag_info: { id: number; name: string; code_name: string; priority: number; }; } interface GroupsPluginItem extends PluginGroupConfig { children: (PluginMetaItem | BkflowThirdPartyPluginGroupItem)[]; } interface DndNodeItem { type: string; label: string; icon: string; disabled?: boolean; disabledTip?: string; tipsImage?: string; } interface UniformApiPluginDetail { alias: string; bk_tenant_id: string; category: string; config: UniformApiPluginConfig; created_at: string; created_by: string; group: string; id: number; name: string; plugin_type: 'uniform_api'; url: string; methods: string[]; inputs: Record; outputs: string[]; scope_id: string; sign: string; updated_at: string; updated_by: string; credential_key?: string; polling?: Record; component_type?: string; } interface UniformApiPluginConfig { polling: string; callback: Record; resource: string; extra_config: { timeout: number; retry_times: number; instructions: Record; }; } interface RenderformInputsItem { name?: string; tag_code: string; type: string; attrs: Record; events?: Record[]; validation?: Record[]; } interface JsonschemaformInputs { type: string; properties: Record; required?: string[]; definitions?: Record; enum?: string[]; items?: Record; 'ui:props'?: Record; 'ui:component'?: Record; }>; } interface UniformApiPluginInputsItem { desc: string; form_type?: string; key: string; name: string; required: boolean; type: string; default?: string | boolean | number | string[] | boolean[] | number[] | Record; _slots?: Record; options?: { value: string; text: string; }[]; } interface PluginOutputItem { description: string; key: string; type: string; name: string; } interface PluginDetailCommon { code: string; name: string; desc: string; version: string; inputs: UniformApiPluginInputsItem[] | RenderformInputsItem[] | JsonschemaformInputs; outputs: PluginOutputItem[]; inputParamsFormType: string; versions?: string[]; category?: string; group?: string; url?: string; methods?: string[]; uniformApiName?: string; polling?: Record; credential_key?: string; component_type?: string; displayGroupName?: string; } interface CustomVariableType { name: string; form: string; type: string; tag: string; meta_tag: string | null; description: string; code: string; } /** 画布视口相关方法,供 FlowView / FlowEdit 对外透传 */ interface CanvasViewportExpose { zoomToFit: (options?: ZoomToFitOptions) => void; centerContent: () => void; getZoom: () => number; } interface FlowEditExpose extends CanvasViewportExpose { isFlowEdited: boolean; updateNodeInputParams: (inputParams: Record) => void; openGlobalVariables: () => void; } interface FlowViewExpose extends CanvasViewportExpose { } /** * Flow API 配置接口 */ interface FlowApiConfig { /** API 基础路径 */ baseURL?: string; /** 自定义 axios 实例(可选,如果提供则优先使用) */ axiosInstance?: AxiosInstance; /** axios 配置(可选,用于创建新的 axios 实例) */ axiosConfig?: AxiosRequestConfig; /** CSRF cookie 名称(可选,用于创建新的 axios 实例时设置 xsrfCookieName) */ xsrfCookieName?: string; /** 作用域数据(必需,由外部传入) */ scopeData: { scope_type: string; scope_value: number; }; /** 用户查询 API 地址(可选) */ fetchUserApi?: string; /** 是否启用第三方插件(可选,默认为 true) */ enableThirdPlugin?: boolean; } interface DrawPipelineParams { pipeline_tree: PipelineTree; canvas_width: number; activity_size?: [number, number]; event_size?: [number, number]; gateway_size?: [number, number]; start?: [number, number]; } interface CreateFlowTaskParams { template_id: number; name: string; creator: string; constants: Record; label_ids?: number[]; [key: string]: unknown; } interface CreateFlowTaskResult { data: { id: number; template_id: number; [key: string]: unknown; }; [key: string]: unknown; } interface ExecuteFlowTaskResult { result?: boolean; code?: number; data?: { /** 任务详情页跳转地址(含正确的 bkflow task id 与 templateId) */ url?: string; [key: string]: unknown; }; message?: string | null; request_id?: string; trace_id?: string | null; [key: string]: unknown; } interface FlowTaskExecuteSuccessResult { /** createFlowTask(create_task)接口响应 */ createResult: CreateFlowTaskResult; /** executeFlowTask(operate_task)接口响应,data.url 用于任务详情跳转 */ executeResult: ExecuteFlowTaskResult; } interface FlowViewApiConfig { fetchFlowDetail: (id: string) => Promise; fetchSpaceFlowConfig: (id: string) => Promise; fetchSystemVariables: (id: string) => Promise; fetchUserApi?: string; /** 作用域数据(必需,由外部传入) */ scopeData: { scope_type: string; scope_value: number; }; fetchFlowDraftDetail?: (id: string) => Promise; fetchFlowDetailByVersion?: (id: string, version: string) => Promise; fetchVariableRef?: (params: { template_id: number; activities: Record; constants: Record; gateways: Record; }) => Promise<{ data: VariableReference; }>; fetchCustomVariableTypes?: () => Promise<{ data: CustomVariableType[]; }>; fetchFlowOperateRecord?: (id: number) => Promise<{ data: { data: any[]; }; }>; createFlowTask?: (params: CreateFlowTaskParams) => Promise; executeFlowTask?: (params: { task_id: number; action: string; resource_type: string; resource_id: number; permission_type: string; }) => Promise; fetchControlConfig?: () => Promise>; checkSpaceConfig?: (scopeValue: number, params: { name: string; }) => Promise<{ value: string; }>; } interface FlowEditApiConfig extends FlowViewApiConfig { saveFlow: (id: string, params: UpdateFlowParams) => Promise; fetchBkFlowInnerPluginList: () => Promise; fetchBkFlowInnerPluginDetail: (code: string, version: string) => Promise; fetchInnerVariableDetail: (code: string) => Promise; fetchBkFlowThirdPartyPluginList: (tag: number) => Promise<{ data: { count: number; plugins: BkflowThirdPartyPluginMetaItem[]; }; }>; searchBkFlowThirdPartyPlugins?: (search_term: string) => Promise<{ data: { count: number; plugins: BkflowThirdPartyPluginMetaItem[]; }; }>; fetchBkFlowThirdPartyPluginTags: () => Promise; fetchBkFlowThirdPartyPluginMeta: (plugin_code: string) => Promise; fetchBkFlowThirdPartyPluginDetail: (plugin_code: string, plugin_version: string) => Promise; fetchBkFlowThirdPartyPluginAppDetail: (plugin_code: string, plugin_version: string) => Promise; fetchPluginGroupList: () => Promise; fetchCategoryPlugins: (category: string) => Promise; fetchAllPluginGroups: () => Promise; enableThirdPlugin?: boolean; fetchPluginDetail?: (id: string) => Promise; fetchApplyInstructionData?: (params: any) => Promise; drawPipeline?: (params: DrawPipelineParams) => Promise<{ pipeline_tree: PipelineTree; }>; createFlowTask?: (params: CreateFlowTaskParams) => Promise; executeFlowTask?: (params: { task_id: number; action: string; resource_type: string; resource_id: number; permission_type: string; }) => Promise; } type __VLS_Props$5 = { flowId: string; show: boolean; editable?: boolean; showFlowEntry?: boolean; apiConfig: FlowApiConfig; onConfirm?: (formData: { name: string; variablesValue: Record; }) => Promise | void; useCustomConfirm?: boolean; onExecuteSuccess?: (taskId: number, templateId: number) => void; bkflowSaasUrl?: string; enableVersion?: boolean; flowVersion?: string; }; declare var __VLS_65: { formData: { name: string; }; variablesValue: Record; }; type __VLS_Slots$5 = {} & { 'custom-form-content'?: (props: typeof __VLS_65) => any; }; declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, { close: (...args: any[]) => void; "update:show": (...args: any[]) => void; confirm: (...args: any[]) => void; "before-close": (...args: any[]) => void; }, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{ onClose?: ((...args: any[]) => any) | undefined; "onUpdate:show"?: ((...args: any[]) => any) | undefined; onConfirm?: ((...args: any[]) => any) | undefined; "onBefore-close"?: ((...args: any[]) => any) | undefined; }>, { editable: boolean; showFlowEntry: boolean; enableVersion: boolean; useCustomConfirm: boolean; }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>; declare const __VLS_export$5: __VLS_WithSlots$5; declare const _default$6: typeof __VLS_export$5; type __VLS_WithSlots$5 = T & { new (): { $slots: S; }; }; declare namespace __debug_vue { export { _default$6 as default, }; } type __VLS_Slots$4 = { header?: () => any; extend?: () => any; }; type __VLS_Props$4 = { pipelineTree: PipelineTree; nodeStates?: TaskExecutionStates; defaultZoom?: number; apiConfig: FlowApiConfig; bkflowSaasUrl?: string; showHeader?: boolean; onBack?: () => void; }; declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, { retry: (nodeId: string) => any; skip: (nodeId: string) => any; resume: (nodeId: string) => any; approve: (nodeId: string) => any; forceFail: (nodeId: string) => any; gatewaySkip: (nodeId: string) => any; "ui-event": (event: CanvasUiEvent) => any; back: () => any; "node-click": (event: { type: "node.click"; nodeId: string; } & { type: "node.click"; }) => any; "execution-action": (payload: { nodeId: string; action: ExecutionNodeAction; }) => any; }, string, vue.PublicProps, Readonly<__VLS_Props$4> & Readonly<{ onRetry?: ((nodeId: string) => any) | undefined; onSkip?: ((nodeId: string) => any) | undefined; onResume?: ((nodeId: string) => any) | undefined; onApprove?: ((nodeId: string) => any) | undefined; onForceFail?: ((nodeId: string) => any) | undefined; onGatewaySkip?: ((nodeId: string) => any) | undefined; "onUi-event"?: ((event: CanvasUiEvent) => any) | undefined; onBack?: (() => any) | undefined; "onNode-click"?: ((event: { type: "node.click"; nodeId: string; } & { type: "node.click"; }) => any) | undefined; "onExecution-action"?: ((payload: { nodeId: string; action: ExecutionNodeAction; }) => any) | undefined; }>, { showHeader: boolean; defaultZoom: number; nodeStates: TaskExecutionStates; }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>; declare const __VLS_export$4: __VLS_WithSlots$4; declare const _default$5: typeof __VLS_export$4; type __VLS_WithSlots$4 = T & { new (): { $slots: S; }; }; declare namespace __execute_vue { export { _default$5 as default, }; } type __VLS_Slots$3 = { customFormContent?: (props: { customFormData: Record; additionalTaskParams: Record; updateCustomFormData: (data: Record) => void; updateAdditionalTaskParams: (params: Record) => void; }) => any; }; type __VLS_Props$3 = { flowId: string; show: boolean; editable?: boolean; showFlowEntry?: boolean; apiConfig: FlowApiConfig; onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void; bkflowSaasUrl?: string; }; declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, { close: (...args: any[]) => void; "update:show": (...args: any[]) => void; confirm: (...args: any[]) => void; "before-close": (...args: any[]) => void; "view-flow": (...args: any[]) => void; }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{ onClose?: ((...args: any[]) => any) | undefined; "onUpdate:show"?: ((...args: any[]) => any) | undefined; onConfirm?: ((...args: any[]) => any) | undefined; "onBefore-close"?: ((...args: any[]) => any) | undefined; "onView-flow"?: ((...args: any[]) => any) | undefined; }>, { editable: boolean; showFlowEntry: boolean; }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>; declare const __VLS_export$3: __VLS_WithSlots$3; declare const _default$4: typeof __VLS_export$3; type __VLS_WithSlots$3 = T & { new (): { $slots: S; }; }; declare namespace __create_task_vue { export { _default$4 as default, }; } /** * 插件分组选择面板配置 */ interface SelectPanelConfig { agentApplyUrl?: string; agentResourceUrl?: string; agentButtonText?: string; knowledgebaseResourceUrl?: string; } /** * 在顶层组件中提供 FlowApiConfig * @param config FlowApiConfig 配置对象或已处理的 API 配置对象 * @returns 返回处理后的 API 配置对象 */ declare function provideFlowApiConfig(config: FlowApiConfig | FlowEditApiConfig | FlowViewApiConfig): FlowEditApiConfig | FlowViewApiConfig; /** * 在子组件中注入 FlowApiConfig(通用版本) * @returns FlowEditApiConfig * @throws 如果 apiConfig 未提供则抛出错误 */ declare function useFlowApiConfig(): FlowEditApiConfig; /** * 在子组件中注入 FlowEditApiConfig(类型化版本) * @returns FlowEditApiConfig */ declare function useFlowEditApiConfig(): FlowEditApiConfig; /** * 在子组件中注入 FlowViewApiConfig(类型化版本) * 注意:实际上返回的是 FlowEditApiConfig,但类型上兼容 FlowViewApiConfig * @returns FlowViewApiConfig */ declare function useFlowViewApiConfig(): FlowViewApiConfig; /** * 在顶层组件中提供 SelectPanelConfig * @param config SelectPanelConfig 配置对象 */ declare function provideSelectPanelConfig(config: SelectPanelConfig): void; /** * 在子组件中注入 SelectPanelConfig * @returns SelectPanelConfig 或 null(如果未提供配置) */ declare function useSelectPanelConfig(): SelectPanelConfig | null; type __VLS_Slots$2 = { header?: () => any; inputParams?: (props: { node: any; pluginDetail: PluginDetailCommon | null; inputs: any[]; editable: boolean; fullVariableList: { key: string; name: string; source_type?: string; custom_type?: string; }[]; updateInputParams: (data: Record) => void; updateNodeInputParams: (inputParams: Record) => void; updateVariableSourceInfo: (variableKey: string, nodeId: string, formKey: string) => void; }) => any; debugCustomFormContent?: (props: { formData: { name: string; }; variablesValue: Record; }) => any; }; type __VLS_Props$2 = { flowId: string; apiConfig: FlowApiConfig; permissions?: { canSave?: boolean; }; enableDebug?: boolean; onDebugConfirm?: (formData: { name: string; variablesValue: Record; }) => Promise | void; useCustomDebugConfirm?: boolean; selectPanelConfig?: SelectPanelConfig; onSave?: (flowData: FlowTemplate) => void; onSaveSuccess?: () => void; onBack?: () => void; onExitEdit?: () => void; onBeforeLeave?: (isEdited: boolean) => Promise; enableVersion?: boolean; flowVersion?: string; defaultZoom?: number; bkflowSaasUrl?: string; enableThirdPlugin?: boolean; quickAdd?: QuickAddConfig; /** 是否隐藏基础信息中的触发器配置表单,默认 false */ hideTrigger?: boolean; }; declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, { isFlowEdited: ComputedRef; updateNodeInputParams: FlowEditExpose["updateNodeInputParams"]; openGlobalVariables: FlowEditExpose["openGlobalVariables"]; zoomToFit: FlowEditExpose["zoomToFit"]; centerContent: FlowEditExpose["centerContent"]; getZoom: FlowEditExpose["getZoom"]; }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, { back: () => any; save: (flowData: FlowTemplate) => any; saveSuccess: () => any; exitEdit: () => any; debugBeforeClose: () => any; }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{ onBack?: (() => any) | undefined; onSave?: ((flowData: FlowTemplate) => any) | undefined; onSaveSuccess?: (() => any) | undefined; onExitEdit?: (() => any) | undefined; onDebugBeforeClose?: (() => any) | undefined; }>, { quickAdd: QuickAddConfig; hideTrigger: boolean; defaultZoom: number; permissions: { canSave?: boolean; }; enableVersion: boolean; enableDebug: boolean; useCustomDebugConfirm: boolean; enableThirdPlugin: boolean; }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>; declare const __VLS_export$2: __VLS_WithSlots$2; declare const _default$3: typeof __VLS_export$2; type __VLS_WithSlots$2 = T & { new (): { $slots: S; }; }; declare namespace __edit_vue { export { _default$3 as default, }; } type __VLS_Slots$1 = { header?: () => any; inputParams?: (props: { node: any; pluginDetail: PluginDetailCommon | null; inputs: any[]; editable: boolean; fullVariableList: { key: string; name: string; }[]; updateInputParams: (data: Record) => void; }) => any; customFormContent?: (props: { customFormData: Record; additionalTaskParams: Record; updateCustomFormData: (data: Record) => void; updateAdditionalTaskParams: (params: Record) => void; }) => any; }; type __VLS_Props$1 = { flowId: string; apiConfig: FlowApiConfig; permissions?: { canEdit?: boolean; canExecute?: boolean; }; onEdit?: () => void; onBack?: () => void; thumbnail?: boolean; enableVersion?: boolean; flowVersion?: string; showHeaderActions?: boolean; defaultZoom?: number; bkflowSaasUrl?: string; onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void; /** 是否隐藏基础信息中的触发器配置表单,默认 false */ hideTrigger?: boolean; }; declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, { zoomToFit: (options?: ZoomToFitOptions) => void; centerContent: () => void; getZoom: () => number; }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, { edit: () => any; back: () => any; }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{ onEdit?: (() => any) | undefined; onBack?: (() => any) | undefined; }>, { thumbnail: boolean; hideTrigger: boolean; defaultZoom: number; permissions: { canEdit?: boolean; canExecute?: boolean; }; enableVersion: boolean; showHeaderActions: boolean; }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>; declare const __VLS_export$1: __VLS_WithSlots$1; declare const _default$2: typeof __VLS_export$1; type __VLS_WithSlots$1 = T & { new (): { $slots: S; }; }; declare namespace __view_vue { export { _default$2 as default, }; } declare const random4: () => string; declare const generateId: (group?: number) => string; /** * 画布pipeline_tree数据校验 */ declare const validatePipelineTree: (pipelineTree: PipelineTree) => { valid: boolean; message: string; ids: string[]; }; declare const getVariableDefaultConfig: () => Variable; declare const getUniformApiPluginFormValue: (config: UniformApiPluginInputsItem$1) => PluginInputDataItem["value"]; declare class BkFlowNodeAccessor { private node; constructor(node: FlowNodeModel); get id(): string; get type(): string; get label(): string | undefined; get name(): string; get stageName(): string; get component(): ActivityComponent | undefined; get errorIgnorable(): boolean; get retryable(): boolean; get skippable(): boolean; get autoRetry(): { enable: boolean; interval: number; times: number; } | undefined; get timeoutConfig(): { enable: boolean; seconds: number; action: string; } | undefined; get conditions(): Record | undefined; get defaultCondition(): GatewayCondition | undefined; get convergeGatewayId(): string | undefined; get isGateway(): boolean; get isTask(): boolean; get nodeModel(): FlowNodeModel; } declare class BkFlowModelAccessor { private model; constructor(model: FlowModel); get globalVariables(): Record; get outputs(): string[]; get canvasMode(): string; getNodeAccessor(nodeId: string): BkFlowNodeAccessor | undefined; getAllNodes(): BkFlowNodeAccessor[]; getNodesByType(type: string): BkFlowNodeAccessor[]; get flowModel(): FlowModel; } type __VLS_Props = { pipelineTree: PipelineTree; mode?: 'edit' | 'view'; thumbnail?: boolean; defaultZoom?: number; nodeActions?: NodeActionsConfig; quickAdd?: QuickAddConfig; connectionValidator?: ConnectionValidator; additionalPlugins?: CanvasPlugin[]; }; declare var __VLS_8: {}; declare var __VLS_22: { node: _blueking_flow_canvas.FlowNodeModel; api: _blueking_flow_canvas.CanvasApi; insertNodeToRight: (node: Omit<_blueking_flow_canvas.FlowNodeModel, "position">) => void; closePopover: () => void; }; type __VLS_Slots = {} & { 'node-palette'?: (props: typeof __VLS_8) => any; } & { 'quick-add-panel'?: (props: typeof __VLS_22) => any; }; declare const __VLS_base: vue.DefineComponent<__VLS_Props, { editor: _blueking_flow_canvas.CanvasEditorContext; projection: vue.ComputedRef; exportPipelineTree: () => PipelineTree; importPipelineTree: (tree: PipelineTree) => void; updatePipelineTree: (tree: PipelineTree) => PipelineTree; executeCommand: (envelope: CommandEnvelope) => _blueking_flow_canvas.CommandExecutionResult; undo: () => _blueking_flow_canvas.FlowModel | null; redo: () => _blueking_flow_canvas.FlowModel | null; resetHoverState: () => void | undefined; }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & { change: (pipelineTree: PipelineTree) => any; "ui-event": (event: CanvasUiEvent) => any; "node-click": (event: { type: "node.click"; nodeId: string; } & { type: "node.click"; }) => any; "node-dblclick": (event: { type: "node.dblclick"; nodeId: string; } & { type: "node.dblclick"; }) => any; "edge-click": (event: { type: "edge.click"; edgeId: string; } & { type: "edge.click"; }) => any; "edge-label-click": (event: { type: "edge.label.click"; edgeId: string; labelId: string; } & { type: "edge.label.click"; }) => any; "blank-click": (event: { type: "blank.click"; position: _blueking_flow_canvas.CanvasPosition; } & { type: "blank.click"; }) => any; "format-position": () => any; }, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{ onChange?: ((pipelineTree: PipelineTree) => any) | undefined; "onUi-event"?: ((event: CanvasUiEvent) => any) | undefined; "onNode-click"?: ((event: { type: "node.click"; nodeId: string; } & { type: "node.click"; }) => any) | undefined; "onNode-dblclick"?: ((event: { type: "node.dblclick"; nodeId: string; } & { type: "node.dblclick"; }) => any) | undefined; "onEdge-click"?: ((event: { type: "edge.click"; edgeId: string; } & { type: "edge.click"; }) => any) | undefined; "onEdge-label-click"?: ((event: { type: "edge.label.click"; edgeId: string; labelId: string; } & { type: "edge.label.click"; }) => any) | undefined; "onBlank-click"?: ((event: { type: "blank.click"; position: _blueking_flow_canvas.CanvasPosition; } & { type: "blank.click"; }) => any) | undefined; "onFormat-position"?: (() => any) | undefined; }>, { thumbnail: boolean; mode: "edit" | "view"; nodeActions: NodeActionsConfig; quickAdd: QuickAddConfig; defaultZoom: number; connectionValidator: ConnectionValidator; additionalPlugins: CanvasPlugin[]; }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>; declare const __VLS_export: __VLS_WithSlots; declare const _default$1: typeof __VLS_export; type __VLS_WithSlots = T & { new (): { $slots: S; }; }; /** * PipelineTree → FlowModel 导入适配器。 * * 字段归属规则: * - node.payload:业务数据(component、conditions、timeout_config 等) * - node.extensions:渲染辅助(locationType、group、icon) * - edge.labels:从 gateway.conditions 投影而来的分支条件名 * - FlowModel.meta:全局变量(constants)、输出(outputs) * - FlowModel.extensions:画布模式(canvas_mode) */ declare function importFromPipelineTree(tree: PipelineTree): FlowModel; declare function exportToPipelineTree(flowModel: FlowModel): PipelineTree; declare function createBkflowSchema(): CanvasSchema; /** * 创建 bkflow 业务插件实例。 * 每次调用返回独立实例,避免多个画布共享模块级可变状态。 * * 通过 transformCommand 维护网关条件与边的一致性: * - node.add (gateway, user:drag):自动扩展为整组(gateway + 2 placeholder + 2 edge) * - node.add (user:drag):检测落点是否覆盖 placeholder,若是则替换 * - edge.add:源为条件网关时,自动创建 conditions[edgeId] 初始条件 * - edge.remove:清理源网关的 conditions[edgeId] 或 defaultCondition; * 若目标是 placeholder 且删后无入边,级联删除该 placeholder * - edge.reconnect:若源从条件网关迁出,清理旧条件 * - node.remove:主动查找将被级联删除的边,清理对应网关条件; * 若删除的是分支网关,级联删除关联的 placeholder 节点; * 同时清理全局变量中对被删除节点的 source_info 引用,并删除已无引用的变量 */ declare function createBkflowPlugin(): CanvasPlugin; declare const bkflowConnectionValidator: ConnectionValidator; declare function createExecutionStatusPlugin(stateRef: Ref): CanvasPlugin; /** * 执行态动作 resolver。 * * 输入的 nodeType 必须是 canvas-adapter schema 层的节点类型(例如 `task` / * `exclusive-gateway` / `parallel-gateway`),不要直接传 pipelineTree 的 * `ServiceActivity` / `ExclusiveGateway` 等原始类型。 * * 行为: * - 如果上游显式给出 `state.actions`,优先使用; * - 否则根据 status / nodeCode / retryable / skippable / errorIgnorable 推导。 * * 不涵盖子流程节点(当前 schema 没有独立的 subprocess 节点类型),留待后续 PR。 */ declare function resolveExecutionActions(state: NodeExecutionState | undefined, nodeType: string): ExecutionNodeAction[]; declare const _default: { FlowView: () => Promise; FlowEdit: () => Promise; FlowCreateTask: () => Promise; FlowExecute: () => Promise; FlowDebug: () => Promise; }; export { _default$1 as BkFlowCanvas, BkFlowModelAccessor, BkFlowNodeAccessor, _default$4 as FlowCreateTask, _default$6 as FlowDebug, _default$3 as FlowEdit, _default$5 as FlowExecute, _default$2 as FlowView, bkflowConnectionValidator, createBkflowPlugin, createBkflowSchema, createExecutionStatusPlugin, _default as default, exportToPipelineTree, generateId, getUniformApiPluginFormValue, getVariableDefaultConfig, importFromPipelineTree, provideFlowApiConfig, provideSelectPanelConfig, random4, resolveExecutionActions, useFlowApiConfig, useFlowEditApiConfig, useFlowViewApiConfig, useSelectPanelConfig, validatePipelineTree }; export type { Activity, CanvasViewportExpose, CreateFlowTaskResult, DndNodeItem, ExecuteFlowTaskResult, ExecutionNodeAction, FlowApiConfig, FlowEditExpose, FlowTaskExecuteSuccessResult, FlowTemplate, FlowViewExpose, Gateway, GatewayCondition, NodeExecutionState, NodeExecutionStatus, NotifyConfig, PipelineTree, PluginDetailCommon, PluginInputDataItem, SelectPanelConfig, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };