@blueking/bkflow-canvas-editor 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -641,6 +641,41 @@ interface DrawPipelineParams {
641
641
  gateway_size?: [number, number];
642
642
  start?: [number, number];
643
643
  }
644
+ interface CreateFlowTaskParams {
645
+ template_id: number;
646
+ name: string;
647
+ creator: string;
648
+ constants: Record<string, any>;
649
+ label_ids?: number[];
650
+ [key: string]: unknown;
651
+ }
652
+ interface CreateFlowTaskResult {
653
+ data: {
654
+ id: number;
655
+ template_id: number;
656
+ [key: string]: unknown;
657
+ };
658
+ [key: string]: unknown;
659
+ }
660
+ interface ExecuteFlowTaskResult {
661
+ result?: boolean;
662
+ code?: number;
663
+ data?: {
664
+ /** 任务详情页跳转地址(含正确的 bkflow task id 与 templateId) */
665
+ url?: string;
666
+ [key: string]: unknown;
667
+ };
668
+ message?: string | null;
669
+ request_id?: string;
670
+ trace_id?: string | null;
671
+ [key: string]: unknown;
672
+ }
673
+ interface FlowTaskExecuteSuccessResult {
674
+ /** createFlowTask(create_task)接口响应 */
675
+ createResult: CreateFlowTaskResult;
676
+ /** executeFlowTask(operate_task)接口响应,data.url 用于任务详情跳转 */
677
+ executeResult: ExecuteFlowTaskResult;
678
+ }
644
679
 
645
680
  interface FlowViewApiConfig {
646
681
  fetchFlowDetail: (id: string) => Promise<FlowTemplate>;
@@ -670,24 +705,14 @@ interface FlowViewApiConfig {
670
705
  data: any[];
671
706
  };
672
707
  }>;
673
- createFlowTask?: (params: {
674
- template_id: number;
675
- name: string;
676
- creator: string;
677
- constants: Record<string, any>;
678
- }) => Promise<{
679
- data: {
680
- id: number;
681
- template_id: number;
682
- };
683
- }>;
708
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
684
709
  executeFlowTask?: (params: {
685
710
  task_id: number;
686
711
  action: string;
687
712
  resource_type: string;
688
713
  resource_id: number;
689
714
  permission_type: string;
690
- }) => Promise<any>;
715
+ }) => Promise<ExecuteFlowTaskResult>;
691
716
  fetchControlConfig?: () => Promise<Record<string, any>>;
692
717
  checkSpaceConfig?: (scopeValue: number, params: {
693
718
  name: string;
@@ -725,24 +750,14 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
725
750
  drawPipeline?: (params: DrawPipelineParams) => Promise<{
726
751
  pipeline_tree: PipelineTree;
727
752
  }>;
728
- createFlowTask?: (params: {
729
- template_id: number;
730
- name: string;
731
- creator: string;
732
- constants: Record<string, any>;
733
- }) => Promise<{
734
- data: {
735
- id: number;
736
- template_id: number;
737
- };
738
- }>;
753
+ createFlowTask?: (params: CreateFlowTaskParams) => Promise<CreateFlowTaskResult>;
739
754
  executeFlowTask?: (params: {
740
755
  task_id: number;
741
756
  action: string;
742
757
  resource_type: string;
743
758
  resource_id: number;
744
759
  permission_type: string;
745
- }) => Promise<any>;
760
+ }) => Promise<ExecuteFlowTaskResult>;
746
761
  }
747
762
 
748
763
  type __VLS_Props$5 = {
@@ -767,10 +782,10 @@ declare var __VLS_65: {
767
782
  };
768
783
  variablesValue: Record<string, any>;
769
784
  };
770
- type __VLS_Slots$4 = {} & {
785
+ type __VLS_Slots$5 = {} & {
771
786
  'custom-form-content'?: (props: typeof __VLS_65) => any;
772
787
  };
773
- declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
788
+ declare const __VLS_base$5: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
774
789
  close: (...args: any[]) => void;
775
790
  "update:show": (...args: any[]) => void;
776
791
  confirm: (...args: any[]) => void;
@@ -786,10 +801,10 @@ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$5, {}, {}, {}, {}, v
786
801
  enableVersion: boolean;
787
802
  useCustomConfirm: boolean;
788
803
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
789
- declare const __VLS_export$5: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
804
+ declare const __VLS_export$5: __VLS_WithSlots$5<typeof __VLS_base$5, __VLS_Slots$5>;
790
805
  declare const _default$6: typeof __VLS_export$5;
791
806
 
792
- type __VLS_WithSlots$4<T, S> = T & {
807
+ type __VLS_WithSlots$5<T, S> = T & {
793
808
  new (): {
794
809
  $slots: S;
795
810
  };
@@ -801,7 +816,7 @@ declare namespace __debug_vue {
801
816
  };
802
817
  }
803
818
 
804
- type __VLS_Slots$3 = {
819
+ type __VLS_Slots$4 = {
805
820
  header?: () => any;
806
821
  extend?: () => any;
807
822
  };
@@ -814,7 +829,7 @@ type __VLS_Props$4 = {
814
829
  showHeader?: boolean;
815
830
  onBack?: () => void;
816
831
  };
817
- declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
832
+ declare const __VLS_base$4: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
818
833
  retry: (nodeId: string) => any;
819
834
  skip: (nodeId: string) => any;
820
835
  resume: (nodeId: string) => any;
@@ -857,10 +872,10 @@ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$4, {}, {}, {}, {}, v
857
872
  defaultZoom: number;
858
873
  nodeStates: TaskExecutionStates;
859
874
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
860
- declare const __VLS_export$4: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
875
+ declare const __VLS_export$4: __VLS_WithSlots$4<typeof __VLS_base$4, __VLS_Slots$4>;
861
876
  declare const _default$5: typeof __VLS_export$4;
862
877
 
863
- type __VLS_WithSlots$3<T, S> = T & {
878
+ type __VLS_WithSlots$4<T, S> = T & {
864
879
  new (): {
865
880
  $slots: S;
866
881
  };
@@ -872,16 +887,24 @@ declare namespace __execute_vue {
872
887
  };
873
888
  }
874
889
 
890
+ type __VLS_Slots$3 = {
891
+ customFormContent?: (props: {
892
+ customFormData: Record<string, any>;
893
+ additionalTaskParams: Record<string, any>;
894
+ updateCustomFormData: (data: Record<string, any>) => void;
895
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
896
+ }) => any;
897
+ };
875
898
  type __VLS_Props$3 = {
876
899
  flowId: string;
877
900
  show: boolean;
878
901
  editable?: boolean;
879
902
  showFlowEntry?: boolean;
880
903
  apiConfig: FlowApiConfig;
881
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
904
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
882
905
  bkflowSaasUrl?: string;
883
906
  };
884
- declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
907
+ declare const __VLS_base$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
885
908
  close: (...args: any[]) => void;
886
909
  "update:show": (...args: any[]) => void;
887
910
  confirm: (...args: any[]) => void;
@@ -897,8 +920,15 @@ declare const __VLS_export$3: vue.DefineComponent<__VLS_Props$3, {}, {}, {}, {},
897
920
  editable: boolean;
898
921
  showFlowEntry: boolean;
899
922
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
923
+ declare const __VLS_export$3: __VLS_WithSlots$3<typeof __VLS_base$3, __VLS_Slots$3>;
900
924
  declare const _default$4: typeof __VLS_export$3;
901
925
 
926
+ type __VLS_WithSlots$3<T, S> = T & {
927
+ new (): {
928
+ $slots: S;
929
+ };
930
+ };
931
+
902
932
  declare namespace __create_task_vue {
903
933
  export {
904
934
  _default$4 as default,
@@ -1052,6 +1082,12 @@ type __VLS_Slots$1 = {
1052
1082
  }[];
1053
1083
  updateInputParams: (data: Record<string, any>) => void;
1054
1084
  }) => any;
1085
+ customFormContent?: (props: {
1086
+ customFormData: Record<string, any>;
1087
+ additionalTaskParams: Record<string, any>;
1088
+ updateCustomFormData: (data: Record<string, any>) => void;
1089
+ updateAdditionalTaskParams: (params: Record<string, any>) => void;
1090
+ }) => any;
1055
1091
  };
1056
1092
  type __VLS_Props$1 = {
1057
1093
  flowId: string;
@@ -1068,7 +1104,7 @@ type __VLS_Props$1 = {
1068
1104
  showHeaderActions?: boolean;
1069
1105
  defaultZoom?: number;
1070
1106
  bkflowSaasUrl?: string;
1071
- onExecuteSuccess?: (taskId: number, templateId: number) => void;
1107
+ onExecuteSuccess?: (result: FlowTaskExecuteSuccessResult) => void;
1072
1108
  };
1073
1109
  declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1074
1110
  back: () => any;
@@ -1340,4 +1376,4 @@ declare const _default: {
1340
1376
  };
1341
1377
 
1342
1378
  export { _default$1 as BkFlowCanvas, BkFlowModelAccessor, BkFlowNodeAccessor, _default$4 as FlowCreateTask, _default$6 as FlowDebug, _default$3 as FlowEdit, _default$5 as FlowExecute, _default$2 as FlowView, bkflowConnectionValidator, createBkflowPlugin, createBkflowSchema, createExecutionStatusPlugin, _default as default, exportToPipelineTree, generateId, getUniformApiPluginFormValue, getVariableDefaultConfig, importFromPipelineTree, provideFlowApiConfig, provideSelectPanelConfig, random4, resolveExecutionActions, useFlowApiConfig, useFlowEditApiConfig, useFlowViewApiConfig, useSelectPanelConfig, validatePipelineTree };
1343
- export type { Activity, DndNodeItem, ExecutionNodeAction, FlowApiConfig, FlowEditExpose, FlowTemplate, Gateway, GatewayCondition, NodeExecutionState, NodeExecutionStatus, NotifyConfig, PipelineTree, PluginDetailCommon, PluginInputDataItem, SelectPanelConfig, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };
1379
+ export type { Activity, CreateFlowTaskResult, DndNodeItem, ExecuteFlowTaskResult, ExecutionNodeAction, FlowApiConfig, FlowEditExpose, FlowTaskExecuteSuccessResult, FlowTemplate, Gateway, GatewayCondition, NodeExecutionState, NodeExecutionStatus, NotifyConfig, PipelineTree, PluginDetailCommon, PluginInputDataItem, SelectPanelConfig, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };