@blueking/bkflow-canvas-editor 1.1.0-beta.1 → 1.1.0-beta.11

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.
package/dist/index.d.ts CHANGED
@@ -2,13 +2,80 @@ import * as vue from 'vue';
2
2
  import { ComputedRef, Ref } from 'vue';
3
3
  import { AxiosInstance, AxiosRequestConfig } from 'axios';
4
4
  import * as _blueking_flow_canvas from '@blueking/flow-canvas';
5
- import { CanvasUiEvent, QuickAddConfig, FlowModel, FlowNodeModel, NodeActionsConfig, ConnectionValidator, CanvasPlugin, CommandEnvelope, CanvasSchema } from '@blueking/flow-canvas';
6
- export { InsertDirection, QuickAddConfig, QuickAddInsertDirectionResolver, QuickAddPortResolver } from '@blueking/flow-canvas';
5
+ import { ZoomToFitOptions, CanvasUiEvent, QuickAddConfig, CanvasSchema, FlowModel, FlowNodeModel, NodeActionsConfig, ConnectionValidator, CanvasPlugin, CanvasToolbarItem, CommandEnvelope } from '@blueking/flow-canvas';
7
6
 
8
- type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED';
7
+ /**
8
+ * Flow API 配置接口
9
+ */
10
+ interface FlowApiConfig {
11
+ /** API 基础路径 */
12
+ baseURL?: string;
13
+ /** 自定义 axios 实例(可选,如果提供则优先使用) */
14
+ axiosInstance?: AxiosInstance;
15
+ /** axios 配置(可选,用于创建新的 axios 实例) */
16
+ axiosConfig?: AxiosRequestConfig;
17
+ /** CSRF cookie 名称(可选,用于创建新的 axios 实例时设置 xsrfCookieName) */
18
+ xsrfCookieName?: string;
19
+ /** 作用域数据(必需,由外部传入) */
20
+ scopeData: ScopeData;
21
+ /**
22
+ * 用户查询 API 地址(可选)
23
+ * @deprecated 请改用 FlowEdit/FlowView 顶层组件的 `memberSelectorConfig.fetchUserApi`。
24
+ * 该字段仅保留向后兼容,未来版本会移除。
25
+ */
26
+ fetchUserApi?: string;
27
+ /** 是否启用第三方插件(可选,默认为 true) */
28
+ enableThirdPlugin?: boolean;
29
+ }
30
+ interface ScopeData {
31
+ scope_type: string;
32
+ scope_value: number;
33
+ /** 业务方传入的空间 ID,语义独立于 scope_value。 */
34
+ space_id: number;
35
+ }
36
+
37
+ type __VLS_Slots$7 = {
38
+ header?: () => any;
39
+ extend?: () => any;
40
+ };
41
+ type __VLS_Props$7 = {
42
+ flowId: string;
43
+ taskId: string | number;
44
+ apiConfig: FlowApiConfig;
45
+ bkflowSaasUrl?: string;
46
+ defaultZoom?: number;
47
+ onBack?: () => void;
48
+ };
49
+ declare const __VLS_base$7: vue.DefineComponent<__VLS_Props$7, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
50
+ back: () => any;
51
+ }, string, vue.PublicProps, Readonly<__VLS_Props$7> & Readonly<{
52
+ onBack?: (() => any) | undefined;
53
+ }>, {
54
+ defaultZoom: number;
55
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
56
+ declare const __VLS_export$7: __VLS_WithSlots$7<typeof __VLS_base$7, __VLS_Slots$7>;
57
+ declare const _default$8: typeof __VLS_export$7;
58
+
59
+ type __VLS_WithSlots$7<T, S> = T & {
60
+ new (): {
61
+ $slots: S;
62
+ };
63
+ };
64
+
65
+ declare namespace __mock_vue {
66
+ export {
67
+ _default$8 as default,
68
+ };
69
+ }
70
+
71
+ type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED' | 'SKIP';
9
72
  type ExecutionNodeAction = 'retry' | 'skip' | 'resume' | 'approve' | 'forceFail' | 'gatewaySkip';
10
73
  interface NodeExecutionState {
11
74
  status: NodeExecutionStatus;
75
+ version?: string;
76
+ start_time?: string;
77
+ finish_time?: string;
78
+ elapsed_time?: number;
12
79
  /** 旧版任务引擎的 task 状态,优先用于识别 REVOKED */
13
80
  taskState?: string;
14
81
  /** 兼容旧版 snake_case 字段 */
@@ -52,6 +119,8 @@ type PortOrientation = 'Top' | 'Right' | 'Bottom' | 'Left';
52
119
 
53
120
  type GatewayType = 'ExclusiveGateway' | 'ParallelGateway' | 'ConditionalParallelGateway' | 'ConvergeGateway';
54
121
 
122
+ type NodeType = StartEvent | EndEvent | Activity | Gateway;
123
+
55
124
  interface PluginInputDataItem {
56
125
  value:
57
126
  | string
@@ -507,6 +576,19 @@ interface DndNodeItem {
507
576
  disabledTip?: string;
508
577
  tipsImage?: string;
509
578
  }
579
+ interface UniformApiPluginOutputItem {
580
+ key: string;
581
+ name?: string;
582
+ type?: string;
583
+ description?: string;
584
+ schema?: Record<string, any>;
585
+ form_type?: string;
586
+ options?: Array<{
587
+ label?: string;
588
+ value?: unknown;
589
+ text?: string;
590
+ }>;
591
+ }
510
592
  interface UniformApiPluginDetail {
511
593
  alias: string;
512
594
  bk_tenant_id: string;
@@ -521,7 +603,7 @@ interface UniformApiPluginDetail {
521
603
  url: string;
522
604
  methods: string[];
523
605
  inputs: Record<string, any>;
524
- outputs: string[];
606
+ outputs?: Array<UniformApiPluginOutputItem | string>;
525
607
  scope_id: string;
526
608
  sign: string;
527
609
  updated_at: string;
@@ -616,33 +698,178 @@ interface CustomVariableType {
616
698
  code: string;
617
699
  }
618
700
 
619
- interface FlowEditExpose {
701
+ /** 画布视口相关方法,供 FlowView / FlowEdit 对外透传 */
702
+ interface CanvasViewportExpose {
703
+ zoomToFit: (options?: ZoomToFitOptions) => void;
704
+ centerContent: () => void;
705
+ getZoom: () => number;
706
+ }
707
+ interface FlowEditExpose extends CanvasViewportExpose {
708
+ isFlowEdited: boolean;
709
+ updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
710
+ openGlobalVariables: () => void;
711
+ }
712
+ interface FlowViewExpose extends CanvasViewportExpose {
713
+ }
714
+ /** FlowDetail 统一详情页对外暴露(设计 §7.1) */
715
+ interface FlowDetailExpose extends CanvasViewportExpose {
620
716
  isFlowEdited: boolean;
621
717
  updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
622
718
  openGlobalVariables: () => void;
719
+ refreshDebugContext: () => Promise<void>;
720
+ openDebugResult: (nodeId?: string) => void;
623
721
  }
624
722
 
723
+ type DebugContextStatus = 'idle' | 'running' | 'terminating';
724
+ type DebugNodeStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'finished' | 'failed' | 'suspended' | 'skipped';
725
+ type DebugExecutionMode = 'real' | 'mock';
726
+ interface DebugMissingVar {
727
+ key: string;
728
+ source_node_id: string | null;
729
+ }
730
+ type DebugRunType = 'global' | 'step';
731
+ type DebugRunStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'terminating' | 'finished' | 'failed' | 'revoked';
732
+ /** 运行级 / 节点级错误详情(last_error_detail、nodes[].error_detail)。 */
733
+ interface DebugErrorFailure {
734
+ message: string;
735
+ node_id?: string;
736
+ template_node_id?: string;
737
+ [key: string]: unknown;
738
+ }
739
+ interface DebugErrorDetail {
740
+ type?: string;
741
+ message?: string;
742
+ task_id?: number | string;
743
+ failures?: DebugErrorFailure[];
744
+ [key: string]: unknown;
745
+ }
746
+ interface DebugContextNode {
747
+ node_id: string;
748
+ node_type: string;
749
+ execution_mode: DebugExecutionMode;
750
+ status: DebugNodeStatus;
751
+ can_step: boolean;
752
+ missing_vars: DebugMissingVar[];
753
+ waiting_reason?: string | null;
754
+ mock_result?: 'success' | 'fail' | null;
755
+ error_detail?: DebugErrorDetail | string | null;
756
+ duration_ms?: number | null;
757
+ log_ref?: {
758
+ instance_id: number | string;
759
+ node_id: string;
760
+ version: string;
761
+ } | null;
762
+ mock_outputs?: Record<string, unknown> | null;
763
+ mock_error?: string | null;
764
+ outputs?: Record<string, unknown> | null;
765
+ }
625
766
  /**
626
- * Flow API 配置接口
767
+ * /debug_context/ 顶层结构。
768
+ *
769
+ * 前端按 status 分支:
770
+ * - running:任务定位用 active_*,进度用 last_run_status
771
+ * - terminating:继续用 active_*,UI 展示「终止中」并轮询
772
+ * - idle:active_* 为空,结果摘要用 last_*;last_task_id=null 表示尚无调试记录
627
773
  */
628
- interface FlowApiConfig {
629
- /** API 基础路径 */
630
- baseURL?: string;
631
- /** 自定义 axios 实例(可选,如果提供则优先使用) */
632
- axiosInstance?: AxiosInstance;
633
- /** axios 配置(可选,用于创建新的 axios 实例) */
634
- axiosConfig?: AxiosRequestConfig;
635
- /** CSRF cookie 名称(可选,用于创建新的 axios 实例时设置 xsrfCookieName) */
636
- xsrfCookieName?: string;
637
- /** 作用域数据(必需,由外部传入) */
638
- scopeData: {
639
- scope_type: string;
640
- scope_value: number;
641
- };
642
- /** 用户查询 API 地址(可选) */
643
- fetchUserApi?: string;
644
- /** 是否启用第三方插件(可选,默认为 true) */
645
- enableThirdPlugin?: boolean;
774
+ interface DebugContext {
775
+ template_id: number;
776
+ status: DebugContextStatus;
777
+ locked_by: string;
778
+ active_task_id: number | string | null;
779
+ active_run_type: DebugRunType | null;
780
+ active_node_id: string | null;
781
+ last_task_id: number | string | null;
782
+ last_run_type: DebugRunType | null;
783
+ last_run_status: DebugRunStatus | null;
784
+ last_error_detail?: DebugErrorDetail | null;
785
+ last_inputs?: Record<string, unknown>;
786
+ global_vars: Record<string, unknown>;
787
+ missing_vars?: DebugMissingVar[];
788
+ nodes: DebugContextNode[];
789
+ }
790
+ interface DebugInputSchemaField {
791
+ key: string;
792
+ name: string;
793
+ type: string;
794
+ default?: unknown;
795
+ required?: boolean;
796
+ [key: string]: unknown;
797
+ }
798
+ interface DebugInputSchema {
799
+ fields?: DebugInputSchemaField[];
800
+ constants?: Record<string, unknown>;
801
+ [key: string]: unknown;
802
+ }
803
+ interface DebugResetImpact {
804
+ reset_node_ids: string[];
805
+ reasons?: Record<string, string>;
806
+ }
807
+ interface UpdateNodeDebugMockResult {
808
+ node_id: string;
809
+ execution_mode: DebugExecutionMode;
810
+ updated_global_vars?: Record<string, unknown>;
811
+ [key: string]: unknown;
812
+ }
813
+ interface RunNodeDebugStepResult {
814
+ node_id: string;
815
+ status: DebugNodeStatus;
816
+ outputs?: Record<string, unknown> | null;
817
+ error_detail?: unknown;
818
+ updated_global_vars?: Record<string, unknown>;
819
+ log_ref?: DebugContextNode['log_ref'];
820
+ [key: string]: unknown;
821
+ }
822
+ interface RunGlobalDebugResult {
823
+ task_id: number | string;
824
+ status: DebugContextStatus;
825
+ [key: string]: unknown;
826
+ }
827
+ interface TerminateDebugResult {
828
+ status?: DebugContextStatus;
829
+ [key: string]: unknown;
830
+ }
831
+ interface DebugResetResult {
832
+ reset_node_ids?: string[];
833
+ [key: string]: unknown;
834
+ }
835
+ interface UpdateNodeDebugMockParams {
836
+ templateId: string | number;
837
+ nodeId: string;
838
+ enable: boolean;
839
+ mockResult?: 'success' | 'fail';
840
+ mockOutputs?: Record<string, unknown>;
841
+ mockError?: string;
842
+ }
843
+ interface RunNodeDebugStepParams {
844
+ templateId: string | number;
845
+ nodeId: string;
846
+ mode: 'real' | 'mock';
847
+ inputOverrides?: Record<string, unknown>;
848
+ mockResult?: 'success' | 'fail';
849
+ mockOutputs?: Record<string, unknown>;
850
+ mockError?: string;
851
+ }
852
+ interface RunGlobalDebugParams {
853
+ templateId: string | number;
854
+ inputs: Record<string, unknown>;
855
+ }
856
+ interface TerminateDebugParams {
857
+ templateId: string | number;
858
+ nodeId?: string;
859
+ }
860
+ interface ResetDebugResultParams {
861
+ templateId: string | number;
862
+ nodeIds?: string[];
863
+ }
864
+ interface DebugApiServices {
865
+ fetchDebugContext(templateId: string | number): Promise<DebugContext>;
866
+ fetchDebugInputSchema(templateId: string | number): Promise<DebugInputSchema>;
867
+ fetchDebugResetImpact(templateId: string | number): Promise<DebugResetImpact>;
868
+ updateNodeDebugMock(params: UpdateNodeDebugMockParams): Promise<UpdateNodeDebugMockResult>;
869
+ runNodeDebugStep(params: RunNodeDebugStepParams): Promise<RunNodeDebugStepResult>;
870
+ runGlobalDebug(params: RunGlobalDebugParams): Promise<RunGlobalDebugResult>;
871
+ terminateDebug(params: TerminateDebugParams): Promise<TerminateDebugResult>;
872
+ resetDebugResult(params: ResetDebugResultParams): Promise<DebugResetResult>;
646
873
  }
647
874
 
648
875
  interface DrawPipelineParams {
@@ -653,16 +880,115 @@ interface DrawPipelineParams {
653
880
  gateway_size?: [number, number];
654
881
  start?: [number, number];
655
882
  }
883
+ interface CreateMockDebugTaskParams {
884
+ template_id: number;
885
+ name: string;
886
+ pipeline_tree: PipelineTree;
887
+ mock_data: {
888
+ nodes: string[];
889
+ outputs: Record<string, Record<string, unknown>>;
890
+ mock_data_ids?: Record<string, number | string>;
891
+ };
892
+ creator?: string;
893
+ }
894
+ interface StopMockDebugTaskParams {
895
+ task_id: number | string;
896
+ }
897
+ interface FetchTaskStateParams {
898
+ task_id: number | string;
899
+ }
900
+ interface FetchTaskNodeDetailParams {
901
+ task_id: number | string;
902
+ node_id: string;
903
+ }
904
+ interface FetchTaskNodeSnapshotParams {
905
+ task_id: number | string;
906
+ node_id: string;
907
+ }
908
+ interface FetchTaskNodeLogParams {
909
+ task_id: number | string;
910
+ node_id: string;
911
+ version: string;
912
+ }
913
+ interface OperateTaskNodeParams {
914
+ task_id: number | string;
915
+ node_id: string;
916
+ action: ExecutionNodeAction;
917
+ data?: Record<string, unknown>;
918
+ /** 自定义 operation,优先级高于 action 默认映射 */
919
+ operation?: string;
920
+ }
921
+ interface GetFlowTaskDetailParams {
922
+ task_id: number | string;
923
+ }
924
+ interface FlowTaskDetail {
925
+ id: number | string;
926
+ template_id: number;
927
+ pipeline_tree: PipelineTree;
928
+ [key: string]: unknown;
929
+ }
930
+ interface CreateFlowTaskParams {
931
+ template_id: number;
932
+ name: string;
933
+ creator: string;
934
+ constants: Record<string, any>;
935
+ label_ids?: number[];
936
+ [key: string]: unknown;
937
+ }
938
+ interface CreateFlowTaskResult {
939
+ data: {
940
+ id: number | string;
941
+ template_id?: number;
942
+ [key: string]: unknown;
943
+ };
944
+ [key: string]: unknown;
945
+ }
946
+ interface ExecuteFlowTaskResult {
947
+ result?: boolean;
948
+ code?: number;
949
+ data?: {
950
+ /** 任务详情页跳转地址(含正确的 bkflow task id 与 templateId) */
951
+ url?: string;
952
+ [key: string]: unknown;
953
+ };
954
+ message?: string | null;
955
+ request_id?: string;
956
+ trace_id?: string | null;
957
+ [key: string]: unknown;
958
+ }
959
+ interface FlowTaskExecuteSuccessResult {
960
+ /** createFlowTask(create_task)接口响应 */
961
+ createResult: CreateFlowTaskResult;
962
+ /** executeFlowTask(operate_task)接口响应,data.url 用于任务详情跳转 */
963
+ executeResult: ExecuteFlowTaskResult;
964
+ }
965
+ interface TaskStateResult {
966
+ state?: string;
967
+ status?: string;
968
+ node_states?: TaskExecutionStates;
969
+ states?: Record<string, unknown>;
970
+ children?: Record<string, unknown> | unknown[];
971
+ nodes?: Record<string, unknown> | unknown[];
972
+ activities?: Record<string, unknown>;
973
+ gateways?: Record<string, unknown>;
974
+ [key: string]: unknown;
975
+ }
656
976
 
657
977
  interface FlowViewApiConfig {
658
978
  fetchFlowDetail: (id: string) => Promise<FlowTemplate>;
659
979
  fetchSpaceFlowConfig: (id: string) => Promise<SpaceFlowConfig>;
660
980
  fetchSystemVariables: (id: string) => Promise<Variable[]>;
981
+ /**
982
+ * 用户查询 API 地址
983
+ * @deprecated 请改用 memberSelectorConfig.fetchUserApi(顶层组件 prop)
984
+ */
661
985
  fetchUserApi?: string;
662
986
  /** 作用域数据(必需,由外部传入) */
663
987
  scopeData: {
664
988
  scope_type: string;
665
989
  scope_value: number;
990
+ /** 业务方传入的空间 ID,调试接口专用,语义独立于 scope_value */
991
+ space_id: number;
666
992
  };
667
993
  fetchFlowDraftDetail?: (id: string) => Promise<FlowDraftDetail>;
668
994
  fetchFlowDetailByVersion?: (id: string, version: string) => Promise<FlowDetailByVersion>;
@@ -682,24 +1008,32 @@ interface FlowViewApiConfig {
682
1008
  data: any[];
683
1009
  };
684
1010
  }>;
685
- createFlowTask?: (params: {
686
- template_id: number;
687
- name: string;
688
- creator: string;
689
- constants: Record<string, any>;
690
- }) => Promise<{
691
- data: {
692
- id: number;
693
- template_id: number;
694
- };
695
- }>;
1011
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
696
1012
  executeFlowTask?: (params: {
697
- task_id: number;
698
- action: string;
1013
+ task_id: number | string;
1014
+ resource_type: string;
1015
+ resource_id: number | string;
1016
+ permission_type: string;
1017
+ }) => Promise<ExecuteFlowTaskResult>;
1018
+ revokeFlowTask?: (params: {
1019
+ task_id: number | string;
699
1020
  resource_type: string;
700
- resource_id: number;
1021
+ resource_id: number | string;
701
1022
  permission_type: string;
702
1023
  }) => Promise<any>;
1024
+ createMockDebugTask?: (params: CreateMockDebugTaskParams) => Promise<{
1025
+ data: {
1026
+ id: number | string;
1027
+ template_id: number;
1028
+ };
1029
+ }>;
1030
+ stopMockDebugTask?: (params: StopMockDebugTaskParams) => Promise<void>;
1031
+ fetchTaskState?: (params: FetchTaskStateParams) => Promise<TaskStateResult>;
1032
+ fetchTaskNodeDetail?: (params: FetchTaskNodeDetailParams) => Promise<unknown>;
1033
+ fetchTaskNodeSnapshot?: (params: FetchTaskNodeSnapshotParams) => Promise<unknown>;
1034
+ fetchTaskNodeLog?: (params: FetchTaskNodeLogParams) => Promise<unknown>;
1035
+ operateTaskNode?: (params: OperateTaskNodeParams) => Promise<unknown>;
1036
+ getFlowTaskDetail?: (params: GetFlowTaskDetailParams) => Promise<FlowTaskDetail>;
703
1037
  fetchControlConfig?: () => Promise<Record<string, any>>;
704
1038
  checkSpaceConfig?: (scopeValue: number, params: {
705
1039
  name: string;
@@ -727,7 +1061,7 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
727
1061
  fetchBkFlowThirdPartyPluginTags: () => Promise<BkflowThirdPartyPluginGroupItem[]>;
728
1062
  fetchBkFlowThirdPartyPluginMeta: (plugin_code: string) => Promise<BkflowThirdPartyPluginMetaDetail>;
729
1063
  fetchBkFlowThirdPartyPluginDetail: (plugin_code: string, plugin_version: string) => Promise<BkflowThirdPartyPluginDetail>;
730
- fetchBkFlowThirdPartyPluginAppDetail: (plugin_code: string) => Promise<BkflowThirdPartyPluginAppDetail>;
1064
+ fetchBkFlowThirdPartyPluginAppDetail: (plugin_code: string, plugin_version: string) => Promise<BkflowThirdPartyPluginAppDetail>;
731
1065
  fetchPluginGroupList: () => Promise<PluginGroupConfig[]>;
732
1066
  fetchCategoryPlugins: (category: string) => Promise<PluginMetaItem[]>;
733
1067
  fetchAllPluginGroups: () => Promise<GroupsPluginItem[]>;
@@ -737,27 +1071,127 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
737
1071
  drawPipeline?: (params: DrawPipelineParams) => Promise<{
738
1072
  pipeline_tree: PipelineTree;
739
1073
  }>;
740
- createFlowTask?: (params: {
741
- template_id: number;
742
- name: string;
743
- creator: string;
744
- constants: Record<string, any>;
745
- }) => Promise<{
746
- data: {
747
- id: number;
748
- template_id: number;
749
- };
750
- }>;
1074
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
751
1075
  executeFlowTask?: (params: {
752
- task_id: number;
753
- action: string;
1076
+ task_id: number | string;
754
1077
  resource_type: string;
755
- resource_id: number;
1078
+ resource_id: number | string;
1079
+ permission_type: string;
1080
+ }) => Promise<ExecuteFlowTaskResult>;
1081
+ revokeFlowTask?: (params: {
1082
+ task_id: number | string;
1083
+ resource_type: string;
1084
+ resource_id: number | string;
756
1085
  permission_type: string;
757
1086
  }) => Promise<any>;
1087
+ createMockDebugTask?: (params: CreateMockDebugTaskParams) => Promise<{
1088
+ data: {
1089
+ id: number | string;
1090
+ template_id: number;
1091
+ };
1092
+ }>;
1093
+ stopMockDebugTask?: (params: StopMockDebugTaskParams) => Promise<void>;
1094
+ fetchTaskState?: (params: FetchTaskStateParams) => Promise<TaskStateResult>;
1095
+ fetchTaskNodeDetail?: (params: FetchTaskNodeDetailParams) => Promise<unknown>;
1096
+ fetchTaskNodeSnapshot?: (params: FetchTaskNodeSnapshotParams) => Promise<unknown>;
1097
+ fetchTaskNodeLog?: (params: FetchTaskNodeLogParams) => Promise<unknown>;
1098
+ getFlowTaskDetail?: (params: GetFlowTaskDetailParams) => Promise<FlowTaskDetail>;
1099
+ }
1100
+ interface FlowDetailApiConfig extends FlowEditApiConfig, Partial<DebugApiServices> {
758
1101
  }
759
1102
 
760
- type __VLS_Props$5 = {
1103
+ /**
1104
+ * 插件分组选择面板配置
1105
+ */
1106
+ interface SelectPanelConfig {
1107
+ agentApplyUrl?: string;
1108
+ agentResourceUrl?: string;
1109
+ agentButtonText?: string;
1110
+ knowledgebaseResourceUrl?: string;
1111
+ }
1112
+ /**
1113
+ * 人员选择器配置
1114
+ * 采用判别联合(discriminated union):
1115
+ * - mode 缺省或为 'legacy':使用组件内置的 UserSelector,依赖 fetchUserApi
1116
+ * - mode 为 'tenant':使用多租户人员选择器 @blueking/bk-user-selector,
1117
+ * tenantId 与 apiBaseUrl 在类型上即为必填
1118
+ * 接入方需自行安装 npm 包 @blueking/bk-user-selector
1119
+ */
1120
+ type MemberSelectorConfig = {
1121
+ mode?: 'legacy';
1122
+ /** 用户查询 API 地址 */
1123
+ fetchUserApi?: string;
1124
+ } | {
1125
+ mode: 'tenant';
1126
+ /** 租户 ID */
1127
+ tenantId: string;
1128
+ /** bk-user 服务的 API 基础地址 */
1129
+ apiBaseUrl: string;
1130
+ /** 当前登录用户 ID,开启后可在下拉中快捷选择"我" */
1131
+ currentUserId?: string;
1132
+ /** 是否启用跨租户搜索,默认 false */
1133
+ enableMultiTenantMode?: boolean;
1134
+ /** 是否展示头像,默认 false */
1135
+ hasAvatar?: boolean;
1136
+ /** 头像 CDN 基础地址 */
1137
+ avatarBaseUrl?: string;
1138
+ /** 最近选择的用户 ID 列表 */
1139
+ recentUserIds?: string[];
1140
+ };
1141
+ /**
1142
+ * 在顶层组件中提供 FlowApiConfig
1143
+ * @param config FlowApiConfig 配置对象或已处理的 API 配置对象
1144
+ * @returns 返回处理后的 API 配置对象
1145
+ */
1146
+ declare function provideFlowApiConfig(config: FlowApiConfig | FlowDetailApiConfig | FlowEditApiConfig | FlowViewApiConfig): FlowDetailApiConfig | FlowEditApiConfig | FlowViewApiConfig;
1147
+ /**
1148
+ * 在子组件中注入 FlowApiConfig(通用版本)
1149
+ * @returns FlowEditApiConfig
1150
+ * @throws 如果 apiConfig 未提供则抛出错误
1151
+ */
1152
+ declare function useFlowApiConfig(): FlowDetailApiConfig;
1153
+ /**
1154
+ * 在子组件中注入 FlowEditApiConfig(类型化版本)
1155
+ * @returns FlowEditApiConfig
1156
+ */
1157
+ declare function useFlowEditApiConfig(): FlowEditApiConfig;
1158
+ /**
1159
+ * 在子组件中注入 FlowViewApiConfig(类型化版本)
1160
+ * 注意:实际上返回的是 FlowEditApiConfig,但类型上兼容 FlowViewApiConfig
1161
+ * @returns FlowViewApiConfig
1162
+ */
1163
+ declare function useFlowViewApiConfig(): FlowViewApiConfig;
1164
+ /**
1165
+ * 在顶层组件中提供 SelectPanelConfig
1166
+ * @param config SelectPanelConfig 配置对象
1167
+ */
1168
+ declare function provideSelectPanelConfig(config: SelectPanelConfig): void;
1169
+ /**
1170
+ * 在子组件中注入 SelectPanelConfig
1171
+ * @returns SelectPanelConfig 或 null(如果未提供配置)
1172
+ */
1173
+ declare function useSelectPanelConfig(): SelectPanelConfig | null;
1174
+ /**
1175
+ * 在顶层组件中提供 MemberSelectorConfig
1176
+ *
1177
+ * 注意:当 `config` 为 undefined 时,**不会调用 provide**,从而不会遮蔽
1178
+ * 父级(如外层 FlowView/FlowEdit)已经 provide 的配置。
1179
+ * 例如 `FlowView` 内部渲染 `FlowCreateTask` 时,如果调用方仅在 `FlowView`
1180
+ * 上传入 `memberSelectorConfig`,则 `FlowCreateTask` 不会因为自己未收到 prop
1181
+ * 而把 tenant 配置覆盖回 legacy。
1182
+ *
1183
+ * 若调用方主动传入 `{ mode: 'legacy' }`,则视为显式覆盖,按正常 provide。
1184
+ *
1185
+ * @param config MemberSelectorConfig 配置对象;为 undefined 时跳过 provide
1186
+ */
1187
+ declare function provideMemberSelectorConfig(config?: MemberSelectorConfig): void;
1188
+ /**
1189
+ * 在子组件中注入 MemberSelectorConfig
1190
+ * @returns MemberSelectorConfig,未提供时返回 { mode: 'legacy' }
1191
+ */
1192
+ declare function useMemberSelectorConfig(): MemberSelectorConfig;
1193
+
1194
+ type __VLS_Props$6 = {
761
1195
  flowId: string;
762
1196
  show: boolean;
763
1197
  editable?: boolean;
@@ -768,10 +1202,12 @@ type __VLS_Props$5 = {
768
1202
  variablesValue: Record<string, any>;
769
1203
  }) => Promise<void> | void;
770
1204
  useCustomConfirm?: boolean;
771
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
1205
+ mockData?: CreateMockDebugTaskParams['mock_data'];
1206
+ onExecuteSuccess?: (taskId: number | string, templateId: number) => void;
772
1207
  bkflowSaasUrl?: string;
773
1208
  enableVersion?: boolean;
774
1209
  flowVersion?: string;
1210
+ memberSelectorConfig?: MemberSelectorConfig;
775
1211
  };
776
1212
  declare var __VLS_72: {
777
1213
  formData: {
@@ -779,15 +1215,15 @@ declare var __VLS_72: {
779
1215
  };
780
1216
  variablesValue: Record<string, any>;
781
1217
  };
782
- type __VLS_Slots$4 = {} & {
1218
+ type __VLS_Slots$6 = {} & {
783
1219
  'custom-form-content'?: (props: typeof __VLS_72) => any;
784
1220
  };
785
- declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1221
+ declare const __VLS_base$6: vue.DefineComponent<__VLS_Props$6, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
786
1222
  close: (...args: any[]) => void;
787
1223
  "update:show": (...args: any[]) => void;
788
1224
  confirm: (...args: any[]) => void;
789
1225
  "before-close": (...args: any[]) => void;
790
- }, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{
1226
+ }, string, vue.PublicProps, Readonly<__VLS_Props$6> & Readonly<{
791
1227
  onClose?: ((...args: any[]) => any) | undefined;
792
1228
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
793
1229
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -795,13 +1231,13 @@ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, v
795
1231
  }>, {
796
1232
  editable: boolean;
797
1233
  showFlowEntry: boolean;
798
- enableVersion: boolean;
799
1234
  useCustomConfirm: boolean;
1235
+ enableVersion: boolean;
800
1236
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
801
- declare const __VLS_export$5: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
802
- declare const _default$6: typeof __VLS_export$5;
1237
+ declare const __VLS_export$6: __VLS_WithSlots$6<typeof __VLS_base$6, __VLS_Slots$6>;
1238
+ declare const _default$7: typeof __VLS_export$6;
803
1239
 
804
- type __VLS_WithSlots$4<T, S> = T & {
1240
+ type __VLS_WithSlots$6<T, S> = T & {
805
1241
  new (): {
806
1242
  $slots: S;
807
1243
  };
@@ -809,15 +1245,15 @@ type __VLS_WithSlots$4<T, S> = T & {
809
1245
 
810
1246
  declare namespace __debug_vue {
811
1247
  export {
812
- _default$6 as default,
1248
+ _default$7 as default,
813
1249
  };
814
1250
  }
815
1251
 
816
- type __VLS_Slots$3 = {
1252
+ type __VLS_Slots$5 = {
817
1253
  header?: () => any;
818
1254
  extend?: () => any;
819
1255
  };
820
- type __VLS_Props$4 = {
1256
+ type __VLS_Props$5 = {
821
1257
  pipelineTree: PipelineTree;
822
1258
  nodeStates?: TaskExecutionStates;
823
1259
  defaultZoom?: number;
@@ -826,15 +1262,15 @@ type __VLS_Props$4 = {
826
1262
  showHeader?: boolean;
827
1263
  onBack?: () => void;
828
1264
  };
829
- declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1265
+ declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
830
1266
  retry: (nodeId: string) => any;
831
1267
  skip: (nodeId: string) => any;
832
1268
  resume: (nodeId: string) => any;
833
1269
  approve: (nodeId: string) => any;
834
1270
  forceFail: (nodeId: string) => any;
835
1271
  gatewaySkip: (nodeId: string) => any;
836
- back: () => any;
837
1272
  "ui-event": (event: CanvasUiEvent) => any;
1273
+ back: () => any;
838
1274
  "node-click": (event: {
839
1275
  type: "node.click";
840
1276
  nodeId: string;
@@ -845,15 +1281,15 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, v
845
1281
  nodeId: string;
846
1282
  action: ExecutionNodeAction;
847
1283
  }) => any;
848
- }, string, vue.PublicProps, Readonly<__VLS_Props$4> & Readonly<{
1284
+ }, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{
849
1285
  onRetry?: ((nodeId: string) => any) | undefined;
850
1286
  onSkip?: ((nodeId: string) => any) | undefined;
851
1287
  onResume?: ((nodeId: string) => any) | undefined;
852
1288
  onApprove?: ((nodeId: string) => any) | undefined;
853
1289
  onForceFail?: ((nodeId: string) => any) | undefined;
854
1290
  onGatewaySkip?: ((nodeId: string) => any) | undefined;
855
- onBack?: (() => any) | undefined;
856
1291
  "onUi-event"?: ((event: CanvasUiEvent) => any) | undefined;
1292
+ onBack?: (() => any) | undefined;
857
1293
  "onNode-click"?: ((event: {
858
1294
  type: "node.click";
859
1295
  nodeId: string;
@@ -869,10 +1305,10 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, v
869
1305
  defaultZoom: number;
870
1306
  nodeStates: TaskExecutionStates;
871
1307
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
872
- declare const __VLS_export$4: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
873
- declare const _default$5: typeof __VLS_export$4;
1308
+ declare const __VLS_export$5: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
1309
+ declare const _default$6: typeof __VLS_export$5;
874
1310
 
875
- type __VLS_WithSlots$3<T, S> = T & {
1311
+ type __VLS_WithSlots$5<T, S> = T & {
876
1312
  new (): {
877
1313
  $slots: S;
878
1314
  };
@@ -880,26 +1316,35 @@ type __VLS_WithSlots$3<T, S> = T & {
880
1316
 
881
1317
  declare namespace __execute_vue {
882
1318
  export {
883
- _default$5 as default,
1319
+ _default$6 as default,
884
1320
  };
885
1321
  }
886
1322
 
887
- type __VLS_Props$3 = {
1323
+ type __VLS_Slots$4 = {
1324
+ customFormContent?: (props: {
1325
+ customFormData: Record<string, any>;
1326
+ additionalTaskParams: Record<string, any>;
1327
+ updateCustomFormData: (data: Record<string, any>) => void;
1328
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1329
+ }) => any;
1330
+ };
1331
+ type __VLS_Props$4 = {
888
1332
  flowId: string;
889
1333
  show: boolean;
890
1334
  editable?: boolean;
891
1335
  showFlowEntry?: boolean;
892
1336
  apiConfig: FlowApiConfig;
893
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
1337
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
894
1338
  bkflowSaasUrl?: string;
1339
+ memberSelectorConfig?: MemberSelectorConfig;
895
1340
  };
896
- declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1341
+ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
897
1342
  close: (...args: any[]) => void;
898
1343
  "update:show": (...args: any[]) => void;
899
1344
  confirm: (...args: any[]) => void;
900
1345
  "before-close": (...args: any[]) => void;
901
1346
  "view-flow": (...args: any[]) => void;
902
- }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1347
+ }, string, vue.PublicProps, Readonly<__VLS_Props$4> & Readonly<{
903
1348
  onClose?: ((...args: any[]) => any) | undefined;
904
1349
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
905
1350
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -909,58 +1354,22 @@ declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {},
909
1354
  editable: boolean;
910
1355
  showFlowEntry: boolean;
911
1356
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
912
- declare const _default$4: typeof __VLS_export$3;
1357
+ declare const __VLS_export$4: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
1358
+ declare const _default$5: typeof __VLS_export$4;
1359
+
1360
+ type __VLS_WithSlots$4<T, S> = T & {
1361
+ new (): {
1362
+ $slots: S;
1363
+ };
1364
+ };
913
1365
 
914
1366
  declare namespace __create_task_vue {
915
1367
  export {
916
- _default$4 as default,
1368
+ _default$5 as default,
917
1369
  };
918
1370
  }
919
1371
 
920
- /**
921
- * 插件分组选择面板配置
922
- */
923
- interface SelectPanelConfig {
924
- agentApplyUrl?: string;
925
- agentResourceUrl?: string;
926
- agentButtonText?: string;
927
- knowledgebaseResourceUrl?: string;
928
- }
929
- /**
930
- * 在顶层组件中提供 FlowApiConfig
931
- * @param config FlowApiConfig 配置对象或已处理的 API 配置对象
932
- * @returns 返回处理后的 API 配置对象
933
- */
934
- declare function provideFlowApiConfig(config: FlowApiConfig | FlowEditApiConfig | FlowViewApiConfig): FlowEditApiConfig | FlowViewApiConfig;
935
- /**
936
- * 在子组件中注入 FlowApiConfig(通用版本)
937
- * @returns FlowEditApiConfig
938
- * @throws 如果 apiConfig 未提供则抛出错误
939
- */
940
- declare function useFlowApiConfig(): FlowEditApiConfig;
941
- /**
942
- * 在子组件中注入 FlowEditApiConfig(类型化版本)
943
- * @returns FlowEditApiConfig
944
- */
945
- declare function useFlowEditApiConfig(): FlowEditApiConfig;
946
- /**
947
- * 在子组件中注入 FlowViewApiConfig(类型化版本)
948
- * 注意:实际上返回的是 FlowEditApiConfig,但类型上兼容 FlowViewApiConfig
949
- * @returns FlowViewApiConfig
950
- */
951
- declare function useFlowViewApiConfig(): FlowViewApiConfig;
952
- /**
953
- * 在顶层组件中提供 SelectPanelConfig
954
- * @param config SelectPanelConfig 配置对象
955
- */
956
- declare function provideSelectPanelConfig(config: SelectPanelConfig): void;
957
- /**
958
- * 在子组件中注入 SelectPanelConfig
959
- * @returns SelectPanelConfig 或 null(如果未提供配置)
960
- */
961
- declare function useSelectPanelConfig(): SelectPanelConfig | null;
962
-
963
- type __VLS_Slots$2 = {
1372
+ type __VLS_Slots$3 = {
964
1373
  header?: () => any;
965
1374
  inputParams?: (props: {
966
1375
  node: any;
@@ -984,7 +1393,7 @@ type __VLS_Slots$2 = {
984
1393
  variablesValue: Record<string, any>;
985
1394
  }) => any;
986
1395
  };
987
- type __VLS_Props$2 = {
1396
+ type __VLS_Props$3 = {
988
1397
  flowId: string;
989
1398
  apiConfig: FlowApiConfig;
990
1399
  permissions?: {
@@ -997,49 +1406,76 @@ type __VLS_Props$2 = {
997
1406
  }) => Promise<void> | void;
998
1407
  useCustomDebugConfirm?: boolean;
999
1408
  selectPanelConfig?: SelectPanelConfig;
1409
+ memberSelectorConfig?: MemberSelectorConfig;
1000
1410
  onSave?: (flowData: FlowTemplate) => void;
1001
1411
  onSaveSuccess?: () => void;
1002
1412
  onBack?: () => void;
1003
1413
  onExitEdit?: () => void;
1004
1414
  onBeforeLeave?: (isEdited: boolean) => Promise<boolean>;
1415
+ onMockDebugCreated?: (params: {
1416
+ taskId: number | string;
1417
+ templateId: number | string;
1418
+ }) => void;
1005
1419
  enableVersion?: boolean;
1006
1420
  flowVersion?: string;
1007
1421
  defaultZoom?: number;
1008
1422
  bkflowSaasUrl?: string;
1009
1423
  enableThirdPlugin?: boolean;
1010
1424
  quickAdd?: QuickAddConfig;
1425
+ /** 是否隐藏基础信息中的触发器配置表单,默认 false */
1426
+ hideTrigger?: boolean;
1011
1427
  };
1012
- declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1428
+ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$3, {
1013
1429
  isFlowEdited: ComputedRef<FlowEditExpose["isFlowEdited"]>;
1014
1430
  updateNodeInputParams: FlowEditExpose["updateNodeInputParams"];
1015
1431
  openGlobalVariables: FlowEditExpose["openGlobalVariables"];
1432
+ zoomToFit: FlowEditExpose["zoomToFit"];
1433
+ centerContent: FlowEditExpose["centerContent"];
1434
+ getZoom: FlowEditExpose["getZoom"];
1016
1435
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1017
1436
  back: () => any;
1018
1437
  save: (flowData: FlowTemplate) => any;
1438
+ mockDebugCreated: (params: {
1439
+ taskId: number | string;
1440
+ templateId: number | string;
1441
+ }) => any;
1019
1442
  saveSuccess: () => any;
1020
1443
  exitEdit: () => any;
1021
1444
  debugBeforeClose: () => any;
1022
- }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
1445
+ createVariable: (payload: {
1446
+ keyword: string;
1447
+ cursorIndex: number;
1448
+ }) => any;
1449
+ }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1023
1450
  onBack?: (() => any) | undefined;
1024
1451
  onSave?: ((flowData: FlowTemplate) => any) | undefined;
1452
+ onMockDebugCreated?: ((params: {
1453
+ taskId: number | string;
1454
+ templateId: number | string;
1455
+ }) => any) | undefined;
1025
1456
  onSaveSuccess?: (() => any) | undefined;
1026
1457
  onExitEdit?: (() => any) | undefined;
1027
1458
  onDebugBeforeClose?: (() => any) | undefined;
1459
+ onCreateVariable?: ((payload: {
1460
+ keyword: string;
1461
+ cursorIndex: number;
1462
+ }) => any) | undefined;
1028
1463
  }>, {
1029
1464
  quickAdd: QuickAddConfig;
1465
+ enableThirdPlugin: boolean;
1466
+ hideTrigger: boolean;
1030
1467
  defaultZoom: number;
1468
+ enableDebug: boolean;
1469
+ enableVersion: boolean;
1031
1470
  permissions: {
1032
1471
  canSave?: boolean;
1033
1472
  };
1034
- enableVersion: boolean;
1035
- enableDebug: boolean;
1036
1473
  useCustomDebugConfirm: boolean;
1037
- enableThirdPlugin: boolean;
1038
1474
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1039
- declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
1040
- declare const _default$3: typeof __VLS_export$2;
1475
+ declare const __VLS_export$3: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
1476
+ declare const _default$4: typeof __VLS_export$3;
1041
1477
 
1042
- type __VLS_WithSlots$2<T, S> = T & {
1478
+ type __VLS_WithSlots$3<T, S> = T & {
1043
1479
  new (): {
1044
1480
  $slots: S;
1045
1481
  };
@@ -1047,11 +1483,11 @@ type __VLS_WithSlots$2<T, S> = T & {
1047
1483
 
1048
1484
  declare namespace __edit_vue {
1049
1485
  export {
1050
- _default$3 as default,
1486
+ _default$4 as default,
1051
1487
  };
1052
1488
  }
1053
1489
 
1054
- type __VLS_Slots$1 = {
1490
+ type __VLS_Slots$2 = {
1055
1491
  header?: () => any;
1056
1492
  inputParams?: (props: {
1057
1493
  node: any;
@@ -1064,12 +1500,25 @@ type __VLS_Slots$1 = {
1064
1500
  }[];
1065
1501
  updateInputParams: (data: Record<string, any>) => void;
1066
1502
  }) => any;
1503
+ customFormContent?: (props: {
1504
+ customFormData: Record<string, any>;
1505
+ additionalTaskParams: Record<string, any>;
1506
+ updateCustomFormData: (data: Record<string, any>) => void;
1507
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1508
+ }) => any;
1509
+ debugCustomFormContent?: (props: {
1510
+ formData: {
1511
+ name: string;
1512
+ };
1513
+ variablesValue: Record<string, any>;
1514
+ }) => any;
1067
1515
  };
1068
- type __VLS_Props$1 = {
1516
+ type __VLS_Props$2 = {
1069
1517
  flowId: string;
1070
1518
  apiConfig: FlowApiConfig;
1071
1519
  permissions?: {
1072
1520
  canEdit?: boolean;
1521
+ canExecute?: boolean;
1073
1522
  };
1074
1523
  onEdit?: () => void;
1075
1524
  onBack?: () => void;
@@ -1079,27 +1528,50 @@ type __VLS_Props$1 = {
1079
1528
  showHeaderActions?: boolean;
1080
1529
  defaultZoom?: number;
1081
1530
  bkflowSaasUrl?: string;
1082
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
1531
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1532
+ memberSelectorConfig?: MemberSelectorConfig;
1533
+ enableDebug?: boolean;
1534
+ onMockDebugCreated?: (params: {
1535
+ taskId: number | string;
1536
+ templateId: number | string;
1537
+ }) => void;
1538
+ /** 是否隐藏基础信息中的触发器配置表单,默认 false */
1539
+ hideTrigger?: boolean;
1083
1540
  };
1084
- declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1085
- back: () => any;
1541
+ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1542
+ zoomToFit: (options?: ZoomToFitOptions) => void;
1543
+ centerContent: () => void;
1544
+ getZoom: () => number;
1545
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1086
1546
  edit: () => any;
1087
- }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
1088
- onBack?: (() => any) | undefined;
1547
+ back: () => any;
1548
+ mockDebugCreated: (params: {
1549
+ taskId: number | string;
1550
+ templateId: number | string;
1551
+ }) => any;
1552
+ }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
1089
1553
  onEdit?: (() => any) | undefined;
1554
+ onBack?: (() => any) | undefined;
1555
+ onMockDebugCreated?: ((params: {
1556
+ taskId: number | string;
1557
+ templateId: number | string;
1558
+ }) => any) | undefined;
1090
1559
  }>, {
1091
1560
  thumbnail: boolean;
1561
+ hideTrigger: boolean;
1092
1562
  defaultZoom: number;
1563
+ enableDebug: boolean;
1564
+ enableVersion: boolean;
1093
1565
  permissions: {
1094
1566
  canEdit?: boolean;
1567
+ canExecute?: boolean;
1095
1568
  };
1096
- enableVersion: boolean;
1097
1569
  showHeaderActions: boolean;
1098
1570
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1099
- declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
1100
- declare const _default$2: typeof __VLS_export$1;
1571
+ declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
1572
+ declare const _default$3: typeof __VLS_export$2;
1101
1573
 
1102
- type __VLS_WithSlots$1<T, S> = T & {
1574
+ type __VLS_WithSlots$2<T, S> = T & {
1103
1575
  new (): {
1104
1576
  $slots: S;
1105
1577
  };
@@ -1107,10 +1579,148 @@ type __VLS_WithSlots$1<T, S> = T & {
1107
1579
 
1108
1580
  declare namespace __view_vue {
1109
1581
  export {
1110
- _default$2 as default,
1582
+ _default$3 as default,
1111
1583
  };
1112
1584
  }
1113
1585
 
1586
+ /**
1587
+ * FlowDetail 权限(默认拒绝,设计 §3.1 / §7.2)。
1588
+ */
1589
+ interface FlowDetailPermissions {
1590
+ canEdit: boolean;
1591
+ canDebug: boolean;
1592
+ canExecute: boolean;
1593
+ }
1594
+
1595
+ type __VLS_Slots$1 = {
1596
+ header?: () => any;
1597
+ inputParams?: (props: {
1598
+ node: any;
1599
+ pluginDetail: PluginDetailCommon | null;
1600
+ inputs: any[];
1601
+ editable: boolean;
1602
+ fullVariableList: {
1603
+ key: string;
1604
+ name: string;
1605
+ source_type?: string;
1606
+ custom_type?: string;
1607
+ }[];
1608
+ updateInputParams: (data: Record<string, PluginInputDataItem>) => void;
1609
+ updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
1610
+ updateVariableSourceInfo: (variableKey: string, nodeId: string, formKey: string) => void;
1611
+ }) => any;
1612
+ customFormContent?: (props: {
1613
+ customFormData: Record<string, any>;
1614
+ additionalTaskParams: Record<string, any>;
1615
+ updateCustomFormData: (data: Record<string, any>) => void;
1616
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1617
+ }) => any;
1618
+ };
1619
+ type __VLS_Props$1 = {
1620
+ flowId: string;
1621
+ apiConfig: FlowApiConfig | FlowDetailApiConfig;
1622
+ permissions?: Partial<FlowDetailPermissions>;
1623
+ enableVersion?: boolean;
1624
+ flowVersion?: string;
1625
+ defaultZoom?: number;
1626
+ bkflowSaasUrl?: string;
1627
+ enableThirdPlugin?: boolean;
1628
+ quickAdd?: QuickAddConfig;
1629
+ hideTrigger?: boolean;
1630
+ selectPanelConfig?: SelectPanelConfig;
1631
+ memberSelectorConfig?: MemberSelectorConfig;
1632
+ onSave?: (flowData: FlowTemplate) => void;
1633
+ onSaveSuccess?: () => void;
1634
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1635
+ onBack?: () => void;
1636
+ };
1637
+ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {
1638
+ isFlowEdited: ComputedRef<boolean>;
1639
+ updateNodeInputParams: FlowDetailExpose["updateNodeInputParams"];
1640
+ openGlobalVariables: FlowDetailExpose["openGlobalVariables"];
1641
+ refreshDebugContext: FlowDetailExpose["refreshDebugContext"];
1642
+ openDebugResult: FlowDetailExpose["openDebugResult"];
1643
+ zoomToFit: FlowDetailExpose["zoomToFit"];
1644
+ centerContent: FlowDetailExpose["centerContent"];
1645
+ getZoom: FlowDetailExpose["getZoom"];
1646
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1647
+ back: () => any;
1648
+ save: (flowData: FlowTemplate) => any;
1649
+ saveSuccess: () => any;
1650
+ createVariable: (payload: {
1651
+ keyword: string;
1652
+ cursorIndex: number;
1653
+ }) => any;
1654
+ }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
1655
+ onBack?: (() => any) | undefined;
1656
+ onSave?: ((flowData: FlowTemplate) => any) | undefined;
1657
+ onSaveSuccess?: (() => any) | undefined;
1658
+ onCreateVariable?: ((payload: {
1659
+ keyword: string;
1660
+ cursorIndex: number;
1661
+ }) => any) | undefined;
1662
+ }>, {
1663
+ quickAdd: QuickAddConfig;
1664
+ enableThirdPlugin: boolean;
1665
+ hideTrigger: boolean;
1666
+ defaultZoom: number;
1667
+ enableVersion: boolean;
1668
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1669
+ declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
1670
+ declare const _default$2: typeof __VLS_export$1;
1671
+
1672
+ type __VLS_WithSlots$1<T, S> = T & {
1673
+ new (): {
1674
+ $slots: S;
1675
+ };
1676
+ };
1677
+
1678
+ type SimulateDebugStage = 'edit' | 'mock-config' | 'mock-running';
1679
+ type MockFormControl = 'bk-input' | 'bk-input-number' | 'bk-textarea' | 'json-editor' | 'bk-select' | 'bk-checkbox-group' | 'bk-radio-group' | 'bk-switcher' | 'bk-date-picker' | 'bk-date-range-picker' | 'data-table';
1680
+ interface MockOutputField extends PluginOutputItem {
1681
+ form_type?: string;
1682
+ options?: Array<{
1683
+ label: string;
1684
+ value: unknown;
1685
+ text?: string;
1686
+ }>;
1687
+ schema?: Record<string, unknown>;
1688
+ default?: unknown;
1689
+ }
1690
+ interface NodeMockConfig {
1691
+ nodeId: string;
1692
+ outputs: Record<string, unknown>;
1693
+ fieldSnapshots: Record<string, MockOutputField>;
1694
+ }
1695
+ interface SimulateDebugState {
1696
+ stage: SimulateDebugStage;
1697
+ selectedNodeIds: Set<string>;
1698
+ mockConfigs: Record<string, NodeMockConfig>;
1699
+ activeConfigNodeId?: string;
1700
+ activeRunningNodeId?: string;
1701
+ taskId?: number | string;
1702
+ taskStatus?: 'RUNNING' | 'FINISHED' | 'FAILED';
1703
+ taskStartedAt?: number;
1704
+ nodeStates?: TaskExecutionStates;
1705
+ resultDrawerOpen: boolean;
1706
+ }
1707
+ interface SimulateDebugCanvasContext {
1708
+ stage: Ref<SimulateDebugStage>;
1709
+ isMockSelected: (nodeId: string) => boolean;
1710
+ toggleMockSelected: (nodeId: string) => void;
1711
+ hasMockConfig: (nodeId: string) => boolean;
1712
+ isAllMockNodesSelected?: () => boolean;
1713
+ }
1714
+
1715
+ interface OutputNormalizeOptions {
1716
+ includeSystem?: boolean;
1717
+ }
1718
+ declare function mergeOutputs(...groups: Array<Array<PluginOutputItem | MockOutputField>>): MockOutputField[];
1719
+ declare function normalizePluginOutputItems(outputs: unknown, options?: OutputNormalizeOptions): MockOutputField[];
1720
+ declare function resolveMockFormControl(field: MockOutputField): MockFormControl;
1721
+
1722
+ declare function isMockableNode(node: NodeType | Activity | undefined | null): node is Activity;
1723
+
1114
1724
  declare const random4: () => string;
1115
1725
  declare const generateId: (group?: number) => string;
1116
1726
 
@@ -1127,6 +1737,12 @@ declare const getVariableDefaultConfig: () => Variable;
1127
1737
 
1128
1738
  declare const getUniformApiPluginFormValue: (config: UniformApiPluginInputsItem$1) => PluginInputDataItem["value"];
1129
1739
 
1740
+ type BkflowBusinessCanvasMode = 'edit' | 'view' | 'mock-config' | 'execute';
1741
+ interface BkflowSchemaOptions {
1742
+ getBusinessMode?: () => BkflowBusinessCanvasMode;
1743
+ }
1744
+ declare function createBkflowSchema(options?: BkflowSchemaOptions): CanvasSchema;
1745
+
1130
1746
  declare class BkFlowNodeAccessor {
1131
1747
  private node;
1132
1748
  constructor(node: FlowNodeModel);
@@ -1168,15 +1784,35 @@ declare class BkFlowModelAccessor {
1168
1784
  get flowModel(): FlowModel;
1169
1785
  }
1170
1786
 
1787
+ /**
1788
+ * 新调试(FlowDetail)向画布节点透出的最小上下文(设计 §14.3)。
1789
+ *
1790
+ * - isMockNode:节点渲染据此显示 MOCK 标签;
1791
+ * - 其余为可选能力:独立调试聚焦态、打开节点调试面板。
1792
+ * 保持可选以兼容仅需 Mock 标签的场景,且不改变对外 npm 公共 API。
1793
+ */
1794
+ interface DebugCanvasContext {
1795
+ isMockNode(nodeId: string): boolean;
1796
+ /** 节点调试状态;任务节点用它补充未执行(not_run)标识,不写入连线执行态。 */
1797
+ getNodeStatus?(nodeId: string): string | undefined;
1798
+ /** 当前独立调试聚焦节点(不复用 X6 编辑选择态,设计 §9.3.2) */
1799
+ focusedNodeId?(): string;
1800
+ /** 打开该节点详情侧滑的“调试配置”Tab */
1801
+ openNodeDebugPanel?(nodeId: string): void;
1802
+ }
1803
+
1171
1804
  type __VLS_Props = {
1172
1805
  pipelineTree: PipelineTree;
1173
- mode?: 'edit' | 'view';
1806
+ mode?: BkflowBusinessCanvasMode;
1174
1807
  thumbnail?: boolean;
1175
1808
  defaultZoom?: number;
1176
1809
  nodeActions?: NodeActionsConfig;
1177
1810
  quickAdd?: QuickAddConfig;
1178
1811
  connectionValidator?: ConnectionValidator;
1179
1812
  additionalPlugins?: CanvasPlugin[];
1813
+ toolbarItems?: CanvasToolbarItem[];
1814
+ simulateDebugContext?: SimulateDebugCanvasContext;
1815
+ debugContext?: DebugCanvasContext;
1180
1816
  };
1181
1817
  declare var __VLS_8: {};
1182
1818
  declare var __VLS_22: {
@@ -1271,8 +1907,8 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
1271
1907
  }) => any) | undefined;
1272
1908
  "onFormat-position"?: (() => any) | undefined;
1273
1909
  }>, {
1274
- mode: "edit" | "view";
1275
1910
  thumbnail: boolean;
1911
+ mode: BkflowBusinessCanvasMode;
1276
1912
  nodeActions: NodeActionsConfig;
1277
1913
  quickAdd: QuickAddConfig;
1278
1914
  defaultZoom: number;
@@ -1303,8 +1939,6 @@ declare function importFromPipelineTree(tree: PipelineTree): FlowModel;
1303
1939
 
1304
1940
  declare function exportToPipelineTree(flowModel: FlowModel): PipelineTree;
1305
1941
 
1306
- declare function createBkflowSchema(): CanvasSchema;
1307
-
1308
1942
  /**
1309
1943
  * 创建 bkflow 业务插件实例。
1310
1944
  * 每次调用返回独立实例,避免多个画布共享模块级可变状态。
@@ -1317,7 +1951,8 @@ declare function createBkflowSchema(): CanvasSchema;
1317
1951
  * 若目标是 placeholder 且删后无入边,级联删除该 placeholder
1318
1952
  * - edge.reconnect:若源从条件网关迁出,清理旧条件
1319
1953
  * - node.remove:主动查找将被级联删除的边,清理对应网关条件;
1320
- * 若删除的是分支网关,级联删除关联的 placeholder 节点
1954
+ * 若删除的是分支网关,级联删除关联的 placeholder 节点;
1955
+ * 同时清理全局变量中对被删除节点的 source_info 引用,并删除已无引用的变量
1321
1956
  */
1322
1957
  declare function createBkflowPlugin(): CanvasPlugin;
1323
1958
 
@@ -1346,7 +1981,12 @@ declare const _default: {
1346
1981
  FlowCreateTask: () => Promise<typeof __create_task_vue>;
1347
1982
  FlowExecute: () => Promise<typeof __execute_vue>;
1348
1983
  FlowDebug: () => Promise<typeof __debug_vue>;
1984
+ /**
1985
+ * @deprecated Use FlowDetail with permissions.canDebug instead.
1986
+ * FlowMockDebug will be removed in the next major version.
1987
+ */
1988
+ FlowMockDebug: () => Promise<typeof __mock_vue>;
1349
1989
  };
1350
1990
 
1351
- 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 };
1352
- export type { Activity, DndNodeItem, ExecutionNodeAction, FlowApiConfig, FlowEditExpose, FlowTemplate, Gateway, GatewayCondition, NodeExecutionState, NodeExecutionStatus, NotifyConfig, PipelineTree, PluginDetailCommon, PluginInputDataItem, SelectPanelConfig, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };
1991
+ export { _default$1 as BkFlowCanvas, BkFlowModelAccessor, BkFlowNodeAccessor, _default$5 as FlowCreateTask, _default$7 as FlowDebug, _default$2 as FlowDetail, _default$4 as FlowEdit, _default$6 as FlowExecute, _default$8 as FlowMockDebug, _default$3 as FlowView, bkflowConnectionValidator, createBkflowPlugin, createBkflowSchema, createExecutionStatusPlugin, _default as default, exportToPipelineTree, generateId, getUniformApiPluginFormValue, getVariableDefaultConfig, importFromPipelineTree, isMockableNode, mergeOutputs, normalizePluginOutputItems, provideFlowApiConfig, provideMemberSelectorConfig, provideSelectPanelConfig, random4, resolveExecutionActions, resolveMockFormControl, useFlowApiConfig, useFlowEditApiConfig, useFlowViewApiConfig, useMemberSelectorConfig, useSelectPanelConfig, validatePipelineTree };
1992
+ export type { Activity, CanvasViewportExpose, CreateFlowTaskResult, DndNodeItem, ExecuteFlowTaskResult, ExecutionNodeAction, FlowApiConfig, FlowDetailExpose, FlowDetailPermissions, FlowEditExpose, FlowTaskExecuteSuccessResult, FlowTemplate, FlowViewExpose, Gateway, GatewayCondition, MemberSelectorConfig, MockOutputField, NodeExecutionState, NodeExecutionStatus, NodeMockConfig, NotifyConfig, PipelineTree, PluginDetailCommon, PluginInputDataItem, SelectPanelConfig, SimulateDebugCanvasContext, SimulateDebugStage, SimulateDebugState, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };