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

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,328 @@ 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
+ interface FilterVariableSourceContext {
712
+ sourceNodeId: string;
713
+ sourceNodeName: string;
714
+ /** 关联表单项稳定 KEY,例如 query_condition */
715
+ sourceFieldKey: string;
716
+ sourceFieldName: string;
717
+ }
718
+ interface RetrievalFilterField {
719
+ alias: string;
720
+ name: string;
721
+ type: string;
722
+ isEnableOptions?: boolean;
723
+ methods: Array<{
724
+ alias: string;
725
+ value: string;
726
+ placeholder?: string;
727
+ wildcardValue?: string;
728
+ options?: unknown[];
729
+ }>;
730
+ }
731
+ /**
732
+ * 候选值查询参数。
733
+ *
734
+ * 这是适配器归一化之后的稳定形状:依赖组件内部有四条 `getValueFn` 调用路径,
735
+ * 参数形状互不一致(`search`/`field`/`isInit__` vs `where` + `operator` vs
736
+ * `where` + `method`),禁止把 raw params 直接透给宿主。升级依赖时需重新核对。
737
+ */
738
+ interface FilterCandidateQuery {
739
+ field?: string;
740
+ keyword?: string;
741
+ limit?: number;
742
+ method?: string;
743
+ /** 通配搜索路径会带 `options.is_wildcard`,宿主据此选择精确或模糊匹配 */
744
+ isWildcard?: boolean;
745
+ }
746
+ interface FilterVariableConfig {
747
+ /**
748
+ * 宿主注入的 **原始** `RetrievalFilter` 组件,即
749
+ * `import { RetrievalFilter } from '@blueking/monitor-vue3-components'`。
750
+ *
751
+ * 必须是原始组件而不是宿主自己的封装(例如 bk-incident 的
752
+ * `BkMonitorRetievalFilter`):封装层 props 是 `filters/fieldList/query`、事件是
753
+ * `change`,与适配器传入的 `fields/where` + `whereChange` 不兼容;且它的
754
+ * `getValueFn` 只透传 `fields`,会丢掉搜索关键词,候选值搜索无法工作。
755
+ *
756
+ * 编辑器不把该依赖列入自身 dependencies,所以拿不到注入就是不可用。
757
+ */
758
+ retrievalFilterComponent: Component;
759
+ getFields(source: FilterVariableSourceContext): Promise<RetrievalFilterField[]>;
760
+ getValues(source: FilterVariableSourceContext, params: FilterCandidateQuery): Promise<{
761
+ count: number;
762
+ list: Array<{
763
+ id: string;
764
+ name: string;
765
+ }>;
766
+ }>;
767
+ /** 传给依赖组件的 `zIndex`,用于让候选值弹层盖在侧滑之上 */
768
+ popupZIndex?: number;
769
+ loadDelay?: number;
770
+ limit?: number;
771
+ }
772
+ /**
773
+ * 在顶层组件中提供 FilterVariableConfig。
774
+ *
775
+ * 与 `provideMemberSelectorConfig` 一致:`config` 为 undefined 时不调用 provide,
776
+ * 避免遮蔽父级已提供的配置。
777
+ */
778
+ declare function provideFilterVariableConfig(config?: FilterVariableConfig): void;
779
+
780
+ /**
781
+ * filter(复合条件选择)变量的领域逻辑。
782
+ *
783
+ * `Variable.value` 直接就是提交给后端的条件数组 `{ key, operator, value, options }[]`,
784
+ * 不引入编辑态中间形状:编辑器与依赖组件之间只有一处命名差异(`operator` ⇄ `method`),
785
+ * 那一次转换收在适配器边界上(见 retrieval-filter-adapter/index.vue)。
786
+ *
787
+ * 关联标识复用 `Variable.source_info`(C-09),不另立字段。既有的节点删除清理逻辑
788
+ * 原先只放行 component_inputs / component_outputs,已显式把 filter 一并纳入
789
+ * (canvas-adapter/plugin/index.ts 与 node-config-sideslider/index.vue),
790
+ * 否则关联节点被删后会留下用户无法修复的孤儿变量——关联信息是只读的。
791
+ */
792
+
793
+ /**
794
+ * 条件值标量。
795
+ *
796
+ * 必须允许 number:依赖协议里 `value` 是 `number[] | string[]`,整型字段的候选值
797
+ * 就是数字,统一转成字符串会改变提交给后端的类型。
798
+ */
799
+ type FilterConditionValue = string | number;
800
+ /**
801
+ * 单条条件的附加选项。
802
+ *
803
+ * `is_wildcard`(通配匹配)与 `group_relation`(多值关系)由依赖组件在运算符的
804
+ * `methods[].options` 里声明、由用户勾选,并原样带在条件上。丢掉它等于静默改写
805
+ * 用户的选择,所以读写两侧都必须透传,也不做已知字段白名单。
806
+ */
807
+ interface FilterConditionOptions {
808
+ is_wildcard?: boolean;
809
+ group_relation?: boolean;
810
+ [key: string]: unknown;
811
+ }
812
+ /** 单条条件,即 Variable.value 的元素。形状对齐宿主既有协议 */
813
+ interface FilterWhereItem {
814
+ key: string;
815
+ operator: string;
816
+ value: FilterConditionValue[];
817
+ options?: FilterConditionOptions;
818
+ }
819
+ type FilterWhereValue = FilterWhereItem[];
820
+
821
+ /**
822
+ * 全局变量受控创建的对外契约与守卫。
823
+ *
824
+ * filter 变量不能从普通「新建变量」入口创建——它必须携带关联节点与关联字段,
825
+ * 所以对外只暴露这一个方法,由宿主在节点表单里发起。
826
+ */
827
+
828
+ interface OpenFilterVariableCreateRequest {
829
+ defaultCustomType: 'filter';
830
+ /** 关联来源,filter 场景必填 */
831
+ filterContext: FilterVariableSourceContext;
832
+ keyword?: string;
833
+ /** 可选:把宿主表单里已配好的条件带进来作为默认值,省得用户重填 */
834
+ initialValue?: FilterWhereValue;
835
+ onCreated?: (variable: Variable) => void;
836
+ }
837
+ interface OpenStandardVariableCreateRequest {
838
+ defaultCustomType?: string;
839
+ filterContext?: never;
840
+ keyword?: string;
841
+ cursorIndex?: number;
842
+ onCreated?: (variable: Variable) => void;
843
+ }
844
+ type OpenGlobalVariableCreateRequest = OpenFilterVariableCreateRequest | OpenStandardVariableCreateRequest;
845
+
846
+ /** 画布视口相关方法,供 FlowView / FlowEdit 对外透传 */
847
+ interface CanvasViewportExpose {
848
+ zoomToFit: (options?: ZoomToFitOptions) => void;
849
+ centerContent: () => void;
850
+ getZoom: () => number;
851
+ }
852
+ /** 受控创建能力。返回 false 表示未通过同步守卫,开发态会打印具体原因 */
853
+ interface GlobalVariableCreateExpose {
854
+ openGlobalVariableCreate: (request?: OpenGlobalVariableCreateRequest) => boolean;
855
+ }
856
+ interface FlowEditExpose extends CanvasViewportExpose, GlobalVariableCreateExpose {
700
857
  isFlowEdited: boolean;
701
858
  updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
702
859
  openGlobalVariables: () => void;
703
860
  }
