@blueking/bkflow-canvas-editor 1.1.0-beta.3 → 1.1.0-beta.31

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.
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance, AxiosRequestConfig } from 'axios';
2
2
 
3
- type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED';
3
+ type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED' | 'SKIP';
4
4
  type ExecutionNodeAction = 'retry' | 'skip' | 'resume' | 'approve' | 'forceFail' | 'gatewaySkip';
5
5
  interface NodeExecutionState {
6
6
  status: NodeExecutionStatus;
@@ -44,6 +44,11 @@ interface NodeExecutionState {
44
44
  actions?: ExecutionNodeAction[];
45
45
  /** 兼容旧版后端直接透出的动作数组字段 */
46
46
  action_list?: ExecutionNodeAction[];
47
+ /**
48
+ * 条件网关命中的出边 flow_id。
49
+ * 有值时执行态连线优先按它着色,不要求目标节点已经执行(网关单步不会跑下游)。
50
+ */
51
+ selectedFlowIds?: string[];
47
52
  }
48
53
  type TaskExecutionStates = Record<string, NodeExecutionState>;
49
54
 
@@ -83,6 +88,13 @@ interface ActivityComponent {
83
88
  id: string;
84
89
  name: string;
85
90
  };
91
+ // 以下字段仅标准运维(开放)插件写入,是拉取插件详情的最小身份信息。
92
+ // 其余目录信息(来源描述、版本清单里的默认/最新版等)可随时重新拉取,不进持久化结构
93
+ plugin_code?: string;
94
+ plugin_version?: string;
95
+ source_key?: string;
96
+ wrapper_version?: string;
97
+ versions?: string[];
86
98
  };
87
99
  }
88
100
 
@@ -392,15 +404,20 @@ interface FlowListItem {
392
404
  creator: string;
393
405
  update_at: string;
394
406
  }
407
+ interface SpaceUniformApiEntry {
408
+ meta_apis: string;
409
+ api_categories?: string;
410
+ display_name?: string;
411
+ source_key?: string;
412
+ catalog_mode?: 'remote' | 'cache_first' | 'cache_only';
413
+ headers?: Record<string, string>;
414
+ }
395
415
  interface SpaceFlowConfig {
396
416
  gateway_expression?: 'boolrule' | 'FEEL' | 'MAKO';
397
- uiform_api?: {
398
- api: Record<string, {
399
- api_category: string;
400
- display_name: string;
401
- meta_apis: string;
402
- }>;
403
- };
417
+ uniform_api?: {
418
+ api?: Record<string, SpaceUniformApiEntry | null>;
419
+ common?: SpaceUniformApiEntry | null;
420
+ } | null;
404
421
  }
405
422
  interface UpdateFlowParams {
406
423
  name: string;
@@ -430,6 +447,86 @@ interface PluginMetaItem {
430
447
  icon?: string;
431
448
  category_id: string;
432
449
  }
450
+ interface SopsPluginSourceItem {
451
+ id: string;
452
+ name: string;
453
+ }
454
+ interface SopsPluginCategory {
455
+ id: string;
456
+ name: string;
457
+ }
458
+ interface SopsPluginItem {
459
+ id: string;
460
+ name: string;
461
+ category?: string;
462
+ category_name?: string;
463
+ description?: string;
464
+ meta_url?: string;
465
+ meta_url_template?: string;
466
+ plugin_source?: string;
467
+ plugin_code?: string;
468
+ source_key?: string;
469
+ wrapper_version?: string;
470
+ default_version?: string;
471
+ latest_version?: string;
472
+ versions?: string[];
473
+ }
474
+ interface SopsPluginListResult {
475
+ total: number;
476
+ apis: SopsPluginItem[];
477
+ }
478
+ /**
479
+ * 统一插件详情里的表单描述符(bkflow V4 开放插件协议)。
480
+ * component_js / renderform(string) 走 $.atoms 注册链路,key 即注册用的 atom key;
481
+ * is_embedded 为 false 时 data 是脚本地址,否则 data 是脚本源码。
482
+ */
483
+ type SopsPluginFormDescriptor = {
484
+ type: 'component_js';
485
+ key: string;
486
+ data: string;
487
+ base?: string;
488
+ is_embedded?: boolean;
489
+ } | {
490
+ type: 'renderform';
491
+ key?: string;
492
+ data: string | RenderformInputsItem[] | Record<string, unknown>;
493
+ base?: string;
494
+ is_embedded?: boolean;
495
+ } | {
496
+ type: 'jsonschema';
497
+ data: JsonschemaformInputs;
498
+ } | {
499
+ type: 'api_plugin_json';
500
+ data?: Record<string, unknown>;
501
+ };
502
+ interface SopsPluginDetail {
503
+ plugin_type: 'component' | 'remote_plugin' | 'uniform_api';
504
+ plugin_code: string;
505
+ plugin_version: string;
506
+ source_key: string;
507
+ plugin_source?: string;
508
+ protocol?: string;
509
+ wrapper_version?: string;
510
+ name: string;
511
+ description?: string;
512
+ inputs?: UniformApiPluginInputsItem[];
513
+ outputs?: PluginOutputItem[];
514
+ credentials?: Record<string, unknown> | null;
515
+ forms?: {
516
+ input?: SopsPluginFormDescriptor | null;
517
+ output?: SopsPluginFormDescriptor | null;
518
+ } | null;
519
+ form_schema?: Record<string, unknown> | null;
520
+ /** 表单脚本运行所需的上下文(site_url / project 等),由插件提供方下发 */
521
+ form_context?: Record<string, unknown> | null;
522
+ execution_kind?: string;
523
+ url?: string;
524
+ methods?: string[];
525
+ response_data_path?: string;
526
+ polling?: Record<string, any> | null;
527
+ callback?: Record<string, any> | null;
528
+ credential_key?: string;
529
+ }
433
530
  interface BkflowThirdPartyPluginGroupItem {
434
531
  code_name: string;
435
532
  id: number;
@@ -513,7 +610,7 @@ interface BkflowThirdPartyPluginAppDetail {
513
610
  };
514
611
  }
515
612
  interface GroupsPluginItem extends PluginGroupConfig {
516
- children: (PluginMetaItem | BkflowThirdPartyPluginGroupItem)[];
613
+ children: (PluginMetaItem | BkflowThirdPartyPluginGroupItem | SopsPluginSourceItem)[];
517
614
  }
518
615
  interface UniformApiPluginOutputItem {
519
616
  key: string;
@@ -565,6 +662,29 @@ interface UniformApiPluginConfig {
565
662
  }>;
566
663
  };
567
664
  }
665
+ interface RenderformInputsItem {
666
+ name?: string;
667
+ tag_code: string;
668
+ type: string;
669
+ attrs: Record<string, any>;
670
+ events?: Record<string, any>[];
671
+ validation?: Record<string, any>[];
672
+ }
673
+ interface JsonschemaformInputs {
674
+ type: string;
675
+ properties: Record<string, any>;
676
+ required?: string[];
677
+ definitions?: Record<string, {
678
+ type: string;
679
+ title: string;
680
+ description?: string;
681
+ default?: string | boolean | number | string[] | boolean[] | number[] | Record<string, any>;
682
+ enum?: string[];
683
+ items?: Record<string, any>;
684
+ 'ui:props'?: Record<string, any>;
685
+ 'ui:component'?: Record<string, any>;
686
+ }>;
687
+ }
568
688
  interface UniformApiPluginInputsItem {
569
689
  desc: string;
570
690
  form_type?: string;
@@ -600,6 +720,231 @@ interface CustomVariableType {
600
720
  code: string;
601
721
  }
602
722
 
723
+ interface VariableOption {
724
+ key: string;
725
+ name: string;
726
+ source_type?: string;
727
+ custom_type?: string;
728
+ }
729
+ interface CreateVariablePayload {
730
+ keyword?: string;
731
+ cursorIndex?: number;
732
+ defaultCustomType?: string;
733
+ }
734
+ /**
735
+ * 宿主自定义的候选项来源标识。
736
+ *
737
+ * 编辑器**不解释**它的内容,只做原样存储与回传:`key` 用于让宿主找到自己的加载器,
738
+ * `params` 放宿主拉取时需要的补充信息。
739
+ *
740
+ * 之所以由宿主带进来而不是编辑器从 pipeline_tree 反查关联节点的插件:节点配置尚未
741
+ * 保存时,`activities[nodeId].component` 还是换插件之前的那个,反查会拿到错的插件。
742
+ */
743
+ interface SelectRelatedOptionSourceRef {
744
+ key: string;
745
+ params?: Record<string, unknown>;
746
+ }
747
+ /**
748
+ * select 变量「关联数据」的来源,由宿主在节点表单里发起受控创建时锁定。
749
+ * 与 filter 的 FilterVariableSourceContext 平行。
750
+ */
751
+ interface SelectRelatedSourceContext {
752
+ sourceNodeId: string;
753
+ /** 关联表单项稳定 KEY,例如 index_set_id */
754
+ sourceFieldKey: string;
755
+ /**
756
+ * 关联表单项的展示名,例如「查询条件」——即节点表单上那一栏的标题,不是 fieldKey 本身。
757
+ * 全局变量侧滑没有加载插件 schema 的时机,不带进来就只能显示裸 fieldKey。
758
+ */
759
+ sourceFieldName?: string;
760
+ /** 候选项从哪来。缺省则该变量没有可拉取的候选项 */
761
+ optionSource?: SelectRelatedOptionSourceRef;
762
+ }
763
+ interface CreateVariableRequest extends CreateVariablePayload {
764
+ /** 缺省时 select 仍按「手动输入」初始化,普通「新建变量」入口不受影响 */
765
+ selectRelatedContext?: SelectRelatedSourceContext;
766
+ onCreated: (option: VariableOption) => void;
767
+ }
768
+
769
+ type DebugContextStatus = 'idle' | 'running' | 'terminating';
770
+ type DebugNodeStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'finished' | 'failed' | 'revoked' | 'suspended' | 'skipped';
771
+ type DebugExecutionMode = 'real' | 'mock';
772
+ interface DebugMissingVar {
773
+ key: string;
774
+ source_node_id: string | null;
775
+ }
776
+ type DebugRunType = 'global' | 'step';
777
+ type DebugRunStatus = 'not_run' | 'running' | 'waiting' | 'paused' | 'terminating' | 'finished' | 'failed' | 'revoked';
778
+ /** 运行级 / 节点级错误详情(last_error_detail、nodes[].error_detail)。 */
779
+ interface DebugErrorFailure {
780
+ message: string;
781
+ node_id?: string;
782
+ template_node_id?: string;
783
+ [key: string]: unknown;
784
+ }
785
+ interface DebugErrorDetail {
786
+ type?: string;
787
+ message?: string;
788
+ task_id?: number | string;
789
+ failures?: DebugErrorFailure[];
790
+ [key: string]: unknown;
791
+ }
792
+ /** 条件网关分支求值结果(`debug_context.nodes[].condition_results`)。 */
793
+ interface DebugConditionResult {
794
+ flow_id: string;
795
+ name?: string;
796
+ expression?: string;
797
+ resolved_expression?: string;
798
+ matched?: boolean;
799
+ [key: string]: unknown;
800
+ }
801
+ interface DebugContextNode {
802
+ node_id: string;
803
+ node_type: string;
804
+ execution_mode: DebugExecutionMode;
805
+ status: DebugNodeStatus;
806
+ can_step: boolean;
807
+ missing_vars: DebugMissingVar[];
808
+ waiting_reason?: string | null;
809
+ /** 是否支持单步调试;并行/汇聚网关为 false,仅用于展示全局调试状态。 */
810
+ supports_step?: boolean;
811
+ /** 是否支持 Mock;全部网关为 false。 */
812
+ supports_mock?: boolean;
813
+ mock_result?: 'success' | 'fail' | null;
814
+ error_detail?: DebugErrorDetail | string | null;
815
+ duration_ms?: number | null;
816
+ log_ref?: {
817
+ instance_id: number | string;
818
+ node_id: string;
819
+ version: string;
820
+ } | null;
821
+ mock_outputs?: Record<string, unknown> | null;
822
+ mock_error?: string | null;
823
+ outputs?: Record<string, unknown> | null;
824
+ /** 条件网关命中的出边 flow_id;画布用它把命中连线标绿。 */
825
+ selected_flow_ids?: string[];
826
+ /** 条件网关每个分支的表达式与命中结果。 */
827
+ condition_results?: DebugConditionResult[];
828
+ }
829
+ /**
830
+ * /debug_context/ 顶层结构。
831
+ *
832
+ * 前端按 status 分支:
833
+ * - running:任务定位用 active_*,进度用 last_run_status
834
+ * - terminating:继续用 active_*,UI 展示「终止中」并轮询
835
+ * - idle:active_* 为空,结果摘要用 last_*;last_task_id=null 表示尚无调试记录
836
+ */
837
+ interface DebugContext {
838
+ template_id: number;
839
+ status: DebugContextStatus;
840
+ locked_by: string;
841
+ active_task_id: number | string | null;
842
+ active_run_type: DebugRunType | null;
843
+ active_node_id: string | null;
844
+ last_task_id: number | string | null;
845
+ last_run_type: DebugRunType | null;
846
+ last_run_status: DebugRunStatus | null;
847
+ last_error_detail?: DebugErrorDetail | null;
848
+ last_inputs?: Record<string, unknown>;
849
+ global_vars: Record<string, unknown>;
850
+ missing_vars?: DebugMissingVar[];
851
+ nodes: DebugContextNode[];
852
+ }
853
+ interface DebugInputSchemaField {
854
+ key: string;
855
+ name: string;
856
+ type: string;
857
+ default?: unknown;
858
+ required?: boolean;
859
+ [key: string]: unknown;
860
+ }
861
+ interface DebugInputSchema {
862
+ fields?: DebugInputSchemaField[];
863
+ constants?: Record<string, unknown>;
864
+ [key: string]: unknown;
865
+ }
866
+ interface DebugResetImpact {
867
+ reset_node_ids: string[];
868
+ reasons?: Record<string, string>;
869
+ }
870
+ interface UpdateNodeDebugMockResult {
871
+ node_id: string;
872
+ execution_mode: DebugExecutionMode;
873
+ updated_global_vars?: Record<string, unknown>;
874
+ [key: string]: unknown;
875
+ }
876
+ interface RunNodeDebugStepResult {
877
+ node_id: string;
878
+ status: DebugNodeStatus;
879
+ outputs?: Record<string, unknown> | null;
880
+ error_detail?: unknown;
881
+ updated_global_vars?: Record<string, unknown>;
882
+ log_ref?: DebugContextNode['log_ref'];
883
+ selected_flow_ids?: string[];
884
+ condition_results?: DebugConditionResult[];
885
+ [key: string]: unknown;
886
+ }
887
+ interface RunGlobalDebugResult {
888
+ task_id: number | string;
889
+ status: DebugContextStatus;
890
+ [key: string]: unknown;
891
+ }
892
+ /**
893
+ * /debug_terminate/ 返回。
894
+ *
895
+ * 全局终止返回 `terminating`,需要继续轮询 /debug_context/ 直到 idle + last_run_status=revoked;
896
+ * 单节点终止直接返回 `idle`,并用 reset_node_ids 告知哪些节点被恢复为「未调试」。
897
+ */
898
+ interface TerminateDebugResult {
899
+ status?: DebugContextStatus;
900
+ /** 单节点终止:被恢复为 not_run 的节点,本地需同步清空输入、输出、耗时、错误与日志。 */
901
+ reset_node_ids?: string[];
902
+ [key: string]: unknown;
903
+ }
904
+ interface DebugResetResult {
905
+ reset_node_ids?: string[];
906
+ [key: string]: unknown;
907
+ }
908
+ interface UpdateNodeDebugMockParams {
909
+ templateId: string | number;
910
+ nodeId: string;
911
+ enable: boolean;
912
+ mockResult?: 'success' | 'fail';
913
+ mockOutputs?: Record<string, unknown>;
914
+ mockError?: string;
915
+ }
916
+ interface RunNodeDebugStepParams {
917
+ templateId: string | number;
918
+ nodeId: string;
919
+ mode: 'real' | 'mock';
920
+ inputOverrides?: Record<string, unknown>;
921
+ mockResult?: 'success' | 'fail';
922
+ mockOutputs?: Record<string, unknown>;
923
+ mockError?: string;
924
+ }
925
+ interface RunGlobalDebugParams {
926
+ templateId: string | number;
927
+ inputs: Record<string, unknown>;
928
+ }
929
+ interface TerminateDebugParams {
930
+ templateId: string | number;
931
+ nodeId?: string;
932
+ }
933
+ interface ResetDebugResultParams {
934
+ templateId: string | number;
935
+ nodeIds?: string[];
936
+ }
937
+ interface DebugApiServices {
938
+ fetchDebugContext(templateId: string | number): Promise<DebugContext>;
939
+ fetchDebugInputSchema(templateId: string | number): Promise<DebugInputSchema>;
940
+ fetchDebugResetImpact(templateId: string | number): Promise<DebugResetImpact>;
941
+ updateNodeDebugMock(params: UpdateNodeDebugMockParams): Promise<UpdateNodeDebugMockResult>;
942
+ runNodeDebugStep(params: RunNodeDebugStepParams): Promise<RunNodeDebugStepResult>;
943
+ runGlobalDebug(params: RunGlobalDebugParams): Promise<RunGlobalDebugResult>;
944
+ terminateDebug(params: TerminateDebugParams): Promise<TerminateDebugResult>;
945
+ resetDebugResult(params: ResetDebugResultParams): Promise<DebugResetResult>;
946
+ }
947
+
603
948
  /**
604
949
  * Flow API 配置接口
605
950
  */
@@ -613,10 +958,7 @@ interface FlowApiConfig {
613
958
  /** CSRF cookie 名称(可选,用于创建新的 axios 实例时设置 xsrfCookieName) */
614
959
  xsrfCookieName?: string;
615
960
  /** 作用域数据(必需,由外部传入) */
616
- scopeData: {
617
- scope_type: string;
618
- scope_value: number;
619
- };
961
+ scopeData: ScopeData;
620
962
  /**
621
963
  * 用户查询 API 地址(可选)
622
964
  * @deprecated 请改用 FlowEdit/FlowView 顶层组件的 `memberSelectorConfig.fetchUserApi`。
@@ -626,6 +968,12 @@ interface FlowApiConfig {
626
968
  /** 是否启用第三方插件(可选,默认为 true) */
627
969
  enableThirdPlugin?: boolean;
628
970
  }
971
+ interface ScopeData {
972
+ scope_type: string;
973
+ scope_value: number;
974
+ /** 业务方传入的空间 ID,语义独立于 scope_value。 */
975
+ space_id: number;
976
+ }
629
977
 
630
978
  interface DrawPipelineParams {
631
979
  pipeline_tree: PipelineTree;
@@ -655,6 +1003,7 @@ interface FetchTaskStateParams {
655
1003
  interface FetchTaskNodeDetailParams {
656
1004
  task_id: number | string;
657
1005
  node_id: string;
1006
+ component_code?: string;
658
1007
  }
659
1008
  interface FetchTaskNodeSnapshotParams {
660
1009
  task_id: number | string;
@@ -676,10 +1025,66 @@ interface OperateTaskNodeParams {
676
1025
  interface GetFlowTaskDetailParams {
677
1026
  task_id: number | string;
678
1027
  }
1028
+ interface SopsPluginCategoryParams {
1029
+ template_id: number | string;
1030
+ /** 空间 uniform_api 配置里的 api_name,如 sops_builtin / sops_third_party */
1031
+ api_name: string;
1032
+ }
1033
+ interface SopsPluginListParams extends SopsPluginCategoryParams {
1034
+ category?: string;
1035
+ /** 插件名称搜索关键字 */
1036
+ key?: string;
1037
+ limit?: number;
1038
+ offset?: number;
1039
+ }
1040
+ /**
1041
+ * 统一插件详情请求参数。
1042
+ * 后端 serializer 会拒绝契约外字段(不是静默忽略),调用方不要附加额外参数;
1043
+ * space_id / scope_type / scope_value 由 service 从 scopeData 补齐。
1044
+ */
1045
+ interface SopsPluginDetailParams {
1046
+ template_id: number | string;
1047
+ plugin_type: 'component' | 'remote_plugin' | 'uniform_api';
1048
+ plugin_code: string;
1049
+ plugin_version: string;
1050
+ /** uniform_api 必填,缺失时后端直接 400 */
1051
+ source_key?: string;
1052
+ }
679
1053
  interface FlowTaskDetail {
680
1054
  id: number | string;
681
1055
  template_id: number;
682
1056
  pipeline_tree: PipelineTree;
1057
+ /** 任务已耗时(秒),调试摘要弹层刷新恢复用。 */
1058
+ elapsed_time?: number;
1059
+ [key: string]: unknown;
1060
+ }
1061
+ interface CreateFlowTaskParams {
1062
+ template_id: number;
1063
+ name: string;
1064
+ creator: string;
1065
+ constants: Record<string, any>;
1066
+ label_ids?: number[];
1067
+ [key: string]: unknown;
1068
+ }
1069
+ interface CreateFlowTaskResult {
1070
+ data: {
1071
+ id: number | string;
1072
+ template_id?: number;
1073
+ [key: string]: unknown;
1074
+ };
1075
+ [key: string]: unknown;
1076
+ }
1077
+ interface ExecuteFlowTaskResult {
1078
+ result?: boolean;
1079
+ code?: number;
1080
+ data?: {
1081
+ /** 任务详情页跳转地址(含正确的 bkflow task id 与 templateId) */
1082
+ url?: string;
1083
+ [key: string]: unknown;
1084
+ };
1085
+ message?: string | null;
1086
+ request_id?: string;
1087
+ trace_id?: string | null;
683
1088
  [key: string]: unknown;
684
1089
  }
685
1090
  interface TaskStateResult {
@@ -707,6 +1112,8 @@ interface FlowViewApiConfig {
707
1112
  scopeData: {
708
1113
  scope_type: string;
709
1114
  scope_value: number;
1115
+ /** 业务方传入的空间 ID,调试接口专用,语义独立于 scope_value */
1116
+ space_id: number;
710
1117
  };
711
1118
  fetchFlowDraftDetail?: (id: string) => Promise<FlowDraftDetail>;
712
1119
  fetchFlowDetailByVersion?: (id: string, version: string) => Promise<FlowDetailByVersion>;
@@ -726,23 +1133,13 @@ interface FlowViewApiConfig {
726
1133
  data: any[];
727
1134
  };
728
1135
  }>;
729
- createFlowTask?: (params: {
730
- template_id: number;
731
- name: string;
732
- creator: string;
733
- constants: Record<string, any>;
734
- }) => Promise<{
735
- data: {
736
- id: number;
737
- template_id: number;
738
- };
739
- }>;
1136
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
740
1137
  executeFlowTask?: (params: {
741
1138
  task_id: number | string;
742
1139
  resource_type: string;
743
1140
  resource_id: number | string;
744
1141
  permission_type: string;
745
- }) => Promise<any>;
1142
+ }) => Promise<ExecuteFlowTaskResult>;
746
1143
  revokeFlowTask?: (params: {
747
1144
  task_id: number | string;
748
1145
  resource_type: string;
@@ -789,33 +1186,26 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
789
1186
  fetchBkFlowThirdPartyPluginTags: () => Promise<BkflowThirdPartyPluginGroupItem[]>;
790
1187
  fetchBkFlowThirdPartyPluginMeta: (plugin_code: string) => Promise<BkflowThirdPartyPluginMetaDetail>;
791
1188
  fetchBkFlowThirdPartyPluginDetail: (plugin_code: string, plugin_version: string) => Promise<BkflowThirdPartyPluginDetail>;
792
- fetchBkFlowThirdPartyPluginAppDetail: (plugin_code: string) => Promise<BkflowThirdPartyPluginAppDetail>;
1189
+ fetchBkFlowThirdPartyPluginAppDetail: (plugin_code: string, plugin_version: string) => Promise<BkflowThirdPartyPluginAppDetail>;
793
1190
  fetchPluginGroupList: () => Promise<PluginGroupConfig[]>;
794
1191
  fetchCategoryPlugins: (category: string) => Promise<PluginMetaItem[]>;
795
1192
  fetchAllPluginGroups: () => Promise<GroupsPluginItem[]>;
796
1193
  enableThirdPlugin?: boolean;
1194
+ fetchSopsPluginCategories?: (params: SopsPluginCategoryParams) => Promise<SopsPluginCategory[]>;
1195
+ fetchSopsPluginList?: (params: SopsPluginListParams) => Promise<SopsPluginListResult>;
1196
+ fetchSopsPluginDetail?: (params: SopsPluginDetailParams) => Promise<SopsPluginDetail>;
797
1197
  fetchPluginDetail?: (id: string) => Promise<UniformApiPluginDetail>;
798
1198
  fetchApplyInstructionData?: (params: any) => Promise<any>;
799
1199
  drawPipeline?: (params: DrawPipelineParams) => Promise<{
800
1200
  pipeline_tree: PipelineTree;
801
1201
  }>;
802
- createFlowTask?: (params: {
803
- template_id: number;
804
- name: string;
805
- creator: string;
806
- constants: Record<string, any>;
807
- }) => Promise<{
808
- data: {
809
- id: number;
810
- template_id: number;
811
- };
812
- }>;
1202
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
813
1203
  executeFlowTask?: (params: {
814
1204
  task_id: number | string;
815
1205
  resource_type: string;
816
1206
  resource_id: number | string;
817
1207
  permission_type: string;
818
- }) => Promise<any>;
1208
+ }) => Promise<ExecuteFlowTaskResult>;
819
1209
  revokeFlowTask?: (params: {
820
1210
  task_id: number | string;
821
1211
  resource_type: string;
@@ -835,14 +1225,21 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
835
1225
  fetchTaskNodeLog?: (params: FetchTaskNodeLogParams) => Promise<unknown>;
836
1226
  getFlowTaskDetail?: (params: GetFlowTaskDetailParams) => Promise<FlowTaskDetail>;
837
1227
  }
1228
+ interface FlowDetailApiConfig extends FlowEditApiConfig, Partial<DebugApiServices> {
1229
+ }
838
1230
 
1231
+ declare const SOPS_PLUGIN_GROUP_NAME = "sops";
839
1232
  declare const PLUGIN_GROUP_ICON_MAP: Record<string, string>;
840
1233
 
841
1234
  /**
842
1235
  * 使用 Flow API 的 composable
843
- * 返回所有 API 方法,兼容 FlowEditApiConfig 接口
1236
+ * 返回所有 API 方法,兼容 FlowDetailApiConfig 接口(含调试 API)
844
1237
  */
845
- declare function useFlowApi(config: FlowApiConfig): FlowEditApiConfig;
1238
+ declare function useFlowApi(config: FlowApiConfig): FlowDetailApiConfig;
1239
+
1240
+ type VariableInputCreateVariableHandler = (request: CreateVariableRequest) => void;
1241
+ declare const provideVariableInputCreateVariable: (handler: VariableInputCreateVariableHandler) => void;
1242
+ declare const useVariableInputCreateVariable: () => VariableInputCreateVariableHandler | null;
846
1243
 
847
- export { PLUGIN_GROUP_ICON_MAP, useFlowApi };
848
- export type { CustomVariableType, EndEvent, Flow, FlowEditApiConfig, FlowListItem, FlowViewApiConfig, GatewayType, Line, Location, NodeConfigData, NodeType, NotifyConfig, PluginGroupConfig, PluginOutputItem, PortOrientation, StartEvent, TemplateConfigs, UniformApiPluginConfig, UniformApiPluginInputsItem, VariableRefRequestParams };
1244
+ export { PLUGIN_GROUP_ICON_MAP, SOPS_PLUGIN_GROUP_NAME, provideVariableInputCreateVariable, useFlowApi, useVariableInputCreateVariable };
1245
+ export type { CreateVariablePayload, CreateVariableRequest, CustomVariableType, DebugApiServices, DebugConditionResult, DebugContext, DebugContextNode, DebugContextStatus, DebugErrorDetail, DebugExecutionMode, DebugInputSchema, DebugMissingVar, DebugNodeStatus, DebugRunStatus, DebugRunType, EndEvent, Flow, FlowDetailApiConfig, FlowEditApiConfig, FlowListItem, FlowViewApiConfig, GatewayType, Line, Location, NodeConfigData, NodeType, NotifyConfig, PluginGroupConfig, PluginOutputItem, PortOrientation, SelectRelatedSourceContext, SopsPluginCategory, SopsPluginCategoryParams, SopsPluginDetail, SopsPluginDetailParams, SopsPluginFormDescriptor, SopsPluginItem, SopsPluginListParams, SopsPluginListResult, SopsPluginSourceItem, SpaceUniformApiEntry, StartEvent, TemplateConfigs, UniformApiPluginConfig, UniformApiPluginInputsItem, VariableInputCreateVariableHandler, VariableOption, VariableRefRequestParams };
@@ -1,5 +1,8 @@
1
- import { P as s, u as _ } from "./composable-gqC5C2k8.js";
1
+ import { P as r, S as s, p as P, u as i, a as p } from "./context-Ct82UNm-.js";
2
2
  export {
3
- s as PLUGIN_GROUP_ICON_MAP,
4
- _ as useFlowApi
3
+ r as PLUGIN_GROUP_ICON_MAP,
4
+ s as SOPS_PLUGIN_GROUP_NAME,
5
+ P as provideVariableInputCreateVariable,
6
+ i as useFlowApi,
7
+ p as useVariableInputCreateVariable
5
8
  };