@blueking/bkflow-canvas-editor 1.1.0-beta.2 → 1.1.0-beta.21

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
@@ -1,9 +1,8 @@
1
1
  import * as vue from 'vue';
2
- import { ComputedRef, Ref } from 'vue';
2
+ import { Component, 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, CanvasSchema, FlowModel, FlowNodeModel, NodeActionsConfig, ConnectionValidator, CanvasPlugin, CanvasToolbarItem, CommandEnvelope } 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
7
  /**
9
8
  * Flow API 配置接口
@@ -18,10 +17,7 @@ interface FlowApiConfig {
18
17
  /** CSRF cookie 名称(可选,用于创建新的 axios 实例时设置 xsrfCookieName) */
19
18
  xsrfCookieName?: string;
20
19
  /** 作用域数据(必需,由外部传入) */
21
- scopeData: {
22
- scope_type: string;
23
- scope_value: number;
24
- };
20
+ scopeData: ScopeData;
25
21
  /**
26
22
  * 用户查询 API 地址(可选)
27
23
  * @deprecated 请改用 FlowEdit/FlowView 顶层组件的 `memberSelectorConfig.fetchUserApi`。
@@ -31,12 +27,18 @@ interface FlowApiConfig {
31
27
  /** 是否启用第三方插件(可选,默认为 true) */
32
28
  enableThirdPlugin?: boolean;
33
29
  }
30
+ interface ScopeData {
31
+ scope_type: string;
32
+ scope_value: number;
33
+ /** 业务方传入的空间 ID,语义独立于 scope_value。 */
34
+ space_id: number;
35
+ }
34
36
 