861
+ interface FlowViewExpose extends CanvasViewportExpose {
862
+ }
863
+ /** FlowDetail 统一详情页对外暴露(设计 §7.1) */
864
+ interface FlowDetailExpose extends CanvasViewportExpose, GlobalVariableCreateExpose {
865
+ isFlowEdited: boolean;
866
+ updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
867
+ openGlobalVariables: () => void;
868
+ refreshDebugContext: () => Promise<void>;
869
+ openDebugResult: (nodeId?: string) => void;
870
+ }
871
+
872
+ type DebugContextStatus = 'idle' | 'running' | 'terminating';
873
+ type DebugNodeStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'finished' | 'failed' | 'revoked' | 'suspended' | 'skipped';
874
+ type DebugExecutionMode = 'real' | 'mock';
875
+ interface DebugMissingVar {
876
+ key: string;
877
+ source_node_id: string | null;
878
+ }
879
+ type DebugRunType = 'global' | 'step';
880
+ type DebugRunStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'terminating' | 'finished' | 'failed' | 'revoked';
881
+ /** 运行级 / 节点级错误详情(last_error_detail、nodes[].error_detail)。 */
882
+ interface DebugErrorFailure {
883
+ message: string;
884
+ node_id?: string;
885
+ template_node_id?: string;
886
+ [key: string]: unknown;
887
+ }
888
+ interface DebugErrorDetail {
889
+ type?: string;
890
+ message?: string;
891
+ task_id?: number | string;
892
+ failures?: DebugErrorFailure[];
893
+ [key: string]: unknown;
894
+ }
895
+ interface DebugContextNode {
896
+ node_id: string;
897
+ node_type: string;
898
+ execution_mode: DebugExecutionMode;
899
+ status: DebugNodeStatus;
900
+ can_step: boolean;
901
+ missing_vars: DebugMissingVar[];
902
+ waiting_reason?: string | null;
903
+ mock_result?: 'success' | 'fail' | null;
904
+ error_detail?: DebugErrorDetail | string | null;
905
+ duration_ms?: number | null;
906
+ log_ref?: {
907
+ instance_id: number | string;
908
+ node_id: string;
909
+ version: string;
910
+ } | null;
911
+ mock_outputs?: Record<string, unknown> | null;
912
+ mock_error?: string | null;
913
+ outputs?: Record<string, unknown> | null;
914
+ }
915
+ /**
916
+ * /debug_context/ 顶层结构。
917
+ *
918
+ * 前端按 status 分支:
919
+ * - running:任务定位用 active_*,进度用 last_run_status
920
+ * - terminating:继续用 active_*,UI 展示「终止中」并轮询
921
+ * - idle:active_* 为空,结果摘要用 last_*;last_task_id=null 表示尚无调试记录
922
+ */
923
+ interface DebugContext {
924
+ template_id: number;
925
+ status: DebugContextStatus;
926
+ locked_by: string;
927
+ active_task_id: number | string | null;
928
+ active_run_type: DebugRunType | null;
929
+ active_node_id: string | null;
930
+ last_task_id: number | string | null;
931
+ last_run_type: DebugRunType | null;
932
+ last_run_status: DebugRunStatus | null;
933
+ last_error_detail?: DebugErrorDetail | null;
934
+ last_inputs?: Record<string, unknown>;
935
+ global_vars: Record<string, unknown>;
936
+ missing_vars?: DebugMissingVar[];
937
+ nodes: DebugContextNode[];
938
+ }
939
+ interface DebugInputSchemaField {
940
+ key: string;
941
+ name: string;
942
+ type: string;
943
+ default?: unknown;
944
+ required?: boolean;
945
+ [key: string]: unknown;
946
+ }
947
+ interface DebugInputSchema {
948
+ fields?: DebugInputSchemaField[];
949
+ constants?: Record<string, unknown>;
950
+ [key: string]: unknown;
951
+ }
952
+ interface DebugResetImpact {
953
+ reset_node_ids: string[];
954
+ reasons?: Record<string, string>;
955
+ }
956
+ interface UpdateNodeDebugMockResult {
957
+ node_id: string;
958
+ execution_mode: DebugExecutionMode;
959
+ updated_global_vars?: Record<string, unknown>;
960
+ [key: string]: unknown;
961
+ }
962
+ interface RunNodeDebugStepResult {
963
+ node_id: string;
964
+ status: DebugNodeStatus;
965
+ outputs?: Record<string, unknown> | null;
966
+ error_detail?: unknown;
967
+ updated_global_vars?: Record<string, unknown>;
968
+ log_ref?: DebugContextNode['log_ref'];
969
+ [key: string]: unknown;
970
+ }
971
+ interface RunGlobalDebugResult {
972
+ task_id: number | string;
973
+ status: DebugContextStatus;
974
+ [key: string]: unknown;
975
+ }
976
+ interface TerminateDebugResult {
977
+ status?: DebugContextStatus;
978
+ [key: string]: unknown;
979
+ }
980
+ interface DebugResetResult {
981
+ reset_node_ids?: string[];
982
+ [key: string]: unknown;
983
+ }
984
+ interface UpdateNodeDebugMockParams {
985
+ templateId: string | number;
986
+ nodeId: string;
987
+ enable: boolean;
988
+ mockResult?: 'success' | 'fail';
989
+ mockOutputs?: Record<string, unknown>;
990
+ mockError?: string;
991
+ }
992
+ interface RunNodeDebugStepParams {
993
+ templateId: string | number;
994
+ nodeId: string;
995
+ mode: 'real' | 'mock';
996
+ inputOverrides?: Record<string, unknown>;
997
+ mockResult?: 'success' | 'fail';
998
+ mockOutputs?: Record<string, unknown>;
999
+ mockError?: string;
1000
+ }
1001
+ interface RunGlobalDebugParams {
1002
+ templateId: string | number;
1003
+ inputs: Record<string, unknown>;
1004
+ }
1005
+ interface TerminateDebugParams {
1006
+ templateId: string | number;
1007
+ nodeId?: string;
1008
+ }
1009
+ interface ResetDebugResultParams {
1010
+ templateId: string | number;
1011
+ nodeIds?: string[];
1012
+ }
1013
+ interface DebugApiServices {
1014
+ fetchDebugContext(templateId: string | number): Promise<DebugContext>;
1015
+ fetchDebugInputSchema(templateId: string | number): Promise<DebugInputSchema>;
1016
+ fetchDebugResetImpact(templateId: string | number): Promise<DebugResetImpact>;
1017
+ updateNodeDebugMock(params: UpdateNodeDebugMockParams): Promise<UpdateNodeDebugMockResult>;
1018
+ runNodeDebugStep(params: RunNodeDebugStepParams): Promise<RunNodeDebugStepResult>;
1019
+ runGlobalDebug(params: RunGlobalDebugParams): Promise<RunGlobalDebugResult>;
1020
+ terminateDebug(params: TerminateDebugParams): Promise<TerminateDebugResult>;
1021
+ resetDebugResult(params: ResetDebugResultParams): Promise<DebugResetResult>;
1022
+ }
704
1023
 
705
1024
  interface DrawPipelineParams {
706
1025
  pipeline_tree: PipelineTree;
@@ -730,6 +1049,7 @@ interface FetchTaskStateParams {
730
1049
  interface FetchTaskNodeDetailParams {
731
1050
  task_id: number | string;
732
1051
  node_id: string;
1052
+ component_code?: string;
733
1053
  }
734
1054
  interface FetchTaskNodeSnapshotParams {
735
1055
  task_id: number | string;
@@ -755,8 +1075,45 @@ interface FlowTaskDetail {
755
1075
  id: number | string;
756
1076
  template_id: number;
757
1077
  pipeline_tree: PipelineTree;
1078
+ /** 任务已耗时(秒),调试摘要弹层刷新恢复用。 */
1079
+ elapsed_time?: number;
1080
+ [key: string]: unknown;
1081
+ }
1082
+ interface CreateFlowTaskParams {
1083
+ template_id: number;
1084
+ name: string;
1085
+ creator: string;
1086
+ constants: Record<string, any>;
1087
+ label_ids?: number[];
1088
+ [key: string]: unknown;
1089
+ }
1090
+ interface CreateFlowTaskResult {
1091
+ data: {
1092
+ id: number | string;
1093
+ template_id?: number;
1094
+ [key: string]: unknown;
1095
+ };
1096
+ [key: string]: unknown;
1097
+ }
1098
+ interface ExecuteFlowTaskResult {
1099
+ result?: boolean;
1100
+ code?: number;
1101
+ data?: {
1102
+ /** 任务详情页跳转地址(含正确的 bkflow task id 与 templateId) */
1103
+ url?: string;
1104
+ [key: string]: unknown;
1105
+ };
1106
+ message?: string | null;
1107
+ request_id?: string;
1108
+ trace_id?: string | null;
758
1109
  [key: string]: unknown;
759
1110
  }
1111
+ interface FlowTaskExecuteSuccessResult {
1112
+ /** createFlowTask(create_task)接口响应 */
1113
+ createResult: CreateFlowTaskResult;
1114
+ /** executeFlowTask(operate_task)接口响应,data.url 用于任务详情跳转 */
1115
+ executeResult: ExecuteFlowTaskResult;
1116
+ }
760
1117
  interface TaskStateResult {
761
1118
  state?: string;
762
1119
  status?: string;
@@ -782,6 +1139,8 @@ interface FlowViewApiConfig {
782
1139
  scopeData: {
783
1140
  scope_type: string;
784
1141
  scope_value: number;
1142
+ /** 业务方传入的空间 ID,调试接口专用,语义独立于 scope_value */
1143
+ space_id: number;
785
1144
  };
786
1145
  fetchFlowDraftDetail?: (id: string) => Promise<FlowDraftDetail>;
787
1146
  fetchFlowDetailByVersion?: (id: string, version: string) => Promise<FlowDetailByVersion>;
@@ -801,23 +1160,13 @@ interface FlowViewApiConfig {
801
1160
  data: any[];
802
1161
  };
803
1162
  }>;
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
- }>;
1163
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
815
1164
  executeFlowTask?: (params: {
816
1165
  task_id: number | string;
817
1166
  resource_type: string;
818
1167
  resource_id: number | string;
819
1168
  permission_type: string;
820
- }) => Promise<any>;
1169
+ }) => Promise<ExecuteFlowTaskResult>;
821
1170
  revokeFlowTask?: (params: {
822
1171
  task_id: number | string;
823
1172
  resource_type: string;
@@ -864,7 +1213,7 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
864
1213
  fetchBkFlowThirdPartyPluginTags: () => Promise<BkflowThirdPartyPluginGroupItem[]>;
865
1214
  fetchBkFlowThirdPartyPluginMeta: (plugin_code: string) => Promise<BkflowThirdPartyPluginMetaDetail>;
866
1215
  fetchBkFlowThirdPartyPluginDetail: (plugin_code: string, plugin_version: string) => Promise<BkflowThirdPartyPluginDetail>;
867
- fetchBkFlowThirdPartyPluginAppDetail: (plugin_code: string) => Promise<BkflowThirdPartyPluginAppDetail>;
1216
+ fetchBkFlowThirdPartyPluginAppDetail: (plugin_code: string, plugin_version: string) => Promise<BkflowThirdPartyPluginAppDetail>;
868
1217
  fetchPluginGroupList: () => Promise<PluginGroupConfig[]>;
869
1218
  fetchCategoryPlugins: (category: string) => Promise<PluginMetaItem[]>;
870
1219
  fetchAllPluginGroups: () => Promise<GroupsPluginItem[]>;
@@ -874,23 +1223,13 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
874
1223
  drawPipeline?: (params: DrawPipelineParams) => Promise<{
875
1224
  pipeline_tree: PipelineTree;
876
1225
  }>;
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
- }>;
1226
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
888
1227
  executeFlowTask?: (params: {
889
1228
  task_id: number | string;
890
1229
  resource_type: string;
891
1230
  resource_id: number | string;
892
1231
  permission_type: string;
893
- }) => Promise<any>;
1232
+ }) => Promise<ExecuteFlowTaskResult>;
894
1233
  revokeFlowTask?: (params: {
895
1234
  task_id: number | string;
896
1235
  resource_type: string;
@@ -910,6 +1249,8 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
910
1249
  fetchTaskNodeLog?: (params: FetchTaskNodeLogParams) => Promise<unknown>;
911
1250
  getFlowTaskDetail?: (params: GetFlowTaskDetailParams) => Promise<FlowTaskDetail>;
912
1251
  }
1252
+ interface FlowDetailApiConfig extends FlowEditApiConfig, Partial<DebugApiServices> {
1253
+ }
913
1254
 
914
1255
  /**
915
1256
  * 插件分组选择面板配置
@@ -954,13 +1295,13 @@ type MemberSelectorConfig = {
954
1295
  * @param config FlowApiConfig 配置对象或已处理的 API 配置对象
955
1296
  * @returns 返回处理后的 API 配置对象
956
1297
  */
957
- declare function provideFlowApiConfig(config: FlowApiConfig | FlowEditApiConfig | FlowViewApiConfig): FlowEditApiConfig | FlowViewApiConfig;
1298
+ declare function provideFlowApiConfig(config: FlowApiConfig | FlowDetailApiConfig | FlowEditApiConfig | FlowViewApiConfig): FlowDetailApiConfig | FlowEditApiConfig | FlowViewApiConfig;
958
1299
  /**
959
1300
  * 在子组件中注入 FlowApiConfig(通用版本)
960
1301
  * @returns FlowEditApiConfig
961
1302
  * @throws 如果 apiConfig 未提供则抛出错误
962
1303
  */
963
- declare function useFlowApiConfig(): FlowEditApiConfig;
1304
+ declare function useFlowApiConfig(): FlowDetailApiConfig;
964
1305
  /**
965
1306
  * 在子组件中注入 FlowEditApiConfig(类型化版本)
966
1307
  * @returns FlowEditApiConfig
@@ -1002,7 +1343,7 @@ declare function provideMemberSelectorConfig(config?: MemberSelectorConfig): voi
1002
1343
  */
1003
1344
  declare function useMemberSelectorConfig(): MemberSelectorConfig;
1004
1345
 
1005
- type __VLS_Props$5 = {
1346
+ type __VLS_Props$6 = {
1006
1347
  flowId: string;
1007
1348
  show: boolean;
1008
1349
  editable?: boolean;
@@ -1026,15 +1367,15 @@ declare var __VLS_72: {
1026
1367
  };
1027
1368
  variablesValue: Record<string, any>;
1028
1369
  };
1029
- type __VLS_Slots$4 = {} & {
1370
+ type __VLS_Slots$6 = {} & {
1030
1371
  'custom-form-content'?: (props: typeof __VLS_72) => any;
1031
1372
  };
1032
- declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1373
+ declare const __VLS_base$6: vue.DefineComponent<__VLS_Props$6, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1033
1374
  close: (...args: any[]) => void;
1034
1375
  "update:show": (...args: any[]) => void;
1035
1376
  confirm: (...args: any[]) => void;
1036
1377
  "before-close": (...args: any[]) => void;
1037
- }, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{
1378
+ }, string, vue.PublicProps, Readonly<__VLS_Props$6> & Readonly<{
1038
1379
  onClose?: ((...args: any[]) => any) | undefined;
1039
1380
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
1040
1381
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -1045,10 +1386,10 @@ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, v
1045
1386
  useCustomConfirm: boolean;
1046
1387
  enableVersion: boolean;
1047
1388
  }, {}, {}, {}, 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;
1389
+ declare const __VLS_export$6: __VLS_WithSlots$6<typeof __VLS_base$6, __VLS_Slots$6>;
1390
+ declare const _default$7: typeof __VLS_export$6;
1050
1391
 
1051
- type __VLS_WithSlots$4<T, S> = T & {
1392
+ type __VLS_WithSlots$6<T, S> = T & {
1052
1393
  new (): {
1053
1394
  $slots: S;
1054
1395
  };
@@ -1056,15 +1397,15 @@ type __VLS_WithSlots$4<T, S> = T & {
1056
1397
 
1057
1398
  declare namespace __debug_vue {
1058
1399
  export {
1059
- _default$6 as default,
1400
+ _default$7 as default,
1060
1401
  };
1061
1402
  }
1062
1403
 
1063
- type __VLS_Slots$3 = {
1404
+ type __VLS_Slots$5 = {
1064
1405
  header?: () => any;
1065
1406
  extend?: () => any;
1066
1407
  };
1067
- type __VLS_Props$4 = {
1408
+ type __VLS_Props$5 = {
1068
1409
  pipelineTree: PipelineTree;
1069
1410
  nodeStates?: TaskExecutionStates;
1070
1411
  defaultZoom?: number;
@@ -1073,7 +1414,7 @@ type __VLS_Props$4 = {
1073
1414
  showHeader?: boolean;
1074
1415
  onBack?: () => void;
1075
1416
  };
1076
- declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1417
+ declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1077
1418
  retry: (nodeId: string) => any;
1078
1419
  skip: (nodeId: string) => any;
1079
1420
  resume: (nodeId: string) => any;
@@ -1092,7 +1433,7 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, v
1092
1433
  nodeId: string;
1093
1434
  action: ExecutionNodeAction;
1094
1435
  }) => any;
1095
- }, string, vue.PublicProps, Readonly<__VLS_Props$4> & Readonly<{
1436
+ }, string, vue.PublicProps, Readonly<__VLS_Props$5> & Readonly<{
1096
1437
  onRetry?: ((nodeId: string) => any) | undefined;
1097
1438
  onSkip?: ((nodeId: string) => any) | undefined;
1098
1439
  onResume?: ((nodeId: string) => any) | undefined;
@@ -1116,10 +1457,10 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, v
1116
1457
  defaultZoom: number;
1117
1458
  nodeStates: TaskExecutionStates;
1118
1459
  }, {}, {}, {}, 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;
1460
+ declare const __VLS_export$5: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
1461
+ declare const _default$6: typeof __VLS_export$5;
1121
1462
 
1122
- type __VLS_WithSlots$3<T, S> = T & {
1463
+ type __VLS_WithSlots$5<T, S> = T & {
1123
1464
  new (): {
1124
1465
  $slots: S;
1125
1466
  };
@@ -1127,27 +1468,37 @@ type __VLS_WithSlots$3<T, S> = T & {
1127
1468
 
1128
1469
  declare namespace __execute_vue {
1129
1470
  export {
1130
- _default$5 as default,
1471
+ _default$6 as default,
1131
1472
  };
1132
1473
  }
1133
1474
 
1134
- type __VLS_Props$3 = {
1475
+ type __VLS_Slots$4 = {
1476
+ customFormContent?: (props: {
1477
+ customFormData: Record<string, any>;
1478
+ additionalTaskParams: Record<string, any>;
1479
+ updateCustomFormData: (data: Record<string, any>) => void;
1480
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1481
+ }) => any;
1482
+ };
1483
+ type __VLS_Props$4 = {
1135
1484
  flowId: string;
1136
1485
  show: boolean;
1137
1486
  editable?: boolean;
1138
1487
  showFlowEntry?: boolean;
1139
1488
  apiConfig: FlowApiConfig;
1140
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
1489
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1141
1490
  bkflowSaasUrl?: string;
1142
1491
  memberSelectorConfig?: MemberSelectorConfig;
1492
+ /** 执行时填写 filter 变量条件所需的能力;不传则这类变量退化为只读文本 */
1493
+ filterVariableConfig?: FilterVariableConfig;
1143
1494
  };
1144
- declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1495
+ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1145
1496
  close: (...args: any[]) => void;
1146
1497
  "update:show": (...args: any[]) => void;
1147
1498
  confirm: (...args: any[]) => void;
1148
1499
  "before-close": (...args: any[]) => void;
1149
1500
  "view-flow": (...args: any[]) => void;
1150
- }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1501
+ }, string, vue.PublicProps, Readonly<__VLS_Props$4> & Readonly<{
1151
1502
  onClose?: ((...args: any[]) => any) | undefined;
1152
1503
  "onUpdate:show"?: ((...args: any[]) => any) | undefined;
1153
1504
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -1157,15 +1508,28 @@ declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {},
1157
1508
  editable: boolean;
1158
1509
  showFlowEntry: boolean;
1159
1510
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1160
- declare const _default$4: typeof __VLS_export$3;
1511
+ declare const __VLS_export$4: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
1512
+ declare const _default$5: typeof __VLS_export$4;
1513
+
1514
+ type __VLS_WithSlots$4<T, S> = T & {
1515
+ new (): {
1516
+ $slots: S;
1517
+ };
1518
+ };
1161
1519
 
1162
1520
  declare namespace __create_task_vue {
1163
1521
  export {
1164
- _default$4 as default,
1522
+ _default$5 as default,
1165
1523
  };
1166
1524
  }
1167
1525
 
1168
- type __VLS_Slots$2 = {
1526
+ interface CreateVariablePayload {
1527
+ keyword?: string;
1528
+ cursorIndex?: number;
1529
+ defaultCustomType?: string;
1530
+ }
1531
+
1532
+ type __VLS_Slots$3 = {
1169
1533
  header?: () => any;
1170
1534
  inputParams?: (props: {
1171
1535
  node: any;
@@ -1189,7 +1553,7 @@ type __VLS_Slots$2 = {
1189
1553
  variablesValue: Record<string, any>;
1190
1554
  }) => any;
1191
1555
  };
1192
- type __VLS_Props$2 = {
1556
+ type __VLS_Props$3 = {
1193
1557
  flowId: string;
1194
1558
  apiConfig: FlowApiConfig;
1195
1559
  permissions?: {
@@ -1203,6 +1567,8 @@ type __VLS_Props$2 = {
1203
1567
  useCustomDebugConfirm?: boolean;
1204
1568
  selectPanelConfig?: SelectPanelConfig;
1205
1569
  memberSelectorConfig?: MemberSelectorConfig;
1570
+ /** 复合条件选择(filter)变量的宿主配置;不传则该类型变量不可用,其余功能不受影响 */
1571
+ filterVariableConfig?: FilterVariableConfig;
1206
1572
  onSave?: (flowData: FlowTemplate) => void;
1207
1573
  onSaveSuccess?: () => void;
1208
1574
  onBack?: () => void;
@@ -1218,11 +1584,17 @@ type __VLS_Props$2 = {
1218
1584
  bkflowSaasUrl?: string;
1219
1585
  enableThirdPlugin?: boolean;
1220
1586
  quickAdd?: QuickAddConfig;
1587
+ /** 是否隐藏基础信息中的触发器配置表单,默认 false */
1588
+ hideTrigger?: boolean;
1221
1589
  };
1222
- declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1590
+ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$3, {
1223
1591
  isFlowEdited: ComputedRef<FlowEditExpose["isFlowEdited"]>;
1224
1592
  updateNodeInputParams: FlowEditExpose["updateNodeInputParams"];
1225
1593
  openGlobalVariables: FlowEditExpose["openGlobalVariables"];
1594
+ openGlobalVariableCreate: FlowEditExpose["openGlobalVariableCreate"];
1595
+ zoomToFit: FlowEditExpose["zoomToFit"];
1596
+ centerContent: FlowEditExpose["centerContent"];
1597
+ getZoom: FlowEditExpose["getZoom"];
1226
1598
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1227
1599
  back: () => any;
1228
1600
  save: (flowData: FlowTemplate) => any;
@@ -1233,7 +1605,8 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1233
1605
  saveSuccess: () => any;
1234
1606
  exitEdit: () => any;
1235
1607
  debugBeforeClose: () => any;
1236
- }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
1608
+ createVariable: (payload: CreateVariablePayload) => any;
1609
+ }, string, vue.PublicProps, Readonly<__VLS_Props$3> & Readonly<{
1237
1610
  onBack?: (() => any) | undefined;
1238
1611
  onSave?: ((flowData: FlowTemplate) => any) | undefined;
1239
1612
  onMockDebugCreated?: ((params: {
@@ -1243,21 +1616,23 @@ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1243
1616
  onSaveSuccess?: (() => any) | undefined;
1244
1617
  onExitEdit?: (() => any) | undefined;
1245
1618
  onDebugBeforeClose?: (() => any) | undefined;
1619
+ onCreateVariable?: ((payload: CreateVariablePayload) => any) | undefined;
1246
1620
  }>, {
1247
1621
  quickAdd: QuickAddConfig;
1622
+ enableThirdPlugin: boolean;
1623
+ hideTrigger: boolean;
1248
1624
  defaultZoom: number;
1625
+ enableDebug: boolean;
1249
1626
  enableVersion: boolean;
1250
1627
  permissions: {
1251
1628
  canSave?: boolean;
1252
1629
  };
1253
- enableDebug: boolean;
1254
1630
  useCustomDebugConfirm: boolean;
1255
- enableThirdPlugin: boolean;
1256
1631
  }, {}, {}, {}, 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;
1632
+ declare const __VLS_export$3: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
1633
+ declare const _default$4: typeof __VLS_export$3;
1259
1634
 
1260
- type __VLS_WithSlots$2<T, S> = T & {
1635
+ type __VLS_WithSlots$3<T, S> = T & {
1261
1636
  new (): {
1262
1637
  $slots: S;
1263
1638
  };
@@ -1265,11 +1640,11 @@ type __VLS_WithSlots$2<T, S> = T & {
1265
1640
 
1266
1641
  declare namespace __edit_vue {
1267
1642
  export {
1268
- _default$3 as default,
1643
+ _default$4 as default,
1269
1644
  };
1270
1645
  }
1271
1646
 
1272
- type __VLS_Slots$1 = {
1647
+ type __VLS_Slots$2 = {
1273
1648
  header?: () => any;
1274
1649
  inputParams?: (props: {
1275
1650
  node: any;
@@ -1282,6 +1657,12 @@ type __VLS_Slots$1 = {
1282
1657
  }[];
1283
1658
  updateInputParams: (data: Record<string, any>) => void;
1284
1659
  }) => any;
1660
+ customFormContent?: (props: {
1661
+ customFormData: Record<string, any>;
1662
+ additionalTaskParams: Record<string, any>;
1663
+ updateCustomFormData: (data: Record<string, any>) => void;
1664
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1665
+ }) => any;
1285
1666
  debugCustomFormContent?: (props: {
1286
1667
  formData: {
1287
1668
  name: string;
@@ -1289,11 +1670,12 @@ type __VLS_Slots$1 = {
1289
1670
  variablesValue: Record<string, any>;
1290
1671
  }) => any;
1291
1672
  };
1292
- type __VLS_Props$1 = {
1673
+ type __VLS_Props$2 = {
1293
1674
  flowId: string;
1294
1675
  apiConfig: FlowApiConfig;
1295
1676
  permissions?: {
1296
1677
  canEdit?: boolean;
1678
+ canExecute?: boolean;
1297
1679
  };
1298
1680
  onEdit?: () => void;
1299
1681
  onBack?: () => void;
@@ -1303,22 +1685,28 @@ type __VLS_Props$1 = {
1303
1685
  showHeaderActions?: boolean;
1304
1686
  defaultZoom?: number;
1305
1687
  bkflowSaasUrl?: string;
1306
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
1688
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1307
1689
  memberSelectorConfig?: MemberSelectorConfig;
1308
1690
  enableDebug?: boolean;
1309
1691
  onMockDebugCreated?: (params: {
1310
1692
  taskId: number | string;
1311
1693
  templateId: number | string;
1312
1694
  }) => void;
1695
+ /** 是否隐藏基础信息中的触发器配置表单,默认 false */
1696
+ hideTrigger?: boolean;
1313
1697
  };
1314
- declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1698
+ declare const __VLS_base$2: vue.DefineComponent<__VLS_Props$2, {
1699
+ zoomToFit: (options?: ZoomToFitOptions) => void;
1700
+ centerContent: () => void;
1701
+ getZoom: () => number;
1702
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1315
1703
  edit: () => any;
1316
1704
  back: () => any;
1317
1705
  mockDebugCreated: (params: {
1318
1706
  taskId: number | string;
1319
1707
  templateId: number | string;
1320
1708
  }) => any;
1321
- }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
1709
+ }, string, vue.PublicProps, Readonly<__VLS_Props$2> & Readonly<{
1322
1710
  onEdit?: (() => any) | undefined;
1323
1711
  onBack?: (() => any) | undefined;
1324
1712
  onMockDebugCreated?: ((params: {
@@ -1327,18 +1715,20 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, v
1327
1715
  }) => any) | undefined;
1328
1716
  }>, {
1329
1717
  thumbnail: boolean;
1718
+ hideTrigger: boolean;
1330
1719
  defaultZoom: number;
1720
+ enableDebug: boolean;
1331
1721
  enableVersion: boolean;
1332
1722
  permissions: {
1333
1723
  canEdit?: boolean;
1724
+ canExecute?: boolean;
1334
1725
  };
1335
1726
  showHeaderActions: boolean;
1336
- enableDebug: boolean;
1337
1727
  }, {}, {}, {}, 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;
1728
+ declare const __VLS_export$2: __VLS_WithSlots$2<typeof __VLS_base$2, __VLS_Slots$2>;
1729
+ declare const _default$3: typeof __VLS_export$2;
1340
1730
 
1341
- type __VLS_WithSlots$1<T, S> = T & {
1731
+ type __VLS_WithSlots$2<T, S> = T & {
1342
1732
  new (): {
1343
1733
  $slots: S;
1344
1734
  };
@@ -1346,10 +1736,99 @@ type __VLS_WithSlots$1<T, S> = T & {
1346
1736
 
1347
1737
  declare namespace __view_vue {
1348
1738
  export {
1349
- _default$2 as default,
1739
+ _default$3 as default,
1350
1740
  };
1351
1741
  }
1352
1742
 
1743
+ /**
1744
+ * FlowDetail 权限(默认拒绝,设计 §3.1 / §7.2)。
1745
+ */
1746
+ interface FlowDetailPermissions {
1747
+ canEdit: boolean;
1748
+ canDebug: boolean;
1749
+ canExecute: boolean;
1750
+ }
1751
+
1752
+ type __VLS_Slots$1 = {
1753
+ header?: () => any;
1754
+ inputParams?: (props: {
1755
+ node: any;
1756
+ pluginDetail: PluginDetailCommon | null;
1757
+ inputs: any[];
1758
+ editable: boolean;
1759
+ fullVariableList: {
1760
+ key: string;
1761
+ name: string;
1762
+ source_type?: string;
1763
+ custom_type?: string;
1764
+ }[];
1765
+ updateInputParams: (data: Record<string, PluginInputDataItem>) => void;
1766
+ updateNodeInputParams: (inputParams: Record<string, PluginInputDataItem>) => void;
1767
+ updateVariableSourceInfo: (variableKey: string, nodeId: string, formKey: string) => void;
1768
+ }) => any;
1769
+ customFormContent?: (props: {
1770
+ customFormData: Record<string, any>;
1771
+ additionalTaskParams: Record<string, any>;
1772
+ updateCustomFormData: (data: Record<string, any>) => void;
1773
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1774
+ }) => any;
1775
+ };
1776
+ type __VLS_Props$1 = {
1777
+ flowId: string;
1778
+ apiConfig: FlowApiConfig | FlowDetailApiConfig;
1779
+ permissions?: Partial<FlowDetailPermissions>;
1780
+ enableVersion?: boolean;
1781
+ flowVersion?: string;
1782
+ defaultZoom?: number;
1783
+ bkflowSaasUrl?: string;
1784
+ enableThirdPlugin?: boolean;
1785
+ quickAdd?: QuickAddConfig;
1786
+ hideTrigger?: boolean;
1787
+ selectPanelConfig?: SelectPanelConfig;
1788
+ memberSelectorConfig?: MemberSelectorConfig;
1789
+ /** 复合条件选择(filter)变量的宿主配置;不传则该类型变量不可用,其余功能不受影响 */
1790
+ filterVariableConfig?: FilterVariableConfig;
1791
+ onSave?: (flowData: FlowTemplate) => void;
1792
+ onSaveSuccess?: () => void;
1793
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1794
+ onBack?: () => void;
1795
+ };
1796
+ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {
1797
+ isFlowEdited: ComputedRef<boolean>;
1798
+ updateNodeInputParams: FlowDetailExpose["updateNodeInputParams"];
1799
+ openGlobalVariables: FlowDetailExpose["openGlobalVariables"];
1800
+ openGlobalVariableCreate: FlowDetailExpose["openGlobalVariableCreate"];
1801
+ refreshDebugContext: FlowDetailExpose["refreshDebugContext"];
1802
+ openDebugResult: FlowDetailExpose["openDebugResult"];
1803
+ zoomToFit: FlowDetailExpose["zoomToFit"];
1804
+ centerContent: FlowDetailExpose["centerContent"];
1805
+ getZoom: FlowDetailExpose["getZoom"];
1806
+ }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1807
+ back: () => any;
1808
+ save: (flowData: FlowTemplate) => any;
1809
+ saveSuccess: () => any;
1810
+ createVariable: (payload: CreateVariablePayload) => any;
1811
+ }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
1812
+ onBack?: (() => any) | undefined;
1813
+ onSave?: ((flowData: FlowTemplate) => any) | undefined;
1814
+ onSaveSuccess?: (() => any) | undefined;
1815
+ onCreateVariable?: ((payload: CreateVariablePayload) => any) | undefined;
1816
+ }>, {
1817
+ quickAdd: QuickAddConfig;
1818
+ enableThirdPlugin: boolean;
1819
+ hideTrigger: boolean;
1820
+ defaultZoom: number;
1821
+ enableVersion: boolean;
1822
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
1823
+ declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
1824
+ declare const _default$2: typeof __VLS_export$1;
1825
+
1826
+ type __VLS_WithSlots$1<T, S> = T & {
1827
+ new (): {
1828
+ $slots: S;
1829
+ };
1830
+ };
1831
+
1353
1832
  type SimulateDebugStage = 'edit' | 'mock-config' | 'mock-running';
1354
1833
  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
1834
  interface MockOutputField extends PluginOutputItem {
@@ -1399,10 +1878,19 @@ declare function isMockableNode(node: NodeType | Activity | undefined | null): n
1399
1878
  declare const random4: () => string;
1400
1879
  declare const generateId: (group?: number) => string;
1401
1880
 
1881
+ interface ValidatePipelineTreeOptions {
1882
+ /**
1883
+ * 需要「已配置插件」的节点集合,不传时要求全部节点均已配置。
1884
+ *
1885
+ * 单步 / Mock 调试只依赖目标节点自身的配置(后端 step_run 用目标节点单独拼一棵最小流程树),
1886
+ * 画布其余未配置节点不影响调试,因此这类场景只传目标节点,允许空节点先存为草稿。
1887
+ */
1888
+ requireConfiguredNodeIds?: string[];
1889
+ }
1402
1890
  /**
1403
1891
  * 画布pipeline_tree数据校验
1404
1892
  */
1405
- declare const validatePipelineTree: (pipelineTree: PipelineTree) => {
1893
+ declare const validatePipelineTree: (pipelineTree: PipelineTree, options?: ValidatePipelineTreeOptions) => {
1406
1894
  valid: boolean;
1407
1895
  message: string;
1408
1896
  ids: string[];
@@ -1459,6 +1947,25 @@ declare class BkFlowModelAccessor {
1459
1947
  get flowModel(): FlowModel;
1460
1948
  }
1461
1949
 
1950
+ /**
1951
+ * 新调试(FlowDetail)向画布节点透出的最小上下文(设计 §14.3)。
1952
+ *
1953
+ * - isMockNode:节点渲染据此显示 MOCK 标签;
1954
+ * - 其余为可选能力:独立调试聚焦态、打开节点调试面板。
1955
+ * 保持可选以兼容仅需 Mock 标签的场景,且不改变对外 npm 公共 API。
1956
+ */
1957
+ interface DebugCanvasContext {
1958
+ isMockNode(nodeId: string): boolean;
1959
+ /** 节点调试状态;任务节点用它补充未执行(not_run)标识,不写入连线执行态。 */
1960
+ getNodeStatus?(nodeId: string): string | undefined;
1961
+ /** 当前独立调试聚焦节点(不复用 X6 编辑选择态,设计 §9.3.2) */
1962
+ focusedNodeId?(): string;
1963
+ /** 打开该节点详情侧滑的“调试配置”Tab */
1964
+ openNodeDebugPanel?(nodeId: string): void;
1965
+ /** 调试锁定期(running/terminating);节点配置据此展示只读说明 Alert */
1966
+ isLocked?(): boolean;
1967
+ }
1968
+
1462
1969
  type __VLS_Props = {
1463
1970
  pipelineTree: PipelineTree;
1464
1971
  mode?: BkflowBusinessCanvasMode;
@@ -1470,6 +1977,7 @@ type __VLS_Props = {
1470
1977
  additionalPlugins?: CanvasPlugin[];
1471
1978
  toolbarItems?: CanvasToolbarItem[];
1472
1979
  simulateDebugContext?: SimulateDebugCanvasContext;
1980
+ debugContext?: DebugCanvasContext;
1473
1981
  };
1474
1982
  declare var __VLS_8: {};
1475
1983
  declare var __VLS_22: {
@@ -1564,8 +2072,8 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
1564
2072
  }) => any) | undefined;
1565
2073
  "onFormat-position"?: (() => any) | undefined;
1566
2074
  }>, {
1567
- mode: BkflowBusinessCanvasMode;
1568
2075
  thumbnail: boolean;
2076
+ mode: BkflowBusinessCanvasMode;
1569
2077
  nodeActions: NodeActionsConfig;
1570
2078
  quickAdd: QuickAddConfig;
1571
2079
  defaultZoom: number;
@@ -1608,7 +2116,8 @@ declare function exportToPipelineTree(flowModel: FlowModel): PipelineTree;
1608
2116
  * 若目标是 placeholder 且删后无入边,级联删除该 placeholder
1609
2117
  * - edge.reconnect:若源从条件网关迁出,清理旧条件
1610
2118
  * - node.remove:主动查找将被级联删除的边,清理对应网关条件;
1611
- * 若删除的是分支网关,级联删除关联的 placeholder 节点
2119
+ * 若删除的是分支网关,级联删除关联的 placeholder 节点;
2120
+ * 同时清理全局变量中对被删除节点的 source_info 引用,并删除已无引用的变量
1612
2121
  */
1613
2122
  declare function createBkflowPlugin(): CanvasPlugin;
1614
2123
 
@@ -1637,8 +2146,12 @@ declare const _default: {
1637
2146
  FlowCreateTask: () => Promise<typeof __create_task_vue>;
1638
2147
  FlowExecute: () => Promise<typeof __execute_vue>;
1639
2148
  FlowDebug: () => Promise<typeof __debug_vue>;
2149
+ /**
2150
+ * @deprecated Use FlowDetail with permissions.canDebug instead.
2151
+ * FlowMockDebug will be removed in the next major version.
2152
+ */
1640
2153
  FlowMockDebug: () => Promise<typeof __mock_vue>;
1641
2154
  };
1642
2155
 
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 };
2156
+ 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 };
2157
+ export type { Activity, CanvasViewportExpose, CreateFlowTaskResult, DndNodeItem, ExecuteFlowTaskResult, ExecutionNodeAction, FilterCandidateQuery, FilterConditionOptions, FilterConditionValue, FilterVariableConfig, FilterVariableSourceContext, 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 };