@blueking/bkflow-canvas-editor 1.1.0-beta.43 → 1.1.0-beta.45

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.
Files changed (40) hide show
  1. package/README.md +59 -2
  2. package/dist/advanced.cjs.js +1 -1
  3. package/dist/advanced.d.ts +69 -3
  4. package/dist/advanced.esm.js +1 -1
  5. package/dist/bkflow-canvas-editor_false-B70uLuHL.cjs +1 -0
  6. package/dist/bkflow-canvas-editor_false-BlC281Zg.cjs +1 -0
  7. package/dist/bkflow-canvas-editor_false-Casww7p4.js +5 -0
  8. package/dist/bkflow-canvas-editor_false-i9G8sqQi.js +5 -0
  9. package/dist/context-Bu4mmo1Q.js +1593 -0
  10. package/dist/context-bUpcrt8M.cjs +6 -0
  11. package/dist/index-Bb8gt0ZM.cjs +2 -0
  12. package/dist/index-BynYn4VD.cjs +1 -0
  13. package/dist/index-C1q_QVHM.cjs +1 -0
  14. package/dist/index-C8XJMS_J.js +236 -0
  15. package/dist/index-CddPhY6u.cjs +1 -0
  16. package/dist/{index-Bqm08e7H.js → index-CgRqOi-E.js} +28172 -28252
  17. package/dist/index-Ci_fP1q2.js +127 -0
  18. package/dist/index-ClbXmmTg.js +168 -0
  19. package/dist/index-DQG9J2SZ.js +137 -0
  20. package/dist/index-FcnoAxWL.cjs +82 -0
  21. package/dist/index-Htumo8sH.cjs +1 -0
  22. package/dist/index-_LhW2Gn_.js +647 -0
  23. package/dist/index-pYNKHhNh.js +73 -0
  24. package/dist/index-rLG78MgZ.cjs +1 -0
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.d.ts +104 -4
  27. package/dist/index.esm.js +43 -34
  28. package/dist/style.css +1 -1
  29. package/package.json +1 -1
  30. package/dist/context-Bg6nsbrK.js +0 -688
  31. package/dist/context-iqnF_HqS.cjs +0 -1
  32. package/dist/index-B0DQFaEe.cjs +0 -82
  33. package/dist/index-BBNwbryo.cjs +0 -1
  34. package/dist/index-BSJC2Tb-.js +0 -512
  35. package/dist/index-BycpBKMO.cjs +0 -1
  36. package/dist/index-Ckij2Mxn.cjs +0 -1
  37. package/dist/index-D7t1wcMU.js +0 -234
  38. package/dist/index-DgQ-ScE5.js +0 -162
  39. package/dist/index.es.min-BpHMrg2Y.cjs +0 -2
  40. package/dist/index.es.min-DYp0DL9J.js +0 -3543
@@ -0,0 +1,73 @@
1
+ import { defineComponent as u, resolveComponent as p, openBlock as b, createBlock as k, withCtx as i, createElementVNode as t, createVNode as a, unref as e, toDisplayString as n, createTextVNode as l } from "vue";
2
+ import { ExclamationCircleShape as g } from "bkui-vue/lib/icon";
3
+ import "./context-Bu4mmo1Q.js";
4
+ import { t as s } from "@blueking/flow-canvas";
5
+ import { _ as v } from "./index-CgRqOi-E.js";
6
+ const w = { class: "rollback-dialog-body" }, C = { class: "rollback-icon-wrap" }, x = { class: "rollback-title" }, y = { class: "rollback-desc" }, B = { class: "rollback-footer" }, N = /* @__PURE__ */ u({
7
+ __name: "index",
8
+ props: {
9
+ show: { type: Boolean },
10
+ version: { default: "" },
11
+ pending: { type: Boolean, default: !1 }
12
+ },
13
+ emits: ["update:show", "confirm"],
14
+ setup(_, { emit: f }) {
15
+ const o = _, c = f, m = () => {
16
+ o.pending || !o.version || c("confirm", o.version);
17
+ }, r = () => {
18
+ o.pending || c("update:show", !1);
19
+ };
20
+ return (V, E) => {
21
+ const d = p("bk-button"), h = p("bk-dialog");
22
+ return b(), k(h, {
23
+ "is-show": o.show,
24
+ "dialog-type": "show",
25
+ width: 440,
26
+ "esc-close": !1,
27
+ "quick-close": !1,
28
+ class: "flow-rollback-confirm-dialog",
29
+ onClosed: r
30
+ }, {
31
+ default: i(() => [
32
+ t("div", w, [
33
+ t("div", C, [
34
+ a(e(g), { class: "rollback-icon" })
35
+ ]),
36
+ t("h3", x, n(e(s)("确认加载至草稿?")), 1),
37
+ t("p", y, [
38
+ l(n(e(s)("将版本 {version} 的内容加载至草稿,", { version: o.version || "--" })), 1),
39
+ t("strong", null, n(e(s)("当前草稿中未发布的改动将被覆盖")), 1),
40
+ l(n(e(s)(",该操作不可撤销。")), 1)
41
+ ]),
42
+ t("div", B, [
43
+ a(d, {
44
+ theme: "primary",
45
+ "data-test": "rollback-confirm",
46
+ loading: o.pending,
47
+ onClick: m
48
+ }, {
49
+ default: i(() => [
50
+ l(n(e(s)("确认恢复")), 1)
51
+ ]),
52
+ _: 1
53
+ }, 8, ["loading"]),
54
+ a(d, {
55
+ disabled: o.pending,
56
+ onClick: r
57
+ }, {
58
+ default: i(() => [
59
+ l(n(e(s)("取消")), 1)
60
+ ]),
61
+ _: 1
62
+ }, 8, ["disabled"])
63
+ ])
64
+ ])
65
+ ]),
66
+ _: 1
67
+ }, 8, ["is-show"]);
68
+ };
69
+ }
70
+ }), j = /* @__PURE__ */ v(N, [["__scopeId", "data-v-fc586d38"]]);
71
+ export {
72
+ j as default
73
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");require("./context-bUpcrt8M.cjs");const l=require("./index-FcnoAxWL.cjs");require("bkui-vue/lib/message");require("bkui-vue/lib/icon");require("monaco-editor");const u=require("@blueking/flow-canvas"),N={string:"input",text:"input",textarea:"textarea",int:"input",integer:"input",number:"input",float:"input",json:"json",object:"json",array:"array",list:"array",select:"select",time:"timepicker",datetime:"timepicker"},g=o=>o.replace(/^\$\{(.+)\}$/,"$1"),V=o=>`\${${g(o)}}`;function F(o,d){const a=V(o.key),n=d?l.cloneDeep(d):{},p=o.custom_type??n.custom_type??N[o.type]??"input";return{...n,key:a,name:o.name??n.name??g(o.key),custom_type:p,desc:n.desc??"",index:n.index??0,show_type:"show",source_info:n.source_info??{},source_tag:n.source_tag??"",source_type:n.source_type??"custom",validation:n.validation??"",value:o.default??n.value,meta:{...n.meta??{},required:o.required??n.meta?.required??!1}}}function q(o,d={}){if(!o)return{};const a=o.constants;return a&&Object.keys(a).length>0?{...a}:Array.isArray(o.fields)&&o.fields.length>0?o.fields.reduce((n,p)=>{const s=V(p.key);return n[s]=F(p,d[s]),n},{}):{}}const j={class:"global-debug-input"},R={key:0,class:"global-debug-input__params","data-test":"input-params"},S={class:"col-name"},L={class:"col-value"},O={key:0},T={class:"global-debug-input__empty",colspan:"2"},I=["title"],P={class:"col-value"},$={key:1,class:"global-debug-input__value"},A={key:1,class:"form-params-wrapper"},U={class:"sideslider-footer-buttons"},K=e.defineComponent({__name:"index",props:{show:{type:Boolean},schema:{},pipelineConstants:{default:()=>({})},initialValues:{default:()=>({})},pending:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["confirm","close","update:show"],setup(o,{emit:d}){const a=o,n=d,p=l.useFlowApiConfig(),s=e.ref({}),f=e.shallowRef([]),m=e.shallowRef([]),y=e.shallowRef(!1),v=e.ref(),_=e.ref(),k=e.computed(()=>f.value.filter(t=>l.isBuiltinUsageVariable(t))),w=e.computed(()=>k.value.length>0||m.value.length>0),h=e.computed(()=>[...f.value].sort((t,r)=>(t.index??0)-(r.index??0)).map(t=>{const r=Object.prototype.hasOwnProperty.call(s.value,t.key)?s.value[t.key]:t.value;return{key:t.key,name:t.name||t.key,value:r,display:l.formatDebugValue(r),isComplex:l.isComplexDebugValue(r)}}));e.watch(()=>a.show,t=>{t&&(s.value=l.cloneDeep(a.initialValues??{}),B())});const B=async()=>{const t=q(a.schema,a.pipelineConstants),r=Object.values(t).filter(i=>typeof i=="object"&&i!==null&&i.show_type==="show");if(f.value=r,a.readonly||Object.keys(t).length<1){m.value=[];return}y.value=!0;try{m.value=await l.getInputFormsFromConstants(p,t)}catch(i){console.error("Failed to build debug input forms from schema:",i),m.value=[]}finally{y.value=!1}},C=t=>{s.value={...s.value,...l.cloneDeep(t)}},x=async()=>{const[t,r]=await Promise.all([Promise.resolve(typeof _.value?.validate=="function"?_.value.validate():!0),Promise.resolve(typeof v.value?.validate=="function"?v.value.validate():!0)]);!t||!r||n("confirm",l.cloneDeep(s.value))},b=()=>{n("close"),n("update:show",!1)};return(t,r)=>{const i=e.resolveComponent("bk-button"),E=e.resolveComponent("bk-sideslider"),D=e.resolveDirective("bkloading");return e.openBlock(),e.createBlock(E,{title:e.unref(u.t)("调试参数"),"is-show":a.show,width:960,"quick-close":!0,"esc-close":!1,onClosed:b},e.createSlots({default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("div",j,[a.readonly?(e.openBlock(),e.createElementBlock("table",R,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",S,e.toDisplayString(e.unref(u.t)("参数名")),1),e.createElementVNode("th",L,e.toDisplayString(e.unref(u.t)("参数值")),1)])]),e.createElementVNode("tbody",null,[h.value.length===0?(e.openBlock(),e.createElementBlock("tr",O,[e.createElementVNode("td",T,e.toDisplayString(e.unref(u.t)("暂无参数")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,c=>(e.openBlock(),e.createElementBlock("tr",{key:c.key,"data-test":"input-row"},[e.createElementVNode("td",{class:"col-name",title:c.key},e.toDisplayString(c.name),9,I),e.createElementVNode("td",P,[c.isComplex?(e.openBlock(),e.createBlock(l.DebugJsonViewer,{key:0,value:c.value,"data-test":"json-viewer"},null,8,["value"])):(e.openBlock(),e.createElementBlock("pre",$,e.toDisplayString(c.display),1))])]))),128))])])):(e.openBlock(),e.createElementBlock("div",A,[k.value.length>0?(e.openBlock(),e.createBlock(e.unref(l.BuiltinVariableUsageForm),{key:0,ref_key:"builtinVariableFormRef",ref:_,modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=c=>s.value=c),variables:k.value},null,8,["modelValue","variables"])):e.createCommentVNode("",!0),m.value.length>0?(e.openBlock(),e.createBlock(l.RenderForm,{key:1,ref_key:"renderFormRef",ref:v,scheme:m.value,editable:"","form-option":{showRequired:!0,showGroup:!0,showLabel:!1,showHook:!1,showDesc:!0,formEdit:!0},"form-data":s.value,onChange:C},null,8,["scheme","form-data"])):e.createCommentVNode("",!0),w.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(l.EmptyException,{key:2,title:e.unref(u.t)("暂无参数")},null,8,["title"]))]))])),[[D,{loading:y.value}]])]),_:2},[a.readonly?void 0:{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",U,[e.createVNode(i,{theme:"primary","data-test":"save-and-run",loading:a.pending,onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u.t)("保存并执行")),1)]),_:1},8,["loading"]),e.createVNode(i,{disabled:a.pending,onClick:b},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(u.t)("取消")),1)]),_:1},8,["disabled"])])]),key:"0"}]),1032,["title","is-show"])}}}),G=l._export_sfc(K,[["__scopeId","data-v-8eaa2ef7"]]);exports.default=G;
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-B0DQFaEe.cjs"),o=require("./context-iqnF_HqS.cjs");exports.BkFlowCanvas=e.BkFlowCanvas;exports.BkFlowModelAccessor=e.BkFlowModelAccessor;exports.BkFlowNodeAccessor=e.BkFlowNodeAccessor;exports.FlowCreateTask=e.FlowCreateTask;exports.FlowDebug=e.FlowDebug;exports.FlowDetail=e.index;exports.FlowEdit=e.edit;exports.FlowExecute=e.execute;exports.FlowMockDebug=e.mock;exports.FlowView=e.view;exports.bkflowConnectionValidator=e.bkflowConnectionValidator;exports.createBkflowPlugin=e.createBkflowPlugin;exports.createBkflowSchema=e.createBkflowSchema;exports.createExecutionStatusPlugin=e.createExecutionStatusPlugin;exports.default=e.index$1;exports.exportToPipelineTree=e.exportToPipelineTree;exports.getUniformApiPluginFormValue=e.getUniformApiPluginFormValue;exports.getVariableDefaultConfig=e.getVariableDefaultConfig;exports.importFromPipelineTree=e.importFromPipelineTree;exports.isMockableNode=e.isMockableNode;exports.mergeOutputs=e.mergeOutputs;exports.normalizePluginOutputItems=e.normalizePluginOutputItems;exports.provideFilterVariableConfig=e.provideFilterVariableConfig;exports.provideFlowApiConfig=e.provideFlowApiConfig;exports.provideMemberSelectorConfig=e.provideMemberSelectorConfig;exports.provideSelectPanelConfig=e.provideSelectPanelConfig;exports.provideSelectRelatedOptionConfig=e.provideSelectRelatedOptionConfig;exports.resolveExecutionActions=e.resolveExecutionActions;exports.resolveMockFormControl=e.resolveMockFormControl;exports.useFlowApiConfig=e.useFlowApiConfig;exports.useFlowEditApiConfig=e.useFlowEditApiConfig;exports.useFlowViewApiConfig=e.useFlowViewApiConfig;exports.useMemberSelectorConfig=e.useMemberSelectorConfig;exports.useSelectPanelConfig=e.useSelectPanelConfig;exports.validatePipelineTree=e.validatePipelineTree;exports.generateId=o.generateId;exports.random4=o.random4;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-FcnoAxWL.cjs"),i=require("./context-bUpcrt8M.cjs"),o=require("@blueking/flow-canvas");exports.BkFlowCanvas=e.BkFlowCanvas;exports.BkFlowModelAccessor=e.BkFlowModelAccessor;exports.BkFlowNodeAccessor=e.BkFlowNodeAccessor;exports.FlowCreateTask=e.FlowCreateTask;exports.FlowDebug=e.FlowDebug;exports.FlowDetail=e.index;exports.FlowEdit=e.edit;exports.FlowExecute=e.execute;exports.FlowMockDebug=e.mock;exports.FlowView=e.view;exports.applyBkuiLocale=e.applyBkuiLocale;exports.applyBkuiLocaleToTree=e.applyBkuiLocaleToTree;exports.bkflowConnectionValidator=e.bkflowConnectionValidator;exports.createBkflowPlugin=e.createBkflowPlugin;exports.createBkflowSchema=e.createBkflowSchema;exports.createExecutionStatusPlugin=e.createExecutionStatusPlugin;exports.default=e.index$1;exports.exportToPipelineTree=e.exportToPipelineTree;exports.getUniformApiPluginFormValue=e.getUniformApiPluginFormValue;exports.getVariableDefaultConfig=e.getVariableDefaultConfig;exports.importFromPipelineTree=e.importFromPipelineTree;exports.isMockableNode=e.isMockableNode;exports.mergeOutputs=e.mergeOutputs;exports.normalizePluginOutputItems=e.normalizePluginOutputItems;exports.provideFilterVariableConfig=e.provideFilterVariableConfig;exports.provideFlowApiConfig=e.provideFlowApiConfig;exports.provideMemberSelectorConfig=e.provideMemberSelectorConfig;exports.provideSelectPanelConfig=e.provideSelectPanelConfig;exports.provideSelectRelatedOptionConfig=e.provideSelectRelatedOptionConfig;exports.resolveBkuiLocale=e.resolveBkuiLocale;exports.resolveExecutionActions=e.resolveExecutionActions;exports.resolveMockFormControl=e.resolveMockFormControl;exports.useFlowApiConfig=e.useFlowApiConfig;exports.useFlowEditApiConfig=e.useFlowEditApiConfig;exports.useFlowViewApiConfig=e.useFlowViewApiConfig;exports.useMemberSelectorConfig=e.useMemberSelectorConfig;exports.useSelectPanelConfig=e.useSelectPanelConfig;exports.validatePipelineTree=e.validatePipelineTree;exports.generateId=i.generateId;exports.random4=i.random4;Object.defineProperty(exports,"getLocale",{enumerable:!0,get:()=>o.getLocale});Object.defineProperty(exports,"registerMessages",{enumerable:!0,get:()=>o.registerMessages});Object.defineProperty(exports,"setLocale",{enumerable:!0,get:()=>o.setLocale});Object.defineProperty(exports,"setTranslator",{enumerable:!0,get:()=>o.setTranslator});Object.defineProperty(exports,"t",{enumerable:!0,get:()=>o.t});
package/dist/index.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import * as vue from 'vue';
2
- import { Component, ComputedRef, Ref } from 'vue';
2
+ import { Component, ComputedRef, Ref, App } from 'vue';
3
3
  import { AxiosInstance, AxiosRequestConfig } from 'axios';
4
4
  import * as _blueking_flow_canvas from '@blueking/flow-canvas';
5
5
  import { ZoomToFitOptions, CanvasUiEvent, QuickAddConfig, CanvasSchema, FlowModel, FlowNodeModel, NodeActionsConfig, ConnectionValidator, CanvasPlugin, CanvasToolbarItem, CommandEnvelope } from '@blueking/flow-canvas';
6
+ export { Locale, MessageTree, Translator, getLocale, registerMessages, setLocale, setTranslator, t } from '@blueking/flow-canvas';
7
+ import { defaultRootConfig } from 'bkui-vue/lib/config-provider';
6
8
 
7
9
  /**
8
10
  * Flow API 配置接口
@@ -68,7 +70,7 @@ declare namespace __mock_vue {
68
70
  };
69
71
  }
70
72
 
71
- type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED' | 'SKIP';
73
+ type NodeExecutionStatus = 'CREATED' | 'RUNNING' | 'FINISHED' | 'FAILED' | 'SUSPENDED' | 'REVOKED' | 'INVALID' | 'SKIP';
72
74
  type ExecutionNodeAction = 'retry' | 'skip' | 'resume' | 'approve' | 'forceFail' | 'gatewaySkip';
73
75
  interface NodeExecutionState {
74
76
  status: NodeExecutionStatus;
@@ -1106,9 +1108,13 @@ interface DebugConditionResult {
1106
1108
  }
1107
1109
  interface DebugContextNode {
1108
1110
  node_id: string;
1111
+ /** 节点显示名称;后端逐步补齐,旧版本可能缺失。 */
1112
+ node_name?: string;
1109
1113
  node_type: string;
1110
1114
  execution_mode: DebugExecutionMode;
1111
1115
  status: DebugNodeStatus;
1116
+ /** 节点配置变更后,已有调试结果是否失效。 */
1117
+ config_changed?: boolean;
1112
1118
  can_step: boolean;
1113
1119
  missing_vars: DebugMissingVar[];
1114
1120
  waiting_reason?: string | null;
@@ -1132,6 +1138,26 @@ interface DebugContextNode {
1132
1138
  /** 条件网关每个分支的表达式与命中结果。 */
1133
1139
  condition_results?: DebugConditionResult[];
1134
1140
  }
1141
+ interface DebugSnapshotNode {
1142
+ node_id: string;
1143
+ node_name: string;
1144
+ node_type: string;
1145
+ execution_mode: DebugExecutionMode;
1146
+ status: DebugNodeStatus;
1147
+ waiting_reason?: string | null;
1148
+ inputs: Record<string, unknown>;
1149
+ outputs: Record<string, unknown>;
1150
+ duration_ms?: number | null;
1151
+ error_detail?: DebugErrorDetail | string | null;
1152
+ log_ref?: DebugContextNode['log_ref'];
1153
+ operator: string;
1154
+ last_run_at?: string | null;
1155
+ config_changed: boolean;
1156
+ node_deleted: boolean;
1157
+ }
1158
+ interface DebugSnapshot {
1159
+ nodes: DebugSnapshotNode[];
1160
+ }
1135
1161
  /**
1136
1162
  * /debug_context/ 顶层结构。
1137
1163
  *
@@ -1155,6 +1181,7 @@ interface DebugContext {
1155
1181
  global_vars: Record<string, unknown>;
1156
1182
  missing_vars?: DebugMissingVar[];
1157
1183
  nodes: DebugContextNode[];
1184
+ debug_snapshot: DebugSnapshot | null;
1158
1185
  }
1159
1186
  interface DebugInputSchemaField {
1160
1187
  key: string;
@@ -1251,6 +1278,45 @@ interface DebugApiServices {
1251
1278
  resetDebugResult(params: ResetDebugResultParams): Promise<DebugResetResult>;
1252
1279
  }
1253
1280
 
1281
+ /** 版本列表条目。列表接口不返回 pipeline_tree,取流程内容要走 preview_task_tree。 */
1282
+ interface FlowVersionSnapshot {
1283
+ id: number;
1284
+ template_id: number;
1285
+ /** 草稿行为 null;已发布行为 semver 字符串 */
1286
+ version: string | null;
1287
+ desc: string | null;
1288
+ draft: boolean;
1289
+ creator: string;
1290
+ operator: string;
1291
+ /** pipeline 内容指纹 */
1292
+ md5sum: string;
1293
+ create_time: string;
1294
+ update_time: string;
1295
+ }
1296
+ interface FlowVersionListResult {
1297
+ count: number;
1298
+ results: FlowVersionSnapshot[];
1299
+ }
1300
+ interface ReleaseFlowVersionParams {
1301
+ version: string;
1302
+ desc?: string;
1303
+ }
1304
+ interface RollbackFlowVersionParams {
1305
+ version: string;
1306
+ }
1307
+ interface FlowVersionApiServices {
1308
+ /** 版本列表。固定以 limit=-1 请求全量,不做分页 UI */
1309
+ fetchFlowVersionList: (templateId: string) => Promise<FlowVersionListResult>;
1310
+ /** 计算下一个建议版本号。基于当前线上版本 bump,无历史版本时返回 1.0.0 */
1311
+ calculateNextFlowVersion: (templateId: string) => Promise<{
1312
+ version: string;
1313
+ }>;
1314
+ /** 发布上线。作用于 DB 里的草稿行,调用前必须确保草稿已落库 */
1315
+ releaseFlowVersion: (templateId: string, params: ReleaseFlowVersionParams) => Promise<FlowTemplate>;
1316
+ /** 把历史版本加载至草稿,会覆盖当前草稿内容 */
1317
+ rollbackFlowVersion: (templateId: string, params: RollbackFlowVersionParams) => Promise<unknown>;
1318
+ }
1319
+
1254
1320
  interface DrawPipelineParams {
1255
1321
  pipeline_tree: PipelineTree;
1256
1322
  canvas_width: number;
@@ -1331,6 +1397,8 @@ interface FlowTaskDetail {
1331
1397
  id: number | string;
1332
1398
  template_id: number;
1333
1399
  pipeline_tree: PipelineTree;
1400
+ /** 调试任务执行人。 */
1401
+ executor?: string;
1334
1402
  /** 任务已耗时(秒),调试摘要弹层刷新恢复用。 */
1335
1403
  elapsed_time?: number;
1336
1404
  [key: string]: unknown;
@@ -1508,7 +1576,7 @@ interface FlowEditApiConfig extends FlowViewApiConfig {
1508
1576
  fetchTaskNodeLog?: (params: FetchTaskNodeLogParams) => Promise<unknown>;
1509
1577
  getFlowTaskDetail?: (params: GetFlowTaskDetailParams) => Promise<FlowTaskDetail>;
1510
1578
  }
1511
- interface FlowDetailApiConfig extends FlowEditApiConfig, Partial<DebugApiServices> {
1579
+ interface FlowDetailApiConfig extends FlowEditApiConfig, Partial<DebugApiServices>, Partial<FlowVersionApiServices> {
1512
1580
  }
1513
1581
 
1514
1582
  /**
@@ -2104,6 +2172,13 @@ type __VLS_Props$1 = {
2104
2172
  permissions?: Partial<FlowDetailPermissions>;
2105
2173
  enableVersion?: boolean;
2106
2174
  flowVersion?: string;
2175
+ /**
2176
+ * 是否启用版本管理 UI(头部版本选择器 + 版本历史 + 发布 + 回滚),默认 false。
2177
+ *
2178
+ * 开启即隐含 `enableVersion` 的数据加载语义(草稿/指定版本读取),消费方只需传这一个。
2179
+ * 组件无法自检空间的 flow_versioning 开关,由消费方保证只在开启版本管理的空间传 true。
2180
+ */
2181
+ enableVersionManagement?: boolean;
2107
2182
  defaultZoom?: number;
2108
2183
  bkflowSaasUrl?: string;
2109
2184
  enableThirdPlugin?: boolean;
@@ -2136,18 +2211,21 @@ declare const __VLS_base$1: vue.DefineComponent<__VLS_Props$1, {
2136
2211
  saveSuccess: () => any;
2137
2212
  createVariable: (payload: CreateVariablePayload) => any;
2138
2213
  executeSuccess: (result: FlowTaskExecuteSuccessResult) => any;
2214
+ "update:flowVersion": (version: string | undefined) => any;
2139
2215
  }, string, vue.PublicProps, Readonly<__VLS_Props$1> & Readonly<{
2140
2216
  onBack?: (() => any) | undefined;
2141
2217
  onSave?: ((flowData: FlowTemplate) => any) | undefined;
2142
2218
  onSaveSuccess?: (() => any) | undefined;
2143
2219
  onCreateVariable?: ((payload: CreateVariablePayload) => any) | undefined;
2144
2220
  onExecuteSuccess?: ((result: FlowTaskExecuteSuccessResult) => any) | undefined;
2221
+ "onUpdate:flowVersion"?: ((version: string | undefined) => any) | undefined;
2145
2222
  }>, {
2146
2223
  quickAdd: QuickAddConfig;
2147
2224
  enableThirdPlugin: boolean;
2148
2225
  hideTrigger: boolean;
2149
2226
  defaultZoom: number;
2150
2227
  enableVersion: boolean;
2228
+ enableVersionManagement: boolean;
2151
2229
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
2152
2230
  declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base$1, __VLS_Slots$1>;
2153
2231
  declare const _default$2: typeof __VLS_export$1;
@@ -2469,6 +2547,28 @@ declare function createExecutionStatusPlugin(stateRef: Ref<TaskExecutionStates>)
2469
2547
  */
2470
2548
  declare function resolveExecutionActions(state: NodeExecutionState | undefined, nodeType: string): ExecutionNodeAction[];
2471
2549
 
2550
+ type BkuiLocale = typeof defaultRootConfig.locale;
2551
+ /** 取当前语言对应的 bkui-vue 语言包;消费方注册的第三语言从 registry 取。 */
2552
+ declare function resolveBkuiLocale(locale: string): BkuiLocale | undefined;
2553
+ /**
2554
+ * 顶层 Flow 组件 setup 内调用:在本组件子树内应用语言(含 Teleport 弹层),
2555
+ * 并改写 defaultRootConfig 覆盖脱离组件树的命令式 Message / InfoBox。
2556
+ *
2557
+ * 约束 1:必须先读 useGlobalConfig() 再合并。provideGlobalConfig 内部是
2558
+ * merge(defaultRootConfig, config),直接传 { locale } 会拿 defaultRootConfig.prefix
2559
+ * 覆盖宿主自定义的 prefix。
2560
+ * 约束 2:zh-cn 时整段跳过,保证现有消费方零行为变化,也不会把已设为英文的宿主拽回中文。
2561
+ * 代价是不会把 defaultRootConfig 改回中文——语言切换本就要求宿主刷新页面。
2562
+ *
2563
+ * 注意 defaultRootConfig 是 bkui-vue 的模块级单例,这一行的**影响范围是整个宿主应用**,
2564
+ * 不限于本组件子树:宿主在别处调用的 bkui-vue 命令式弹窗语言也会随之变化。
2565
+ * 这是覆盖命令式组件的唯一手段(它们没有组件上下文可供 inject),已在
2566
+ * docs/usage.md「对宿主 bkui-vue 全局配置的影响」中对消费方说明。
2567
+ */
2568
+ declare function applyBkuiLocaleToTree(): void;
2569
+ /** 自建 createApp 调用:该 app 脱离宿主 provide 链,从 defaultRootConfig 起步合并。 */
2570
+ declare function applyBkuiLocale(app: App): void;
2571
+
2472
2572
  declare const _default: {
2473
2573
  FlowView: () => Promise<typeof __view_vue>;
2474
2574
  FlowEdit: () => Promise<typeof __edit_vue>;
@@ -2482,5 +2582,5 @@ declare const _default: {
2482
2582
  FlowMockDebug: () => Promise<typeof __mock_vue>;
2483
2583
  };
2484
2584
 
2485
- 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, provideSelectRelatedOptionConfig, random4, resolveExecutionActions, resolveMockFormControl, useFlowApiConfig, useFlowEditApiConfig, useFlowViewApiConfig, useMemberSelectorConfig, useSelectPanelConfig, validatePipelineTree };
2585
+ 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, applyBkuiLocale, applyBkuiLocaleToTree, bkflowConnectionValidator, createBkflowPlugin, createBkflowSchema, createExecutionStatusPlugin, _default as default, exportToPipelineTree, generateId, getUniformApiPluginFormValue, getVariableDefaultConfig, importFromPipelineTree, isMockableNode, mergeOutputs, normalizePluginOutputItems, provideFilterVariableConfig, provideFlowApiConfig, provideMemberSelectorConfig, provideSelectPanelConfig, provideSelectRelatedOptionConfig, random4, resolveBkuiLocale, resolveExecutionActions, resolveMockFormControl, useFlowApiConfig, useFlowEditApiConfig, useFlowViewApiConfig, useMemberSelectorConfig, useSelectPanelConfig, validatePipelineTree };
2486
2586
  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, SelectRelatedOptionConfig, SelectRelatedOptionItem, SelectRelatedOptionSource, SelectRelatedOptionSourceRef, SelectRelatedSourceContext, SimulateDebugCanvasContext, SimulateDebugStage, SimulateDebugState, SpaceFlowConfig, TaskExecutionStates, TemplateConfigs, TriggerCron, TriggerItem, UniformApiPluginInputsItem, UpdateFlowParams, Variable, VariableReference };
package/dist/index.esm.js CHANGED
@@ -1,41 +1,50 @@
1
- import { v as o, w as s, x as i, F as l, y as r, z as t, A as n, G as u, H as g, I as c, J as p, K as w, N as f, O as F, P as d, Q as m, T as C, U as k, V as v, W as P, m as A, X as b, Y as x, Z as S, $ as V, a0 as M, a1 as T, a2 as B, r as E, u as D, a3 as O, a4 as I, a5 as N, a6 as z, a7 as U } from "./index-Bqm08e7H.js";
2
- import { g as y, e as G } from "./context-Bg6nsbrK.js";
1
+ import { z as o, A as s, F as l, G as i, H as r, I as t, J as n, K as c, N as u, O as g, P as p, Q as f, S as w, T as F, U as d, V as m, W as C, X as k, Y as v, Z as P, $ as b, a0 as A, m as T, a1 as B, a2 as S, a3 as x, a4 as M, a5 as V, a6 as E, a7 as L, a8 as D, r as O, u as I, a9 as N, aa as y, ab as z, ac as U, ad as h } from "./index-CgRqOi-E.js";
2
+ import { g as H, e as J } from "./context-Bu4mmo1Q.js";
3
+ import { getLocale as Q, registerMessages as R, setLocale as W, setTranslator as X, t as Y } from "@blueking/flow-canvas";
3
4
  export {
4
5
  o as BkFlowCanvas,
5
6
  s as BkFlowModelAccessor,
6
- i as BkFlowNodeAccessor,
7
- l as FlowCreateTask,
7
+ l as BkFlowNodeAccessor,
8
+ i as FlowCreateTask,
8
9
  r as FlowDebug,
9
10
  t as FlowDetail,
10
11
  n as FlowEdit,
11
- u as FlowExecute,
12
- g as FlowMockDebug,
13
- c as FlowView,
14
- p as bkflowConnectionValidator,
15
- w as createBkflowPlugin,
16
- f as createBkflowSchema,
17
- F as createExecutionStatusPlugin,
18
- d as default,
19
- m as exportToPipelineTree,
20
- y as generateId,
21
- C as getUniformApiPluginFormValue,
22
- k as getVariableDefaultConfig,
23
- v as importFromPipelineTree,
24
- P as isMockableNode,
25
- A as mergeOutputs,
26
- b as normalizePluginOutputItems,
27
- x as provideFilterVariableConfig,
28
- S as provideFlowApiConfig,
29
- V as provideMemberSelectorConfig,
30
- M as provideSelectPanelConfig,
31
- T as provideSelectRelatedOptionConfig,
32
- G as random4,
33
- B as resolveExecutionActions,
34
- E as resolveMockFormControl,
35
- D as useFlowApiConfig,
36
- O as useFlowEditApiConfig,
37
- I as useFlowViewApiConfig,
38
- N as useMemberSelectorConfig,
39
- z as useSelectPanelConfig,
40
- U as validatePipelineTree
12
+ c as FlowExecute,
13
+ u as FlowMockDebug,
14
+ g as FlowView,
15
+ p as applyBkuiLocale,
16
+ f as applyBkuiLocaleToTree,
17
+ w as bkflowConnectionValidator,
18
+ F as createBkflowPlugin,
19
+ d as createBkflowSchema,
20
+ m as createExecutionStatusPlugin,
21
+ C as default,
22
+ k as exportToPipelineTree,
23
+ H as generateId,
24
+ Q as getLocale,
25
+ v as getUniformApiPluginFormValue,
26
+ P as getVariableDefaultConfig,
27
+ b as importFromPipelineTree,
28
+ A as isMockableNode,
29
+ T as mergeOutputs,
30
+ B as normalizePluginOutputItems,
31
+ S as provideFilterVariableConfig,
32
+ x as provideFlowApiConfig,
33
+ M as provideMemberSelectorConfig,
34
+ V as provideSelectPanelConfig,
35
+ E as provideSelectRelatedOptionConfig,
36
+ J as random4,
37
+ R as registerMessages,
38
+ L as resolveBkuiLocale,
39
+ D as resolveExecutionActions,
40
+ O as resolveMockFormControl,
41
+ W as setLocale,
42
+ X as setTranslator,
43
+ Y as t,
44
+ I as useFlowApiConfig,
45
+ N as useFlowEditApiConfig,
46
+ y as useFlowViewApiConfig,
47
+ z as useMemberSelectorConfig,
48
+ U as useSelectPanelConfig,
49
+ h as validatePipelineTree
41
50
  };