35
- type __VLS_Slots$5 = {
37
+ type __VLS_Slots$7 = {
36
38
  header?: () => any;
37
39
  extend?: () => any;
38
40
  };
39
- type __VLS_Props$6 = {
41
+ type __VLS_Props$7 = {
40
42
  flowId: string;
41
43
  taskId: string | number;
42
44
  apiConfig: FlowApiConfig;
@@ -44,17 +46,17 @@ type __VLS_Props$6 = {
44
46
  defaultZoom?: number;
45
47
  onBack?: () => void;
46
48
  };
47
- declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$6, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
49
+ declare const __VLS_base$7: vue.DefineComponent<__VLS_Props$7, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
48
50
  back: () => any;
49
- }, string, vue.PublicProps, Readonly<__VLS_Props$6> & Readonly<{
51
+ }, string, vue.PublicProps, Readonly<__VLS_Props$7> & Readonly<{
50
52
  onBack?: (() => any) | undefined;
51
53
  }>, {
52
54
  defaultZoom: number;
53
55
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
54
- declare const __VLS_export$6: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
55
- declare const _default$7: typeof __VLS_export$6;
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;
56
58
 
57
- type __VLS_WithSlots$5<T, S> = T & {
59
+ type __VLS_WithSlots$7<T, S> = T & {
58
60
  new (): {
59
61
  $slots: S;
60
62
  };
@@ -62,11 +64,11 @@ type __VLS_WithSlots$5<T, S> = T & {
62
64
 
63
65
  declare namespace __mock_vue {
64
66
  export {
65
- _default$7 as default,
67
+ _default$8 as default,
66
68
  };
67
69
  }
68
70
 
69
- type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED';
71
+ type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED' | 'SKIP';
70
72
  type ExecutionNodeAction = 'retry' | 'skip' | 'resume' | 'approve' | 'forceFail' | 'gatewaySkip';
71
73
  interface NodeExecutionState {
72
74
  status: NodeExecutionStatus;
@@ -696,11 +698,355 @@ interface CustomVariableType {
696
698
  code: string;
697
699
  }
698
700
 
699
- interface FlowEditExpose {
701
+ /**
702
+ * filter 变量的宿主配置契约与注入。
703
+ *
704
+ * `RetrievalFilterField` 与 `getValues` 的返回结构和宿主
705
+ * `src/components/bk-monitor-retieval-filter/types.d.ts` 里的 `IFilterField`
706
+ * 逐字段一致——依赖包不带 `.d.ts`,宿主已经自己维护了一份,这里刻意同源,
707
+ * 避免出现两套形状相近但不兼容的类型。
708
+ */
709
+
710
+ /**
711
+ * 关联节点的插件配置摘要。getFields 在节点表单未挂载时要用它自行取维度,
712
+ * 不能依赖「打开过节点配置」留下的内存缓存。
713
+ */
714
+ interface FilterVariableSourceNodeComponent {
715
+ code?: string;
716
+ api_meta?: {
717
+ id?: string;
718
+ };
719
+ data?: Record<string, {
720
+ value?: unknown;
721
+ }>;
722
+ }
723
+ /** 关联来源。创建时由宿主锁定,用户不能在编辑器里改 */
724
+ interface FilterVariableSourceContext {
725
+ sourceNodeId: string;
726
+ sourceNodeName: string;
727
+ /** 关联表单项稳定 KEY,例如 query_condition */
728
+ sourceFieldKey: string;
729
+ sourceFieldName: string;
730
+ /** 关联节点当前 component,供宿主 getFields 在节点配置未打开时解析 */
731
+ sourceNodeComponent?: FilterVariableSourceNodeComponent;
732
+ }
733
+ interface RetrievalFilterField {
734
+ alias: string;
735
+ name: string;
736
+ type: string;
737
+ isEnableOptions?: boolean;
738
+ methods: Array<{
739
+ alias: string;
740
+ value: string;
741
+ placeholder?: string;
742
+ wildcardValue?: string;
743
+ options?: unknown[];
744
+ }>;
745
+ }
746
+ /**
747
+ * 候选值查询参数。
748
+ *
749
+ * 这是适配器归一化之后的稳定形状:依赖组件内部有四条 `getValueFn` 调用路径,
750
+ * 参数形状互不一致(`search`/`field`/`isInit__` vs `where` + `operator` vs
751
+ * `where` + `method`),禁止把 raw params 直接透给宿主。升级依赖时需重新核对。
752
+ */
753
+ interface FilterCandidateQuery {
754
+ field?: string;
755
+ keyword?: string;
756
+ limit?: number;
757
+ method?: string;
758
+ /** 通配搜索路径会带 `options.is_wildcard`,宿主据此选择精确或模糊匹配 */
759
+ isWildcard?: boolean;
760
+ }
761
+ interface FilterVariableConfig {
762
+ /**
763
+ * 宿主注入的 **原始** `RetrievalFilter` 组件,即
764
+ * `import { RetrievalFilter } from '@blueking/monitor-vue3-components'`。
765
+ *
766
+ * 必须是原始组件而不是宿主自己的封装(例如 bk-incident 的
767
+ * `BkMonitorRetievalFilter`):封装层 props 是 `filters/fieldList/query`、事件是
768
+ * `change`,与适配器传入的 `fields/where` + `whereChange` 不兼容;且它的
769
+ * `getValueFn` 只透传 `fields`,会丢掉搜索关键词,候选值搜索无法工作。
770
+ *
771
+ * 编辑器不把该依赖列入自身 dependencies,所以拿不到注入就是不可用。
772
+ */
773
+ retrievalFilterComponent: Component;
774
+ getFields(source: FilterVariableSourceContext): Promise<RetrievalFilterField[]>;
775
+ getValues(source: FilterVariableSourceContext, params: FilterCandidateQuery): Promise<{
776
+ count: number;
777
+ list: Array<{
778
+ id: string;
779
+ name: string;
780
+ }>;
781
+ }>;
782
+ /** 传给依赖组件的 `zIndex`,用于让候选值弹层盖在侧滑之上 */
783
+ popupZIndex?: number;
784
+ loadDelay?: number;
785
+ limit?: number;
786
+ }
787
+ /**
788
+ * 在顶层组件中提供 FilterVariableConfig。
789
+ *
790
+ * 与 `provideMemberSelectorConfig` 一致:`config` 为 undefined 时不调用 provide,
791
+ * 避免遮蔽父级已提供的配置。
792
+ */
793
+ declare function provideFilterVariableConfig(config?: FilterVariableConfig): void;
794
+
795
+ /**
796
+ * filter(复合条件选择)变量的领域逻辑。
797
+ *
798
+ * `Variable.value` 直接就是提交给后端的条件数组 `{ key, operator, value, options }[]`,
799
+ * 不引入编辑态中间形状:编辑器与依赖组件之间只有一处命名差异(`operator` ⇄ `method`),
800
+ * 那一次转换收在适配器边界上(见 retrieval-filter-adapter/index.vue)。
801
+ *
802
+ * 关联标识复用 `Variable.source_info`(C-09),不另立字段。既有的节点删除清理逻辑
803
+ * 原先只放行 component_inputs / component_outputs,已显式把 filter 一并纳入
804
+ * (canvas-adapter/plugin/index.ts 的节点删除,以及 node-config-sideslider 保存时
805
+ * 对照节点数据里是否还引用 `${var}`)。节点删掉或表单里取消引用后不清理,
806
+ * 就会留下用户无法修复的孤儿变量——关联信息是只读的。
807
+ */
808
+
809
+ /**
810
+ * 条件值标量。
811
+ *
812
+ * 必须允许 number:依赖协议里 `value` 是 `number[] | string[]`,整型字段的候选值
813
+ * 就是数字,统一转成字符串会改变提交给后端的类型。
814
+ */
815
+ type FilterConditionValue = string | number;
816
+ /**
817
+ * 单条条件的附加选项。
818
+ *
819
+ * `is_wildcard`(通配匹配)与 `group_relation`(多值关系)由依赖组件在运算符的
820
+ * `methods[].options` 里声明、由用户勾选,并原样带在条件上。丢掉它等于静默改写
821
+ * 用户的选择,所以读写两侧都必须透传,也不做已知字段白名单。
822
+ */
823
+ interface FilterConditionOptions {
824
+ is_wildcard?: boolean;
825
+ group_relation?: boolean;
826
+ [key: string]: unknown;
827
+ }
828
+ /** 单条条件,即 Variable.value 的元素。形状对齐宿主既有协议 */
829
+ interface FilterWhereItem {
830
+ key: string;
831
+ operator: string;
832
+ value: FilterConditionValue[];
833
+ options?: FilterConditionOptions;
834
+ }
835
+ type FilterWhereValue = FilterWhereItem[];
836
+
837
+ /**
838
+ * 全局变量受控创建的对外契约与守卫。
839
+ *
840
+ * filter 变量不能从普通「新建变量」入口创建——它必须携带关联节点与关联字段,
841
+ * 所以对外只暴露这一个方法,由宿主在节点表单里发起。
842
+ */
843
+
844
+ interface OpenFilterVariableCreateRequest {
845
+ defaultCustomType: 'filter';
846
+ /** 关联来源,filter 场景必填 */
847
+ filterContext: FilterVariableSourceContext;
848
+ keyword?: string;
849
+ /**
850
+ * 可选:把宿主表单里已配好的真实维度条件带进来作为默认值。
851
+ * 已 hook 的 `${var}` 占位会被丢掉,不能当默认条件。
852
+ */
853
+ initialValue?: FilterWhereValue;
854
+ onCreated?: (variable: Variable) => void;
855
+ }
856
+ interface OpenStandardVariableCreateRequest {
857
+ defaultCustomType?: string;
858
+ filterContext?: never;
859
+ keyword?: string;
860
+ cursorIndex?: number;
861
+ onCreated?: (variable: Variable) => void;
862
+ }
863
+ type OpenGlobalVariableCreateRequest = OpenFilterVariableCreateRequest | OpenStandardVariableCreateRequest;
864
+
865
+ /** 画布视口相关方法,供 FlowView / FlowEdit 对外透传 */
866
+ interface CanvasViewportExpose {
867
+ zoomToFit: (options?: ZoomToFitOptions) => void;
868
+ centerContent: () => void;
869
+ getZoom: () => number;
870
+ }
871
+ /** 受控创建能力。返回 false 表示未通过同步守卫,开发态会打印具体原因 */
872
+ interface GlobalVariableCreateExpose {
873
+ openGlobalVariableCreate: (request?: OpenGlobalVariableCreateRequest) => boolean;
874
+ }
875
+ interface FlowEditExpose extends CanvasViewportExpose, GlobalVariableCreateExpose {
700
876
  isFlowEdited: boolean;
701
877
  updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
702
878
  openGlobalVariables: () => void;
703
879
  }
880
+ interface FlowViewExpose extends CanvasViewportExpose {
881
+ }
882
+ /** FlowDetail 统一详情页对外暴露(设计 §7.1) */
883
+ interface FlowDetailExpose extends CanvasViewportExpose, GlobalVariableCreateExpose {
884
+ isFlowEdited: boolean;
885
+ updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
886
+ openGlobalVariables: () => void;
887
+ refreshDebugContext: () => Promise<void>;
888
+ openDebugResult: (nodeId?: string) => void;
889
+ }
890
+
891
+ type DebugContextStatus = 'idle' | 'running' | 'terminating';
892
+ type DebugNodeStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'finished' | 'failed' | 'revoked' | 'suspended' | 'skipped';
893
+ type DebugExecutionMode = 'real' | 'mock';
894
+ interface DebugMissingVar {
895
+ key: string;
896
+ source_node_id: string | null;
897
+ }
898
+ type DebugRunType = 'global' | 'step';
899
+ type DebugRunStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'terminating' | 'finished' | 'failed' | 'revoked';
900
+ /** 运行级 / 节点级错误详情(last_error_detail、nodes[].error_detail)。 */
901
+ interface DebugErrorFailure {
902
+ message: string;
903
+ node_id?: string;
904
+ template_node_id?: string;
905
+ [key: string]: unknown;
906
+ }
907
+ interface DebugErrorDetail {
908
+ type?: string;
909
+ message?: string;
910
+ task_id?: number | string;
911
+ failures?: DebugErrorFailure[];
912
+ [key: string]: unknown;
913
+ }
914
+ interface DebugContextNode {
915
+ node_id: string;
916
+ node_type: string;
917
+ execution_mode: DebugExecutionMode;
918
+ status: DebugNodeStatus;
919
+ can_step: boolean;
920
+ missing_vars: DebugMissingVar[];
921
+ waiting_reason?: string | null;
922
+ mock_result?: 'success' | 'fail' | null;
923
+ error_detail?: DebugErrorDetail | string | null;
924
+ duration_ms?: number | null;
925
+ log_ref?: {
926
+ instance_id: number | string;
927
+ node_id: string;
928
+ version: string;
929
+ } | null;
930
+ mock_outputs?: Record<string, unknown> | null;
931
+ mock_error?: string | null;
932
+ outputs?: Record<string, unknown> | null;
933
+ }
934
+ /**
935
+ * /debug_context/ 顶层结构。
936
+ *
937
+ * 前端按 status 分支:
938
+ * - running:任务定位用 active_*,进度用 last_run_status
939
+ * - terminating:继续用 active_*,UI 展示「终止中」并轮询
940
+ * - idle:active_* 为空,结果摘要用 last_*;last_task_id=null 表示尚无调试记录
941
+ */
942
+ interface DebugContext {
943
+ template_id: number;
944
+ status: DebugContextStatus;
945
+ locked_by: string;
946
+ active_task_id: number | string | null;
947
+ active_run_type: DebugRunType | null;
948
+ active_node_id: string | null;
949
+ last_task_id: number | string | null;
950
+ last_run_type: DebugRunType | null;
951
+ last_run_status: DebugRunStatus | null;
952
+ last_error_detail?: DebugErrorDetail | null;
953
+ last_inputs?: Record<string, unknown>;
954
+ global_vars: Record<string, unknown>;
955
+ missing_vars?: DebugMissingVar[];
956
+ nodes: DebugContextNode[];
957
+ }
958
+ interface DebugInputSchemaField {
959
+ key: string;
960
+ name: string;
961
+ type: string;
962
+ default?: unknown;
963
+ required?: boolean;
964
+ [key: string]: unknown;
965
+ }
966
+ interface DebugInputSchema {
967
+ fields?: DebugInputSchemaField[];
968
+ constants?: Record<string, unknown>;
969
+ [key: string]: unknown;
970
+ }
971
+ interface DebugResetImpact {
972
+ reset_node_ids: string[];
973
+ reasons?: Record<string, string>;
974
+ }
975
+ interface UpdateNodeDebugMockResult {
976
+ node_id: string;
977
+ execution_mode: DebugExecutionMode;
978
+ updated_global_vars?: Record<string, unknown>;
979
+ [key: string]: unknown;
980
+ }
981
+ interface RunNodeDebugStepResult {
982
+ node_id: string;
983
+ status: DebugNodeStatus;
984
+ outputs?: Record<string, unknown> | null;
985
+ error_detail?: unknown;
986
+ updated_global_vars?: Record<string, unknown>;
987
+ log_ref?: DebugContextNode['log_ref'];
988
+ [key: string]: unknown;
989
+ }
990
+ interface RunGlobalDebugResult {
991
+ task_id: number | string;
992
+ status: DebugContextStatus;
993
+ [key: string]: unknown;
994
+ }
995
+ /**
996
+ * /debug_terminate/ 返回。
997
+ *
998
+ * 全局终止返回 `terminating`,需要继续轮询 /debug_context/ 直到 idle + last_run_status=revoked;
999
+ * 单节点终止直接返回 `idle`,并用 reset_node_ids 告知哪些节点被恢复为「未调试」。
1000
+ */
1001
+ interface TerminateDebugResult {
1002
+ status?: DebugContextStatus;
1003
+ /** 单节点终止:被恢复为 not_run 的节点,本地需同步清空输入、输出、耗时、错误与日志。 */
1004
+ reset_node_ids?: string[];
1005
+ [key: string]: unknown;
1006
+ }
1007
+ interface DebugResetResult {
1008
+ reset_node_ids?: string[];
1009
+ [key: string]: unknown;
1010
+ }
1011
+ interface UpdateNodeDebugMockParams {
1012
+ templateId: string | number;
1013
+ nodeId: string;
1014
+ enable: boolean;
1015
+ mockResult?: 'success' | 'fail';
1016
+ mockOutputs?: Record<string, unknown>;
1017
+ mockError?: string;
1018
+ }
1019
+ interface RunNodeDebugStepParams {
1020
+ templateId: string | number;
1021
+ nodeId: string;
1022
+ mode: 'real' | 'mock';
1023
+ inputOverrides?: Record<string, unknown>;
1024
+ mockResult?: 'success' | 'fail';
1025
+ mockOutputs?: Record<string, unknown>;
1026
+ mockError?: string;
1027
+ }
1028
+ interface RunGlobalDebugParams {
1029
+ templateId: string | number;
1030
+ inputs: Record<string, unknown>;
1031
+ }
1032
+ interface TerminateDebugParams {
1033
+ templateId: string | number;
1034
+ nodeId?: string;
1035
+ }
1036
+ interface ResetDebugResultParams {
1037
+ templateId: string | number;
1038
+ nodeIds?: string[];
1039
+ }
1040
+ interface DebugApiServices {
1041
+ fetchDebugContext(templateId: string | number): Promise<DebugContext>;
1042
+ fetchDebugInputSchema(templateId: string | number): Promise<DebugInputSchema>;
1043
+ fetchDebugResetImpact(templateId: string | number): Promise<DebugResetImpact>;
1044
+ updateNodeDebugMock(params: UpdateNodeDebugMockParams): Promise<UpdateNodeDebugMockResult>;
1045
+ runNodeDebugStep(params: RunNodeDebugStepParams): Promise<RunNodeDebugStepResult>;
1046
+ runGlobalDebug(params: RunGlobalDebugParams): Promise<RunGlobalDebugResult>;
1047
+ terminateDebug(params: TerminateDebugParams): Promise<TerminateDebugResult>;
1048
+ resetDebugResult(params: ResetDebugResultParams): Promise<DebugResetResult>;
1049
+ }
704
1050
 
705
1051
  interface DrawPipelineParams {
706
1052
  pipeline_tree: PipelineTree;
@@ -730,6 +1076,7 @@ interface FetchTaskStateParams {
730
1076
  interface FetchTaskNodeDetailParams {
731
1077
  task_id: number | string;
732
1078
  node_id: string;
1079
+ component_code?: string;
733
1080
  }
734
1081
  interface FetchTaskNodeSnapshotParams {
735
1082
  task_id: number | string;
@@ -755,8 +1102,45 @@ interface FlowTaskDetail {
755
1102
  id: number | string;
756
1103
  template_id: number;
757
1104
  pipeline_tree: PipelineTree;
1105
+ /** 任务已耗时(秒),调试摘要弹层刷新恢复用。 */
1106
+ elapsed_time?: number;
758
1107
  [key: string]: unknown;
759
1108
  }
1109
+ interface CreateFlowTaskParams {
1110
+ template_id: number;
1111
+ name: string;
1112
+ creator: string;
1113
+ constants: Record<string, any>;
1114
+ label_ids?: number[];
1115
+ [key: string]: unknown;
1116
+ }
1117
+ interface CreateFlowTaskResult {
1118
+ data: {
1119
+ id: number | string;
1120
+ template_id?: number;
1121
+ [key: string]: unknown;
1122
+ };
1123
+ [key: string]: unknown;
1124
+ }
1125
+ interface ExecuteFlowTaskResult {
1126
+ result?: boolean;
1127
+ code?: number;
1128
+ data?: {
1129
+ /** 任务详情页跳转地址(含正确的 bkflow task id 与 templateId) */
1130
+ url?: string;
1131
+ [key: string]: unknown;
1132
+ };
1133
+ message?: string | null;
1134
+ request_id?: string;
1135
+ trace_id?: string | null;
1136
+ [key: string]: unknown;
1137
+ }
1138
+ interface FlowTaskExecuteSuccessResult {
1139
+ /** createFlowTask(create_task)接口响应 */
1140
+ createResult: CreateFlowTaskResult;
1141
+ /** executeFlowTask(operate_task)接口响应,data.url 用于任务详情跳转 */
1142
+ executeResult: ExecuteFlowTaskResult;
1143
+ }
760
1144
  interface TaskStateResult {
761
1145
  state?: string;
762
1146
  status?: string;
@@ -782,6 +1166,8 @@ interface FlowViewApiConfig {
782
1166
  scopeData: {
783
1167
  scope_type: string;
784
1168
  scope_value: number;
1169
+ /** 业务方传入的空间 ID,调试接口专用,语义独立于 scope_value */
1170
+ space_id: number;
785
1171
  };
786
1172
  fetchFlowDraftDetail?: (id: string) => Promise<FlowDraftDetail>;
787
1173
  fetchFlowDetailByVersion?: (id: string, version: string) => Promise<FlowDetailByVersion>;
@@ -801,23 +1187,13 @@ interface FlowViewApiConfig {
801
1187
  data: any[];
802
1188
  };
803
1189
  }>;
804
- createFlowTask?: (params: {
805
- template_id: number;
806
- name: string;
807
- creator: string;
808
- constants: Record<string, any>;
809
- }) => Promise<{
810
- data: {
811
- id: number;
812
- template_id: number;
813
- };
814
- }>;
1190
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
815
1191
  executeFlowTask?: (params: {
816
1192
  task_id: number | string;
817
1193
  resource_type: string;
818
1194
  resource_id: number | string;
819
1195
  permission_type: string;
820
- }) => Promise<any>;
1196
+ }) => Promise<ExecuteFlowTaskResult>;
821
1197
  revokeFlowTask?: (params: {
822
1198
  task_id: number | string;
823
1199
  resource_type: string;
@@ -864,7 +1240,7 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
864
1240
  fetchBkFlowThirdPartyPluginTags: () => Promise<BkflowThirdPartyPluginGroupItem[]>;
865
1241
  fetchBkFlowThirdPartyPluginMeta: (plugin_code: string) => Promise<BkflowThirdPartyPluginMetaDetail>;
866
1242
  fetchBkFlowThirdPartyPluginDetail: (plugin_code: string, plugin_version: string) => Promise<BkflowThirdPartyPluginDetail>;
867
- fetchBkFlowThirdPartyPluginAppDetail: (plugin_code: string) => Promise<BkflowThirdPartyPluginAppDetail>;
1243
+ fetchBkFlowThirdPartyPluginAppDetail: (plugin_code: string, plugin_version: string) => Promise<BkflowThirdPartyPluginAppDetail>;
868
1244
  fetchPluginGroupList: () => Promise<PluginGroupConfig[]>;
869
1245
  fetchCategoryPlugins: (category: string) => Promise<PluginMetaItem[]>;
870
1246
  fetchAllPluginGroups: () => Promise<GroupsPluginItem[]>;
@@ -874,23 +1250,13 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
874
1250
  drawPipeline?: (params: DrawPipelineParams) => Promise<{
875
1251
  pipeline_tree: PipelineTree;
876
1252
  }>;
877
- createFlowTask?: (params: {
878
- template_id: number;
879
- name: string;
880
- creator: string;
881
- constants: Record<string, any>;
882
- }) => Promise<{
883
- data: {
884
- id: number;
885
- template_id: number;
886
- };
887
- }>;
1253
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
888
1254
  executeFlowTask?: (params: {
889
1255
  task_id: number | string;
890
1256
  resource_type: string;
891
1257
  resource_id: number | string;
892
1258
  permission_type: string;
893
- }) => Promise<any>;
1259
+ }) => Promise<ExecuteFlowTaskResult>;
894
1260
  revokeFlowTask?: (params: {
895
1261
  task_id: number | string;
896
1262
  resource_type: string;
@@ -910,6 +1276,8 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
910
1276
  fetchTaskNodeLog?: (params: FetchTaskNodeLogParams) => Promise<unknown>;
911
1277
  getFlowTaskDetail?: (params: GetFlowTaskDetailParams) => Promise<FlowTaskDetail>;
912
1278
  }
1279
+ interface FlowDetailApiConfig extends FlowEditApiConfig, Partial<DebugApiServices> {
1280
+ }
913
1281
 
914
1282
  /**
915
1283
  * 插件分组选择面板配置
@@ -954,13 +1322,13 @@ type MemberSelectorConfig = {
954
1322
  * @param config FlowApiConfig 配置对象或已处理的 API 配置对象
955
1323
  * @returns 返回处理后的 API 配置对象
956
1324
  */
957
- declare function provideFlowApiConfig(config: FlowApiConfig | FlowEditApiConfig | FlowViewApiConfig): FlowEditApiConfig | FlowViewApiConfig;
1325
+ declare function provideFlowApiConfig(config: FlowApiConfig | FlowDetailApiConfig | FlowEditApiConfig | FlowViewApiConfig): FlowDetailApiConfig | FlowEditApiConfig | FlowViewApiConfig;
958
1326
  /**
959
1327
  * 在子组件中注入 FlowApiConfig(通用版本)
960
1328
  * @returns FlowEditApiConfig
961
1329
  * @throws 如果 apiConfig 未提供则抛出错误
962
1330
  */
963
- declare function useFlowApiConfig(): FlowEditApiConfig;
1331
+ declare function useFlowApiConfig(): FlowDetailApiConfig;
964
1332
  /**
965
1333
  * 在子组件中注入 FlowEditApiConfig(类型化版本)
966
1334
  * @returns FlowEditApiConfig
@@ -1002,7 +1370,7 @@ declare function provideMemberSelectorConfig(config?: MemberSelectorConfig): voi
1002
1370
  */
1003
1371
  declare function useMemberSelectorConfig(): MemberSelectorConfig;
1004
1372
 
1005
- type __VLS_Props$5 = {
1373
+ type __VLS_Props$6 = {
1006
1374
  flowId: string;
1007
1375
  show: boolean;
1008
1376
  editable?: boolean;
@@ -1026,15 +1394,15 @@ declare var __VLS_72: {
1026
1394
  };
1027
1395
  variablesValue: Record<string, any>;
1028
1396
  };
1029
- type __VLS_Slots$4 = {} & {
1397
+ type __VLS_Slots$6 = {} & {
1030
1398
  'custom-form-content'?: (props: typeof __VLS_72) => any;
1031
1399
  };
1032
- declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1400
+ declare const __VLS_base$6: vue.DefineComponent<__VLS_Props$6, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1033
1401
  close: (...args: any[]) => void;
1034
1402
  "update:show": (...args: any[]) => void;
1035
1403
  confirm: (...args: any[]) => void;
1036
1404
  "before-close": (...args: any[]) => void;
1037
- }, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{
1405
+ }, string, vue.PublicProps, Readonly<__VLS_Props$6> & Readonly<{
1038
1406
  onClose?: ((...args: any[]) => any) | undefined;
1039
1407
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
1040
1408
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -1045,10 +1413,10 @@ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, v
1045
1413
  useCustomConfirm: boolean;
1046
1414
  enableVersion: boolean;
1047
1415
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1048
- declare const __VLS_export$5: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
1049
- declare const _default$6: typeof __VLS_export$5;
1416
+ declare const __VLS_export$6: __VLS_WithSlots$6<typeof __VLS_base$6, __VLS_Slots$6>;
1417
+ declare const _default$7: typeof __VLS_export$6;
1050
1418
 
1051
- type __VLS_WithSlots$4<T, S> = T & {
1419
+ type __VLS_WithSlots$6<T, S> = T & {
1052
1420
  new (): {
1053
1421
  $slots: S;
1054
1422
  };
@@ -1056,15 +1424,15 @@ type __VLS_WithSlots$4<T, S> = T & {
1056
1424
 
1057
1425
  declare namespace __debug_vue {
1058
1426
  export {
1059
- _default$6 as default,
1427
+ _default$7 as default,
1060
1428
  };
1061
1429
  }
1062
1430
 
1063
- type __VLS_Slots$3 = {
1431
+ type __VLS_Slots$5 = {
1064
1432
  header?: () => any;
1065
1433
  extend?: () => any;
1066
1434
  };
1067
- type __VLS_Props$4 = {
1435
+ type __VLS_Props$5 = {
1068
1436
  pipelineTree: PipelineTree;
1069
1437
  nodeStates?: TaskExecutionStates;
1070
1438
  defaultZoom?: number;
@@ -1073,7 +1441,7 @@ type __VLS_Props$4 = {
1073
1441
  showHeader?: boolean;
1074
1442
  onBack?: () => void;
1075
1443
  };
1076
- declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1444
+ declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1077
1445
  retry: (nodeId: string) => any;
1078
1446
  skip: (nodeId: string) => any;
1079
1447
  resume: (nodeId: string) => any;
@@ -1092,7 +1460,7 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, v
1092
1460
  nodeId: string;
1093
1461
  action: ExecutionNodeAction;
1094
1462
  }) => any;
1095
- }, string, vue.PublicProps, Readonly<__VLS_Props$4> & Readonly<{
1463
+ }, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{
1096
1464
  onRetry?: ((nodeId: string) => any) | undefined;
1097
1465
  onSkip?: ((nodeId: string) => any) | undefined;
1098
1466
  onResume?: ((nodeId: string) => any) | undefined;
@@ -1116,10 +1484,10 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, v
1116
1484
  defaultZoom: number;
1117
1485
  nodeStates: TaskExecutionStates;
1118
1486
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1119
- declare const __VLS_export$4: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
1120
- declare const _default$5: typeof __VLS_export$4;
1487
+ declare const __VLS_export$5: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
1488
+ declare const _default$6: typeof __VLS_export$5;
1121
1489
 
1122
- type __VLS_WithSlots$3<T, S> = T & {
1490
+ type __VLS_WithSlots$5<T, S> = T & {
1123
1491
  new (): {
1124
1492
  $slots: S;
1125
1493
  };
@@ -1127,27 +1495,37 @@ type __VLS_WithSlots$3<T, S> = T & {
1127
1495
 
1128
1496
  declare namespace __execute_vue {
1129
1497
  export {
1130
- _default$5 as default,
1498
+ _default$6 as default,
1131
1499
  };
1132
1500
  }
1133
1501
 
1134
- type __VLS_Props$3 = {
1502
+ type __VLS_Slots$4 = {
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
+ };
1510
+ type __VLS_Props$4 = {
1135
1511
  flowId: string;
1136
1512
  show: boolean;
1137
1513
  editable?: boolean;
1138
1514
  showFlowEntry?: boolean;
1139
1515
  apiConfig: FlowApiConfig;
1140
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
1516
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1141
1517
  bkflowSaasUrl?: string;
1142
1518
  memberSelectorConfig?: MemberSelectorConfig;
1519
+ /** 执行时填写 filter 变量条件所需的能力;不传则这类变量退化为只读文本 */
1520
+ filterVariableConfig?: FilterVariableConfig;
1143
1521
  };
1144
- declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1522
+ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1145
1523
  close: (...args: any[]) => void;
1146
1524
  "update:show": (...args: any[]) => void;
1147
1525
  confirm: (...args: any[]) => void;
1148
1526
  "before-close": (...args: any[]) => void;
1149
1527
  "view-flow": (...args: any[]) => void;
1150
- }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1528
+ }, string, vue.PublicProps, Readonly<__VLS_Props$4> & Readonly<{
1151
1529
  onClose?: ((...args: any[]) => any) | undefined;
1152
1530
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
1153
1531
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -1157,15 +1535,28 @@ declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {},
1157
1535
  editable: boolean;
1158
1536
  showFlowEntry: boolean;
1159
1537
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1160
- declare const _default$4: typeof __VLS_export$3;
1538
+ declare const __VLS_export$4: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
1539
+ declare const _default$5: typeof __VLS_export$4;
1540
+
1541
+ type __VLS_WithSlots$4<T, S> = T & {
1542
+ new (): {
1543
+ $slots: S;
1544
+ };
1545
+ };
1161
1546
 
1162
1547
  declare namespace __create_task_vue {
1163
1548
  export {
1164
- _default$4 as default,
1549
+ _default$5 as default,
1165
1550
  };
1166
1551
  }
1167
1552
 
1168
- type __VLS_Slots$2 = {
1553
+ interface CreateVariablePayload {
1554
+ keyword?: string;
1555
+ cursorIndex?: number;
1556
+ defaultCustomType?: string;
1557
+ }
1558
+
1559
+ type __VLS_Slots$3 = {
1169
1560
  header?: () => any;
1170
1561
  inputParams?: (props: {
1171
1562
  node: any;
@@ -1189,7 +1580,7 @@ type __VLS_Slots$2 = {
1189
1580
  variablesValue: Record<string, any>;
1190
1581
  }) => any;
1191
1582
  };
1192
- type __VLS_Props$2 = {
1583
+ type __VLS_Props$3 = {
1193
1584
  flowId: string;
1194
1585
  apiConfig: FlowApiConfig;
1195
1586
  permissions?: {
@@ -1203,6 +1594,8 @@ type __VLS_Props$2 = {
1203
1594
  useCustomDebugConfirm?: boolean;
1204
1595
  selectPanelConfig?: SelectPanelConfig;
1205
1596
  memberSelectorConfig?: MemberSelectorConfig;
1597
+ /** 复合条件选择(filter)变量的宿主配置;不传则该类型变量不可用,其余功能不受影响 */
1598
+ filterVariableConfig?: FilterVariableConfig;
1206
1599
  onSave?: (flowData: FlowTemplate) => void;
1207
1600
  onSaveSuccess?: () => void;
1208
1601
  onBack?: () => void;
@@ -1218,11 +1611,17 @@ type __VLS_Props$2 = {
1218
1611
  bkflowSaasUrl?: string;
1219
1612
  enableThirdPlugin?: boolean;
1220
1613
  quickAdd?: QuickAddConfig;
1614
+ /** 是否隐藏基础信息中的触发器配置表单,默认 false */
1615
+ hideTrigger?: boolean;
1221
1616
  };
1222
- declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1617
+ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$3, {
1223
1618
  isFlowEdited: ComputedRef<FlowEditExpose["isFlowEdited"]>;
1224
1619
  updateNodeInputParams: FlowEditExpose["updateNodeInputParams"];
1225
1620
  openGlobalVariables: FlowEditExpose["openGlobalVariables"];
1621
+ openGlobalVariableCreate: FlowEditExpose["openGlobalVariableCreate"];
1622
+ zoomToFit: FlowEditExpose["zoomToFit"];
1623
+ centerContent: FlowEditExpose["centerContent"];
1624
+ getZoom: FlowEditExpose["getZoom"];
1226
1625
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1227
1626
  back: () => any;
1228
1627
  save: (flowData: FlowTemplate) => any;
@@ -1233,7 +1632,8 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1233
1632
  saveSuccess: () => any;
1234
1633
  exitEdit: () => any;
1235
1634
  debugBeforeClose: () => any;
1236
- }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
1635
+ createVariable: (payload: CreateVariablePayload) => any;
1636
+ }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1237
1637
  onBack?: (() => any) | undefined;
1238
1638
  onSave?: ((flowData: FlowTemplate) => any) | undefined;
1239
1639
  onMockDebugCreated?: ((params: {
@@ -1243,21 +1643,23 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1243
1643
  onSaveSuccess?: (() => any) | undefined;
1244
1644
  onExitEdit?: (() => any) | undefined;
1245
1645
  onDebugBeforeClose?: (() => any) | undefined;
1646
+ onCreateVariable?: ((payload: CreateVariablePayload) => any) | undefined;
1246
1647
  }>, {
1247
1648
  quickAdd: QuickAddConfig;
1649
+ enableThirdPlugin: boolean;
1650
+ hideTrigger: boolean;
1248
1651
  defaultZoom: number;
1652
+ enableDebug: boolean;
1249
1653
  enableVersion: boolean;
1250
1654
  permissions: {
1251
1655
  canSave?: boolean;
1252
1656
  };
1253
- enableDebug: boolean;
1254
1657
  useCustomDebugConfirm: boolean;
1255
- enableThirdPlugin: boolean;
1256
1658
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1257
- declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
1258
- declare const _default$3: typeof __VLS_export$2;
1659
+ declare const __VLS_export$3: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
1660
+ declare const _default$4: typeof __VLS_export$3;
1259
1661
 
1260
- type __VLS_WithSlots$2<T, S> = T & {
1662
+ type __VLS_WithSlots$3<T, S> = T & {
1261
1663
  new (): {
1262
1664
  $slots: S;
1263
1665
  };
@@ -1265,11 +1667,11 @@ type __VLS_WithSlots$2<T, S> = T & {
1265
1667
 
1266
1668
  declare namespace __edit_vue {
1267
1669
  export {
1268
- _default$3 as default,
1670
+ _default$4 as default,
1269
1671
  };
1270
1672
  }
1271
1673
 
1272
- type __VLS_Slots$1 = {
1674
+ type __VLS_Slots$2 = {
1273
1675
  header?: () => any;
1274
1676
  inputParams?: (props: {
1275
1677
  node: any;
@@ -1282,6 +1684,12 @@ type __VLS_Slots$1 = {
1282
1684
  }[];
1283
1685
  updateInputParams: (data: Record<string, any>) => void;
1284
1686
  }) => any;
1687
+ customFormContent?: (props: {
1688
+ customFormData: Record<string, any>;
1689
+ additionalTaskParams: Record<string, any>;
1690
+ updateCustomFormData: (data: Record<string, any>) => void;
1691
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1692
+ }) => any;
1285
1693
  debugCustomFormContent?: (props: {
1286
1694
  formData: {
1287
1695
  name: string;
@@ -1289,11 +1697,12 @@ type __VLS_Slots$1 = {
1289
1697
  variablesValue: Record<string, any>;
1290
1698
  }) => any;
1291
1699
  };
1292
- type __VLS_Props$1 = {
1700
+ type __VLS_Props$2 = {
1293
1701
  flowId: string;
1294
1702
  apiConfig: FlowApiConfig;
1295
1703
  permissions?: {
1296
1704
  canEdit?: boolean;
1705
+ canExecute?: boolean;
1297
1706
  };
1298
1707
  onEdit?: () => void;
1299
1708
  onBack?: () => void;
@@ -1303,22 +1712,28 @@ type __VLS_Props$1 = {
1303
1712
  showHeaderActions?: boolean;
1304
1713
  defaultZoom?: number;
1305
1714
  bkflowSaasUrl?: string;
1306
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
1715
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1307
1716
  memberSelectorConfig?: MemberSelectorConfig;
1308
1717
  enableDebug?: boolean;
1309
1718
  onMockDebugCreated?: (params: {
1310
1719
  taskId: number | string;
1311
1720
  templateId: number | string;
1312
1721
  }) => void;
1722
+ /** 是否隐藏基础信息中的触发器配置表单,默认 false */
1723
+ hideTrigger?: boolean;
1313
1724
  };
1314
- declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1725
+ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1726
+ zoomToFit: (options?: ZoomToFitOptions) => void;
1727
+ centerContent: () => void;
1728
+ getZoom: () => number;
1729
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1315
1730
  edit: () => any;
1316
1731
  back: () => any;
1317
1732
  mockDebugCreated: (params: {
1318
1733
  taskId: number | string;
1319
1734
  templateId: number | string;
1320
1735
  }) => any;
1321
- }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
1736
+ }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
1322
1737
  onEdit?: (() => any) | undefined;
1323
1738
  onBack?: (() => any) | undefined;
1324
1739
  onMockDebugCreated?: ((params: {
@@ -1327,18 +1742,20 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, v
1327
1742
  }) => any) | undefined;
1328
1743
  }>, {
1329
1744
  thumbnail: boolean;
1745
+ hideTrigger: boolean;
1330
1746
  defaultZoom: number;
1747
+ enableDebug: boolean;
1331
1748
  enableVersion: boolean;
1332
1749
  permissions: {
1333
1750
  canEdit?: boolean;
1751
+ canExecute?: boolean;
1334
1752
  };
1335
1753
  showHeaderActions: boolean;
1336
- enableDebug: boolean;
1337
1754
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1338
- declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
1339
- declare const _default$2: typeof __VLS_export$1;
1755
+ declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
1756
+ declare const _default$3: typeof __VLS_export$2;
1340
1757
 
1341
- type __VLS_WithSlots$1<T, S> = T & {
1758
+ type __VLS_WithSlots$2<T, S> = T & {
1342
1759
  new (): {
1343
1760
  $slots: S;
1344
1761
  };
@@ -1346,10 +1763,99 @@ type __VLS_WithSlots$1<T, S> = T & {
1346
1763
 
1347
1764
  declare namespace __view_vue {
1348
1765
  export {
1349
- _default$2 as default,
1766
+ _default$3 as default,
1350
1767
  };
1351
1768
  }
1352
1769
 
1770
+ /**
1771
+ * FlowDetail 权限(默认拒绝,设计 §3.1 / §7.2)。
1772
+ */
1773
+ interface FlowDetailPermissions {
1774
+ canEdit: boolean;
1775
+ canDebug: boolean;
1776
+ canExecute: boolean;
1777
+ }
1778
+
1779
+ type __VLS_Slots$1 = {
1780
+ header?: () => any;
1781
+ inputParams?: (props: {
1782
+ node: any;
1783
+ pluginDetail: PluginDetailCommon | null;
1784
+ inputs: any[];
1785
+ editable: boolean;
1786
+ fullVariableList: {
1787
+ key: string;
1788
+ name: string;
1789
+ source_type?: string;
1790
+ custom_type?: string;
1791
+ }[];
1792
+ updateInputParams: (data: Record<string, PluginInputDataItem>) => void;
1793
+ updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
1794
+ updateVariableSourceInfo: (variableKey: string, nodeId: string, formKey: string) => void;
1795
+ }) => any;
1796
+ customFormContent?: (props: {
1797
+ customFormData: Record<string, any>;
1798
+ additionalTaskParams: Record<string, any>;
1799
+ updateCustomFormData: (data: Record<string, any>) => void;
1800
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1801
+ }) => any;
1802
+ };
1803
+ type __VLS_Props$1 = {
1804
+ flowId: string;
1805
+ apiConfig: FlowApiConfig | FlowDetailApiConfig;
1806
+ permissions?: Partial<FlowDetailPermissions>;
1807
+ enableVersion?: boolean;
1808
+ flowVersion?: string;
1809
+ defaultZoom?: number;
1810
+ bkflowSaasUrl?: string;
1811
+ enableThirdPlugin?: boolean;
1812
+ quickAdd?: QuickAddConfig;
1813
+ hideTrigger?: boolean;
1814
+ selectPanelConfig?: SelectPanelConfig;
1815
+ memberSelectorConfig?: MemberSelectorConfig;
1816
+ /** 复合条件选择(filter)变量的宿主配置;不传则该类型变量不可用,其余功能不受影响 */
1817
+ filterVariableConfig?: FilterVariableConfig;
1818
+ onSave?: (flowData: FlowTemplate) => void;
1819
+ onSaveSuccess?: () => void;
1820
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1821
+ onBack?: () => void;
1822
+ };
1823
+ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {
1824
+ isFlowEdited: ComputedRef<boolean>;
1825
+ updateNodeInputParams: FlowDetailExpose["updateNodeInputParams"];
1826
+ openGlobalVariables: FlowDetailExpose["openGlobalVariables"];
1827
+ openGlobalVariableCreate: FlowDetailExpose["openGlobalVariableCreate"];
1828
+ refreshDebugContext: FlowDetailExpose["refreshDebugContext"];
1829
+ openDebugResult: FlowDetailExpose["openDebugResult"];
1830
+ zoomToFit: FlowDetailExpose["zoomToFit"];
1831
+ centerContent: FlowDetailExpose["centerContent"];
1832
+ getZoom: FlowDetailExpose["getZoom"];
1833
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1834
+ back: () => any;
1835
+ save: (flowData: FlowTemplate) => any;
1836
+ saveSuccess: () => any;
1837
+ createVariable: (payload: CreateVariablePayload) => any;
1838
+ }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
1839
+ onBack?: (() => any) | undefined;
1840
+ onSave?: ((flowData: FlowTemplate) => any) | undefined;
1841
+ onSaveSuccess?: (() => any) | undefined;
1842
+ onCreateVariable?: ((payload: CreateVariablePayload) => any) | undefined;
1843
+ }>, {
1844
+ quickAdd: QuickAddConfig;
1845
+ enableThirdPlugin: boolean;
1846
+ hideTrigger: boolean;
1847
+ defaultZoom: number;
1848
+ enableVersion: boolean;
1849
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1850
+ declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
1851
+ declare const _default$2: typeof __VLS_export$1;
1852
+
1853
+ type __VLS_WithSlots$1<T, S> = T & {
1854
+ new (): {
1855
+ $slots: S;
1856
+ };
1857
+ };
1858
+
1353
1859
  type SimulateDebugStage = 'edit' | 'mock-config' | 'mock-running';
1354
1860
  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';
1355
1861
  interface MockOutputField extends PluginOutputItem {
@@ -1399,10 +1905,19 @@ declare function isMockableNode(node: NodeType | Activity | undefined | null): n
1399
1905
  declare const random4: () => string;
1400
1906
  declare const generateId: (group?: number) => string;
1401
1907
 
1908
+ interface ValidatePipelineTreeOptions {
1909
+ /**
1910
+ * 需要「已配置插件」的节点集合,不传时要求全部节点均已配置。
1911
+ *
1912
+ * 单步 / Mock 调试只依赖目标节点自身的配置(后端 step_run 用目标节点单独拼一棵最小流程树),
1913
+ * 画布其余未配置节点不影响调试,因此这类场景只传目标节点,允许空节点先存为草稿。
1914
+ */
1915
+ requireConfiguredNodeIds?: string[];
1916
+ }
1402
1917
  /**
1403
1918
  * 画布pipeline_tree数据校验
1404
1919
  */
1405
- declare const validatePipelineTree: (pipelineTree: PipelineTree) => {
1920
+ declare const validatePipelineTree: (pipelineTree: PipelineTree, options?: ValidatePipelineTreeOptions) => {
1406
1921
  valid: boolean;
1407
1922
  message: string;
1408
1923
  ids: string[];
@@ -1459,6 +1974,25 @@ declare class BkFlowModelAccessor {
1459
1974
  get flowModel(): FlowModel;
1460
1975
  }
1461
1976
 
1977
+ /**
1978
+ * 新调试(FlowDetail)向画布节点透出的最小上下文(设计 §14.3)。
1979
+ *
1980
+ * - isMockNode:节点渲染据此显示 MOCK 标签;
1981
+ * - 其余为可选能力:独立调试聚焦态、打开节点调试面板。
1982
+ * 保持可选以兼容仅需 Mock 标签的场景,且不改变对外 npm 公共 API。
1983
+ */
1984
+ interface DebugCanvasContext {
1985
+ isMockNode(nodeId: string): boolean;
1986
+ /** 节点调试状态;任务节点用它补充未执行(not_run)标识,不写入连线执行态。 */
1987
+ getNodeStatus?(nodeId: string): string | undefined;
1988
+ /** 当前独立调试聚焦节点(不复用 X6 编辑选择态,设计 §9.3.2) */
1989
+ focusedNodeId?(): string;
1990
+ /** 打开该节点详情侧滑的“调试配置”Tab */
1991
+ openNodeDebugPanel?(nodeId: string): void;
1992
+ /** 调试锁定期(running/terminating);节点配置据此展示只读说明 Alert */
1993
+ isLocked?(): boolean;
1994
+ }
1995
+
1462
1996
  type __VLS_Props = {
1463
1997
  pipelineTree: PipelineTree;
1464
1998
  mode?: BkflowBusinessCanvasMode;
@@ -1470,6 +2004,7 @@ type __VLS_Props = {
1470
2004
  additionalPlugins?: CanvasPlugin[];
1471
2005
  toolbarItems?: CanvasToolbarItem[];
1472
2006
  simulateDebugContext?: SimulateDebugCanvasContext;
2007
+ debugContext?: DebugCanvasContext;
1473
2008
  };
1474
2009
  declare var __VLS_8: {};
1475
2010
  declare var __VLS_22: {
@@ -1564,8 +2099,8 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
1564
2099
  }) => any) | undefined;
1565
2100
  "onFormat-position"?: (() => any) | undefined;
1566
2101
  }>, {
1567
- mode: BkflowBusinessCanvasMode;
1568
2102
  thumbnail: boolean;
2103
+ mode: BkflowBusinessCanvasMode;
1569
2104
  nodeActions: NodeActionsConfig;
1570
2105
  quickAdd: QuickAddConfig;
1571
2106
  defaultZoom: number;
@@ -1608,7 +2143,8 @@ declare function exportToPipelineTree(flowModel: FlowModel): PipelineTree;
1608
2143
  * 若目标是 placeholder 且删后无入边,级联删除该 placeholder
1609
2144
  * - edge.reconnect:若源从条件网关迁出,清理旧条件
1610
2145
  * - node.remove:主动查找将被级联删除的边,清理对应网关条件;
1611
- * 若删除的是分支网关,级联删除关联的 placeholder 节点
2146
+ * 若删除的是分支网关,级联删除关联的 placeholder 节点;
2147
+ * 同时清理全局变量中对被删除节点的 source_info 引用,并删除已无引用的变量
1612
2148
  */
1613
2149
  declare function createBkflowPlugin(): CanvasPlugin;
1614
2150
 
@@ -1637,8 +2173,12 @@ declare const _default: {
1637
2173
  FlowCreateTask: () => Promise<typeof __create_task_vue>;
1638
2174
  FlowExecute: () => Promise<typeof __execute_vue>;
1639
2175
  FlowDebug: () => Promise<typeof __debug_vue>;
2176
+ /**
2177
+ * @deprecated Use FlowDetail with permissions.canDebug instead.
2178
+ * FlowMockDebug will be removed in the next major version.
2179
+ */
1640
2180
  FlowMockDebug: () => Promise<typeof __mock_vue>;
1641
2181
  };
1642
2182
 
1643
- export { _default$1 as BkFlowCanvas, BkFlowModelAccessor, BkFlowNodeAccessor, _default$4 as FlowCreateTask, _default$6 as FlowDebug, _default$3 as FlowEdit, _default$5 as FlowExecute, _default$7 as FlowMockDebug, _default$2 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 };
1644
- export type { Activity, DndNodeItem, ExecutionNodeAction, FlowApiConfig, FlowEditExpose, FlowTemplate, Gateway, GatewayCondition, MemberSelectorConfig, MockOutputField, NodeExecutionState, NodeExecutionStatus, NodeMockConfig, NotifyConfig, PipelineTree, PluginDetailCommon, PluginInputDataItem, SelectPanelConfig, SimulateDebugCanvasContext, SimulateDebugStage, SimulateDebugState, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };
2183
+ 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, provideFilterVariableConfig, provideFlowApiConfig, provideMemberSelectorConfig, provideSelectPanelConfig, random4, resolveExecutionActions, resolveMockFormControl, useFlowApiConfig, useFlowEditApiConfig, useFlowViewApiConfig, useMemberSelectorConfig, useSelectPanelConfig, validatePipelineTree };
2184
+ export type { Activity, CanvasViewportExpose, CreateFlowTaskResult, DndNodeItem, ExecuteFlowTaskResult, ExecutionNodeAction, FilterCandidateQuery, FilterConditionOptions, FilterConditionValue, FilterVariableConfig, FilterVariableSourceContext, FilterVariableSourceNodeComponent, FilterWhereItem, FilterWhereValue, FlowApiConfig, FlowDetailExpose, FlowDetailPermissions, FlowEditExpose, FlowTaskExecuteSuccessResult, FlowTemplate, FlowViewExpose, Gateway, GatewayCondition, GlobalVariableCreateExpose, MemberSelectorConfig, MockOutputField, NodeExecutionState, NodeExecutionStatus, NodeMockConfig, NotifyConfig, OpenFilterVariableCreateRequest, OpenGlobalVariableCreateRequest, OpenStandardVariableCreateRequest, PipelineTree, PluginDetailCommon, PluginInputDataItem, RetrievalFilterField, SelectPanelConfig, SimulateDebugCanvasContext, SimulateDebugStage, SimulateDebugState, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };