Flowfile 0.3.3.1__py3-none-any.whl → 0.3.4__py3-none-any.whl
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.
Potentially problematic release.
This version of Flowfile might be problematic. Click here for more details.
- flowfile/__init__.py +2 -2
- flowfile/__main__.py +0 -2
- flowfile/api.py +94 -46
- flowfile/web/__init__.py +4 -1
- flowfile/web/static/assets/{AirbyteReader-2b1cf2d8.js → AirbyteReader-e08044e5.js} +8 -8
- flowfile/web/static/assets/{CrossJoin-cc3ab73c.js → CrossJoin-dfcf7351.js} +8 -8
- flowfile/web/static/assets/{DatabaseConnectionSettings-307c4652.js → DatabaseConnectionSettings-b2afb1d7.js} +2 -2
- flowfile/web/static/assets/{DatabaseManager-69faa6e1.js → DatabaseManager-824a49b2.js} +2 -2
- flowfile/web/static/assets/{DatabaseReader-e4134cd0.js → DatabaseReader-a48124d8.js} +9 -9
- flowfile/web/static/assets/{DatabaseWriter-d32d75b1.js → DatabaseWriter-b47cbae2.js} +9 -9
- flowfile/web/static/assets/{ExploreData-5eb48389.js → ExploreData-fdfc45a4.js} +5 -5
- flowfile/web/static/assets/{ExternalSource-29489051.js → ExternalSource-861b0e71.js} +6 -6
- flowfile/web/static/assets/{Filter-031332bb.js → Filter-f87bb897.js} +8 -9
- flowfile/web/static/assets/{Formula-3b900540.js → Formula-1e2ed720.js} +9 -10
- flowfile/web/static/assets/{FuzzyMatch-dee31153.js → FuzzyMatch-b6cc4fdd.js} +9 -9
- flowfile/web/static/assets/{GraphSolver-ca74eb47.js → GraphSolver-6a371f4c.js} +5 -5
- flowfile/web/static/assets/{GroupBy-081b6591.js → GroupBy-f7b7f472.js} +6 -6
- flowfile/web/static/assets/{Join-b467376f.js → Join-eec38203.js} +9 -9
- flowfile/web/static/assets/{ManualInput-ffffb80a.js → ManualInput-9aaa46fb.js} +5 -5
- flowfile/web/static/assets/{Output-9a87d4ba.js → Output-3b2ca045.js} +4 -4
- flowfile/web/static/assets/{Pivot-ee3e6093.js → Pivot-a4f5d88f.js} +6 -6
- flowfile/web/static/assets/PolarsCode-49ce444f.js +306 -0
- flowfile/web/static/assets/{Read-67fee3a0.js → Read-07acdc9a.js} +6 -6
- flowfile/web/static/assets/{RecordCount-a2acd02d.js → RecordCount-6a21da56.js} +5 -5
- flowfile/web/static/assets/{RecordId-0c8bcd77.js → RecordId-949bdc17.js} +6 -6
- flowfile/web/static/assets/{Sample-60594a3a.js → Sample-7afca6e1.js} +5 -5
- flowfile/web/static/assets/{SecretManager-bbcec2ac.js → SecretManager-b41c029d.js} +2 -2
- flowfile/web/static/assets/{Select-9540e6ca.js → Select-32b28406.js} +8 -8
- flowfile/web/static/assets/{SettingsSection-48f28104.js → SettingsSection-a0f15a05.js} +1 -1
- flowfile/web/static/assets/{Sort-6dbe3633.js → Sort-fc6ba0e2.js} +6 -6
- flowfile/web/static/assets/{TextToRows-27aab4a8.js → TextToRows-23127596.js} +8 -8
- flowfile/web/static/assets/{UnavailableFields-8143044b.js → UnavailableFields-c42880a3.js} +2 -2
- flowfile/web/static/assets/{Union-52460248.js → Union-39eecc6c.js} +5 -5
- flowfile/web/static/assets/{Unique-f6962644.js → Unique-a0e8fe61.js} +8 -8
- flowfile/web/static/assets/{Unpivot-1ff1e938.js → Unpivot-1e2d43f0.js} +5 -5
- flowfile/web/static/assets/{api-3b345d92.js → api-44ca9e9c.js} +1 -1
- flowfile/web/static/assets/{designer-2394122a.css → designer-186f2e71.css} +64 -9
- flowfile/web/static/assets/{designer-4736134f.js → designer-267d44f1.js} +2835 -105
- flowfile/web/static/assets/{documentation-b9545eba.js → documentation-6c0810a2.js} +1 -1
- flowfile/web/static/assets/{dropDown-d5a4014c.js → dropDown-52790b15.js} +1 -1
- flowfile/web/static/assets/{dropDownGeneric-1f4e32ec.js → dropDownGeneric-60f56a8a.js} +2 -2
- flowfile/web/static/assets/{fullEditor-f4791c23.js → fullEditor-e272b506.js} +2 -3
- flowfile/web/static/assets/{genericNodeSettings-1d456350.js → genericNodeSettings-4bdcf98e.js} +3 -3
- flowfile/web/static/assets/{index-f25c9283.js → index-e235a8bc.js} +12 -12
- flowfile/web/static/assets/{nodeTitle-cad6fd9d.js → nodeTitle-fc3fc4b7.js} +3 -3
- flowfile/web/static/assets/{secretApi-01f07e2c.js → secretApi-cdc2a3fd.js} +1 -1
- flowfile/web/static/assets/{selectDynamic-f46a4e3f.js → selectDynamic-96aa82cd.js} +3 -3
- flowfile/web/static/assets/{vue-codemirror.esm-eb98fc8b.js → vue-codemirror.esm-25e75a08.js} +610 -29
- flowfile/web/static/assets/{vue-content-loader.es-860c0380.js → vue-content-loader.es-6c4b1c24.js} +1 -1
- flowfile/web/static/index.html +1 -1
- {flowfile-0.3.3.1.dist-info → flowfile-0.3.4.dist-info}/METADATA +16 -3
- {flowfile-0.3.3.1.dist-info → flowfile-0.3.4.dist-info}/RECORD +74 -74
- flowfile_core/flowfile/code_generator/__init__.py +0 -0
- flowfile_core/flowfile/code_generator/code_generator.py +723 -0
- flowfile_core/flowfile/flow_data_engine/flow_data_engine.py +1 -1
- flowfile_core/flowfile/flow_data_engine/flow_file_column/main.py +1 -1
- flowfile_core/flowfile/{FlowfileFlow.py → flow_graph.py} +3 -3
- flowfile_core/flowfile/flow_graph_utils.py +1 -1
- flowfile_core/flowfile/handler.py +1 -1
- flowfile_core/flowfile/manage/open_flowfile.py +1 -1
- flowfile_core/flowfile/util/calculate_layout.py +1 -1
- flowfile_core/routes/routes.py +11 -1
- flowfile_core/schemas/input_schema.py +2 -1
- flowfile_frame/adapters.py +1 -1
- flowfile_frame/expr.py +19 -0
- flowfile_frame/flow_frame.py +1 -4
- flowfile_frame/flow_frame.pyi +1 -1
- flowfile_frame/flow_frame_methods.py +1 -1
- flowfile_frame/lazy.py +1 -1
- flowfile_frame/utils.py +1 -1
- flowfile/readme.md +0 -127
- flowfile/web/static/assets/PolarsCode-03921254.js +0 -2865
- flowfile/web/static/assets/PopOver-3bdf8951.js +0 -577
- /flowfile/web/static/assets/{PopOver-bccfde04.css → vue-codemirror-bccfde04.css} +0 -0
- {flowfile-0.3.3.1.dist-info → flowfile-0.3.4.dist-info}/LICENSE +0 -0
- {flowfile-0.3.3.1.dist-info → flowfile-0.3.4.dist-info}/WHEEL +0 -0
- {flowfile-0.3.3.1.dist-info → flowfile-0.3.4.dist-info}/entry_points.txt +0 -0
|
@@ -1,577 +0,0 @@
|
|
|
1
|
-
import { r as ref, j as defineStore, a as axios, d as defineComponent, ae as useCssVars, n as onMounted, c as openBlock, e as createElementBlock, p as createBaseVNode, L as renderSlot, h as createBlock, t as toDisplayString, i as createCommentVNode, T as normalizeStyle, s as normalizeClass, a7 as Teleport, R as nextTick, _ as _export_sfc } from "./index-f25c9283.js";
|
|
2
|
-
const FLOW_ID_STORAGE_KEY = "last_flow_id";
|
|
3
|
-
ref(null);
|
|
4
|
-
const getDownstreamNodeIds = async (flow_id, node_id) => {
|
|
5
|
-
const response = await axios.get("/node/downstream_node_ids", {
|
|
6
|
-
params: { flow_id, node_id },
|
|
7
|
-
headers: { accept: "application/json" }
|
|
8
|
-
});
|
|
9
|
-
return response.data;
|
|
10
|
-
};
|
|
11
|
-
const loadDownstreamNodeIds = async (flowId, nodeId) => {
|
|
12
|
-
const downstreamNodeIds = await getDownstreamNodeIds(flowId, nodeId);
|
|
13
|
-
return downstreamNodeIds;
|
|
14
|
-
};
|
|
15
|
-
const useNodeStore = defineStore("node", {
|
|
16
|
-
state: () => {
|
|
17
|
-
const savedFlowId = sessionStorage.getItem(FLOW_ID_STORAGE_KEY);
|
|
18
|
-
const initialFlowId = savedFlowId ? parseInt(savedFlowId) : -1;
|
|
19
|
-
return {
|
|
20
|
-
inputCode: "",
|
|
21
|
-
flow_id: initialFlowId,
|
|
22
|
-
node_id: -1,
|
|
23
|
-
previous_node_id: -1,
|
|
24
|
-
nodeValidateFuncs: /* @__PURE__ */ new Map(),
|
|
25
|
-
nodeData: null,
|
|
26
|
-
node_exists: false,
|
|
27
|
-
is_loaded: false,
|
|
28
|
-
size_data_preview: 300,
|
|
29
|
-
dataTypes: ["String", "Datetime", "Int64", "Int32", "Int16", "Float64", "Float32", "Boolean"],
|
|
30
|
-
isDrawerOpen: false,
|
|
31
|
-
isAnalysisOpen: false,
|
|
32
|
-
drawCloseFunction: null,
|
|
33
|
-
initialEditorData: "",
|
|
34
|
-
runResults: {},
|
|
35
|
-
nodeDescriptions: {},
|
|
36
|
-
runNodeResults: {},
|
|
37
|
-
runNodeValidations: {},
|
|
38
|
-
currentRunResult: null,
|
|
39
|
-
isRunning: false,
|
|
40
|
-
showFlowResult: false,
|
|
41
|
-
tableVisible: false,
|
|
42
|
-
resultVersion: 0,
|
|
43
|
-
vueFlowInstance: null,
|
|
44
|
-
allExpressions: null,
|
|
45
|
-
isShowingLogViewer: false,
|
|
46
|
-
isStreamingLogs: false,
|
|
47
|
-
displayLogViewer: true
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
actions: {
|
|
51
|
-
initializeResultCache(flowId) {
|
|
52
|
-
if (!this.runNodeResults[flowId]) {
|
|
53
|
-
this.runNodeResults[flowId] = {};
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
initializeValidationCache(flowId) {
|
|
57
|
-
if (!this.runNodeValidations[flowId]) {
|
|
58
|
-
this.runNodeValidations[flowId] = {};
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
setNodeResult(nodeId, result) {
|
|
62
|
-
this.initializeResultCache(this.flow_id);
|
|
63
|
-
this.runNodeResults[this.flow_id][nodeId] = result;
|
|
64
|
-
},
|
|
65
|
-
getNodeResult(nodeId) {
|
|
66
|
-
var _a;
|
|
67
|
-
return (_a = this.runNodeResults[this.flow_id]) == null ? void 0 : _a[nodeId];
|
|
68
|
-
},
|
|
69
|
-
resetNodeResult() {
|
|
70
|
-
console.log("Clearing node results");
|
|
71
|
-
this.runNodeResults = {};
|
|
72
|
-
},
|
|
73
|
-
clearFlowResults(flowId) {
|
|
74
|
-
if (this.runNodeResults[flowId]) {
|
|
75
|
-
delete this.runNodeResults[flowId];
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
setNodeValidation(nodeId, nodeValidationInput) {
|
|
79
|
-
if (typeof nodeId === "string") {
|
|
80
|
-
nodeId = parseInt(nodeId);
|
|
81
|
-
}
|
|
82
|
-
this.initializeValidationCache(this.flow_id);
|
|
83
|
-
const nodeValidation = {
|
|
84
|
-
...nodeValidationInput,
|
|
85
|
-
validationTime: Date.now() / 1e3
|
|
86
|
-
};
|
|
87
|
-
this.runNodeValidations[this.flow_id][nodeId] = nodeValidation;
|
|
88
|
-
},
|
|
89
|
-
resetNodeValidation() {
|
|
90
|
-
this.runNodeValidations = {};
|
|
91
|
-
},
|
|
92
|
-
getNodeValidation(nodeId) {
|
|
93
|
-
var _a;
|
|
94
|
-
return ((_a = this.runNodeValidations[this.flow_id]) == null ? void 0 : _a[nodeId]) || {
|
|
95
|
-
isValid: true,
|
|
96
|
-
error: "",
|
|
97
|
-
validationTime: 0
|
|
98
|
-
};
|
|
99
|
-
},
|
|
100
|
-
insertRunResult(runResult, showResult = true) {
|
|
101
|
-
this.currentRunResult = runResult;
|
|
102
|
-
this.runResults[runResult.flow_id] = runResult;
|
|
103
|
-
this.showFlowResult = showResult;
|
|
104
|
-
this.isShowingLogViewer = this.displayLogViewer && showResult;
|
|
105
|
-
this.initializeResultCache(runResult.flow_id);
|
|
106
|
-
runResult.node_step_result.forEach((nodeResult) => {
|
|
107
|
-
this.runNodeResults[runResult.flow_id][nodeResult.node_id] = nodeResult;
|
|
108
|
-
});
|
|
109
|
-
this.resultVersion++;
|
|
110
|
-
},
|
|
111
|
-
resetRunResults() {
|
|
112
|
-
this.runNodeResults = {};
|
|
113
|
-
this.runResults = {};
|
|
114
|
-
this.currentRunResult = null;
|
|
115
|
-
},
|
|
116
|
-
initializeDescriptionCache(flowId) {
|
|
117
|
-
if (!this.nodeDescriptions[flowId]) {
|
|
118
|
-
this.nodeDescriptions[flowId] = {};
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
setNodeValidateFunc(nodeId, func) {
|
|
122
|
-
if (typeof nodeId === "string") {
|
|
123
|
-
nodeId = parseInt(nodeId);
|
|
124
|
-
}
|
|
125
|
-
this.nodeValidateFuncs.set(nodeId, func);
|
|
126
|
-
},
|
|
127
|
-
async validateNode(nodeId) {
|
|
128
|
-
if (typeof nodeId === "string") {
|
|
129
|
-
nodeId = parseInt(nodeId);
|
|
130
|
-
}
|
|
131
|
-
const func = this.nodeValidateFuncs.get(nodeId);
|
|
132
|
-
if (func) {
|
|
133
|
-
func();
|
|
134
|
-
} else {
|
|
135
|
-
console.warn("No validation function found for node", nodeId);
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
setFlowId(flowId) {
|
|
139
|
-
this.flow_id = flowId;
|
|
140
|
-
try {
|
|
141
|
-
sessionStorage.setItem(FLOW_ID_STORAGE_KEY, flowId.toString());
|
|
142
|
-
} catch (error) {
|
|
143
|
-
console.warn("Failed to store flow ID in session storage:", error);
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
setVueFlowInstance(vueFlowInstance) {
|
|
147
|
-
this.vueFlowInstance = vueFlowInstance;
|
|
148
|
-
},
|
|
149
|
-
setInitialEditorData(editorDataString) {
|
|
150
|
-
this.initialEditorData = editorDataString;
|
|
151
|
-
},
|
|
152
|
-
getInitialEditorData() {
|
|
153
|
-
return this.initialEditorData;
|
|
154
|
-
},
|
|
155
|
-
cacheNodeDescriptionDict(flowId, nodeId, description) {
|
|
156
|
-
this.initializeDescriptionCache(flowId);
|
|
157
|
-
this.nodeDescriptions[flowId][nodeId] = description;
|
|
158
|
-
},
|
|
159
|
-
clearNodeDescriptionCache(flowId, nodeId) {
|
|
160
|
-
if (this.nodeDescriptions[flowId] && this.nodeDescriptions[flowId][nodeId]) {
|
|
161
|
-
delete this.nodeDescriptions[flowId][nodeId];
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
clearFlowDescriptionCache(flowId) {
|
|
165
|
-
if (this.nodeDescriptions[flowId]) {
|
|
166
|
-
delete this.nodeDescriptions[flowId];
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
clearAllDescriptionCaches() {
|
|
170
|
-
this.nodeDescriptions = {};
|
|
171
|
-
},
|
|
172
|
-
async getNodeDescription(nodeId, forceRefresh = false) {
|
|
173
|
-
var _a, _b;
|
|
174
|
-
this.initializeDescriptionCache(this.flow_id);
|
|
175
|
-
if (!forceRefresh && ((_a = this.nodeDescriptions[this.flow_id]) == null ? void 0 : _a[nodeId])) {
|
|
176
|
-
return this.nodeDescriptions[this.flow_id][nodeId];
|
|
177
|
-
}
|
|
178
|
-
try {
|
|
179
|
-
const response = await axios.get("/node/description", {
|
|
180
|
-
params: {
|
|
181
|
-
node_id: nodeId,
|
|
182
|
-
flow_id: this.flow_id
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
this.cacheNodeDescriptionDict(this.flow_id, nodeId, response.data);
|
|
186
|
-
return response.data;
|
|
187
|
-
} catch (error) {
|
|
188
|
-
console.info("Error fetching node description:", error);
|
|
189
|
-
if ((_b = this.nodeDescriptions[this.flow_id]) == null ? void 0 : _b[nodeId]) {
|
|
190
|
-
console.warn("Using cached description due to API error");
|
|
191
|
-
return this.nodeDescriptions[this.flow_id][nodeId];
|
|
192
|
-
}
|
|
193
|
-
return "";
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
async setNodeDescription(nodeId, description) {
|
|
197
|
-
try {
|
|
198
|
-
this.cacheNodeDescriptionDict(this.flow_id, nodeId, description);
|
|
199
|
-
const response = await axios.post("/node/description/", JSON.stringify(description), {
|
|
200
|
-
params: {
|
|
201
|
-
flow_id: this.flow_id,
|
|
202
|
-
node_id: nodeId
|
|
203
|
-
},
|
|
204
|
-
headers: {
|
|
205
|
-
"Content-Type": "application/json"
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
if (response.data.status === "success") {
|
|
209
|
-
console.log(response.data.message);
|
|
210
|
-
} else {
|
|
211
|
-
console.warn("Unexpected success response structure:", response.data);
|
|
212
|
-
}
|
|
213
|
-
} catch (error) {
|
|
214
|
-
if (error.response) {
|
|
215
|
-
console.error("API error:", error.response.data.message);
|
|
216
|
-
} else if (error.request) {
|
|
217
|
-
console.error("The request was made but no response was received");
|
|
218
|
-
} else {
|
|
219
|
-
console.error("Error", error.message);
|
|
220
|
-
}
|
|
221
|
-
throw error;
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
setCloseFunction(f) {
|
|
225
|
-
this.drawCloseFunction = f;
|
|
226
|
-
},
|
|
227
|
-
getSizeDataPreview() {
|
|
228
|
-
return this.size_data_preview;
|
|
229
|
-
},
|
|
230
|
-
setSizeDataPreview(newHeight) {
|
|
231
|
-
this.size_data_preview = newHeight;
|
|
232
|
-
},
|
|
233
|
-
toggleDrawer() {
|
|
234
|
-
console.log("toggleDrawer in column-store.ts");
|
|
235
|
-
if (this.isDrawerOpen && this.drawCloseFunction) {
|
|
236
|
-
this.pushNodeData();
|
|
237
|
-
}
|
|
238
|
-
this.isDrawerOpen = !this.isDrawerOpen;
|
|
239
|
-
},
|
|
240
|
-
pushNodeData() {
|
|
241
|
-
if (this.drawCloseFunction && !this.isRunning) {
|
|
242
|
-
this.drawCloseFunction();
|
|
243
|
-
this.drawCloseFunction = null;
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
openDrawer(close_function) {
|
|
247
|
-
console.log("openDrawer in column-store.ts");
|
|
248
|
-
if (this.isDrawerOpen) {
|
|
249
|
-
console.log("pushing data");
|
|
250
|
-
this.pushNodeData();
|
|
251
|
-
}
|
|
252
|
-
if (close_function) {
|
|
253
|
-
this.drawCloseFunction = close_function;
|
|
254
|
-
}
|
|
255
|
-
this.isDrawerOpen = true;
|
|
256
|
-
},
|
|
257
|
-
closeDrawer() {
|
|
258
|
-
this.isDrawerOpen = false;
|
|
259
|
-
if (this.drawCloseFunction) {
|
|
260
|
-
this.pushNodeData();
|
|
261
|
-
}
|
|
262
|
-
this.node_id = -1;
|
|
263
|
-
},
|
|
264
|
-
openAnalysisDrawer(close_function) {
|
|
265
|
-
console.log("openAnalysisDrawer in column-store.ts");
|
|
266
|
-
if (this.isAnalysisOpen) {
|
|
267
|
-
this.pushNodeData();
|
|
268
|
-
}
|
|
269
|
-
if (close_function) {
|
|
270
|
-
this.drawCloseFunction = close_function;
|
|
271
|
-
}
|
|
272
|
-
this.isAnalysisOpen = true;
|
|
273
|
-
},
|
|
274
|
-
closeAnalysisDrawer() {
|
|
275
|
-
this.isAnalysisOpen = false;
|
|
276
|
-
if (this.drawCloseFunction) {
|
|
277
|
-
console.log("closeDrawer in column-store.ts");
|
|
278
|
-
this.pushNodeData();
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
getDataTypes() {
|
|
282
|
-
return this.dataTypes;
|
|
283
|
-
},
|
|
284
|
-
setInputCode(newCode) {
|
|
285
|
-
this.inputCode = newCode;
|
|
286
|
-
},
|
|
287
|
-
showLogViewer() {
|
|
288
|
-
console.log("triggered show log viewer");
|
|
289
|
-
this.isShowingLogViewer = this.displayLogViewer;
|
|
290
|
-
},
|
|
291
|
-
hideLogViewer() {
|
|
292
|
-
this.isShowingLogViewer = false;
|
|
293
|
-
},
|
|
294
|
-
toggleLogViewer() {
|
|
295
|
-
console.log("triggered toggle log viewer");
|
|
296
|
-
this.isShowingLogViewer = !this.isShowingLogViewer;
|
|
297
|
-
},
|
|
298
|
-
getRunResult(flow_id) {
|
|
299
|
-
return this.runResults[flow_id] || null;
|
|
300
|
-
},
|
|
301
|
-
async getTableExample(flow_id, node_id) {
|
|
302
|
-
try {
|
|
303
|
-
const response = await axios.get("/node/data", {
|
|
304
|
-
params: { flow_id, node_id },
|
|
305
|
-
headers: { accept: "application/json" }
|
|
306
|
-
});
|
|
307
|
-
return response.data;
|
|
308
|
-
} catch (error) {
|
|
309
|
-
console.error("Error fetching table example:", error);
|
|
310
|
-
return null;
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
async getNodeData(node_id, useCache = true) {
|
|
314
|
-
if (this.node_id === node_id && useCache) {
|
|
315
|
-
if (this.nodeData) {
|
|
316
|
-
this.is_loaded = true;
|
|
317
|
-
return this.nodeData;
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
try {
|
|
321
|
-
this.setFlowIdAndNodeId(this.flow_id, node_id);
|
|
322
|
-
const response = await axios.get("/node", {
|
|
323
|
-
params: { flow_id: this.flow_id, node_id: this.node_id },
|
|
324
|
-
headers: { accept: "application/json" }
|
|
325
|
-
});
|
|
326
|
-
this.nodeData = response.data;
|
|
327
|
-
this.is_loaded = true;
|
|
328
|
-
this.node_exists = true;
|
|
329
|
-
return this.nodeData;
|
|
330
|
-
} catch (error) {
|
|
331
|
-
console.error("Error fetching node data:", error);
|
|
332
|
-
this.nodeData = null;
|
|
333
|
-
this.is_loaded = false;
|
|
334
|
-
this.node_exists = false;
|
|
335
|
-
return null;
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
async reloadCurrentNodeData() {
|
|
339
|
-
return this.getNodeData(this.node_id, false);
|
|
340
|
-
},
|
|
341
|
-
setFlowIdAndNodeId(flow_id, node_id) {
|
|
342
|
-
if (this.node_id === node_id && this.flow_id === flow_id) {
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
console.log("Automatically pushing the node data ");
|
|
346
|
-
this.pushNodeData();
|
|
347
|
-
this.previous_node_id = this.node_id;
|
|
348
|
-
if (this.flow_id !== flow_id) {
|
|
349
|
-
this.setFlowId(flow_id);
|
|
350
|
-
}
|
|
351
|
-
this.node_id = node_id;
|
|
352
|
-
},
|
|
353
|
-
getCurrentNodeData() {
|
|
354
|
-
return this.nodeData;
|
|
355
|
-
},
|
|
356
|
-
doReset() {
|
|
357
|
-
this.is_loaded = false;
|
|
358
|
-
},
|
|
359
|
-
getVueFlowInstance() {
|
|
360
|
-
return this.vueFlowInstance;
|
|
361
|
-
},
|
|
362
|
-
getEditorNodeData() {
|
|
363
|
-
var _a;
|
|
364
|
-
if (this.node_id) {
|
|
365
|
-
return (_a = this.vueFlowInstance) == null ? void 0 : _a.findNode(String(this.node_id));
|
|
366
|
-
}
|
|
367
|
-
return null;
|
|
368
|
-
},
|
|
369
|
-
async fetchExpressionsOverview() {
|
|
370
|
-
try {
|
|
371
|
-
const response = await axios.get("/editor/expression_doc");
|
|
372
|
-
this.allExpressions = response.data;
|
|
373
|
-
return this.allExpressions;
|
|
374
|
-
} catch (error) {
|
|
375
|
-
console.error("Error fetching expressions overview:", error);
|
|
376
|
-
return [];
|
|
377
|
-
}
|
|
378
|
-
},
|
|
379
|
-
async getExpressionsOverview() {
|
|
380
|
-
if (this.allExpressions) {
|
|
381
|
-
return this.allExpressions;
|
|
382
|
-
} else {
|
|
383
|
-
return await this.fetchExpressionsOverview();
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
async updateSettingsDirectly(inputData) {
|
|
387
|
-
var _a, _b;
|
|
388
|
-
try {
|
|
389
|
-
const node = (_a = this.vueFlowInstance) == null ? void 0 : _a.findNode(String(this.node_id));
|
|
390
|
-
inputData.pos_x = node.position.x;
|
|
391
|
-
inputData.pos_y = node.position.y;
|
|
392
|
-
console.log("updating settings");
|
|
393
|
-
console.log("node", node);
|
|
394
|
-
const response = await axios.post("/update_settings/", inputData, {
|
|
395
|
-
params: {
|
|
396
|
-
node_type: node.data.component.__name
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
const downstreamNodeIds = await loadDownstreamNodeIds(this.flow_id, inputData.node_id);
|
|
400
|
-
downstreamNodeIds.map((nodeId) => {
|
|
401
|
-
this.validateNode(nodeId);
|
|
402
|
-
});
|
|
403
|
-
return response.data;
|
|
404
|
-
} catch (error) {
|
|
405
|
-
console.error("Error updating settings:", (_b = error.response) == null ? void 0 : _b.data);
|
|
406
|
-
throw error;
|
|
407
|
-
}
|
|
408
|
-
},
|
|
409
|
-
async updateSettings(inputData) {
|
|
410
|
-
var _a, _b;
|
|
411
|
-
try {
|
|
412
|
-
const node = (_a = this.vueFlowInstance) == null ? void 0 : _a.findNode(String(this.node_id));
|
|
413
|
-
inputData.value.pos_x = node.position.x;
|
|
414
|
-
inputData.value.pos_y = node.position.y;
|
|
415
|
-
console.log("updating settings");
|
|
416
|
-
console.log("node", node);
|
|
417
|
-
const response = await axios.post("/update_settings/", inputData.value, {
|
|
418
|
-
params: {
|
|
419
|
-
node_type: node.data.component.__name
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
const downstreamNodeIds = await loadDownstreamNodeIds(
|
|
423
|
-
this.flow_id,
|
|
424
|
-
inputData.value.node_id
|
|
425
|
-
);
|
|
426
|
-
downstreamNodeIds.map((nodeId) => {
|
|
427
|
-
this.validateNode(nodeId);
|
|
428
|
-
});
|
|
429
|
-
return response.data;
|
|
430
|
-
} catch (error) {
|
|
431
|
-
console.error("Error updating settings:", (_b = error.response) == null ? void 0 : _b.data);
|
|
432
|
-
throw error;
|
|
433
|
-
}
|
|
434
|
-
},
|
|
435
|
-
updateNodeDescription(nodeId, description) {
|
|
436
|
-
this.cacheNodeDescriptionDict(this.flow_id, nodeId, description);
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
const _hoisted_1 = { class: "popover-container" };
|
|
441
|
-
const _hoisted_2 = { key: 0 };
|
|
442
|
-
const _hoisted_3 = ["innerHTML"];
|
|
443
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
444
|
-
__name: "PopOver",
|
|
445
|
-
props: {
|
|
446
|
-
content: {
|
|
447
|
-
type: String,
|
|
448
|
-
required: true
|
|
449
|
-
},
|
|
450
|
-
title: {
|
|
451
|
-
type: String,
|
|
452
|
-
default: ""
|
|
453
|
-
},
|
|
454
|
-
placement: {
|
|
455
|
-
type: String,
|
|
456
|
-
default: "top"
|
|
457
|
-
},
|
|
458
|
-
minWidth: {
|
|
459
|
-
type: Number,
|
|
460
|
-
default: 100
|
|
461
|
-
},
|
|
462
|
-
zIndex: {
|
|
463
|
-
type: Number,
|
|
464
|
-
default: 9999
|
|
465
|
-
}
|
|
466
|
-
},
|
|
467
|
-
setup(__props) {
|
|
468
|
-
useCssVars((_ctx) => ({
|
|
469
|
-
"64450ce2": props.minWidth + "px"
|
|
470
|
-
}));
|
|
471
|
-
const visible = ref(false);
|
|
472
|
-
const referenceEl = ref(null);
|
|
473
|
-
const popoverEl = ref(null);
|
|
474
|
-
const props = __props;
|
|
475
|
-
const popoverStyle = ref({
|
|
476
|
-
top: "0px",
|
|
477
|
-
left: "0px",
|
|
478
|
-
zIndex: props.zIndex.toString()
|
|
479
|
-
});
|
|
480
|
-
const showPopover = () => {
|
|
481
|
-
visible.value = true;
|
|
482
|
-
nextTick(() => {
|
|
483
|
-
updatePosition();
|
|
484
|
-
});
|
|
485
|
-
};
|
|
486
|
-
const hidePopover = () => {
|
|
487
|
-
visible.value = false;
|
|
488
|
-
};
|
|
489
|
-
const updatePosition = () => {
|
|
490
|
-
if (!referenceEl.value || !popoverEl.value)
|
|
491
|
-
return;
|
|
492
|
-
const referenceRect = referenceEl.value.getBoundingClientRect();
|
|
493
|
-
const popoverRect = popoverEl.value.getBoundingClientRect();
|
|
494
|
-
const offset = 20;
|
|
495
|
-
let top = 0;
|
|
496
|
-
let left = 0;
|
|
497
|
-
switch (props.placement) {
|
|
498
|
-
case "top":
|
|
499
|
-
top = referenceRect.top - popoverRect.height - offset;
|
|
500
|
-
left = referenceRect.left + referenceRect.width / 2 - popoverRect.width / 2;
|
|
501
|
-
break;
|
|
502
|
-
case "bottom":
|
|
503
|
-
top = referenceRect.bottom + offset;
|
|
504
|
-
left = referenceRect.left + referenceRect.width / 2 - popoverRect.width / 2;
|
|
505
|
-
break;
|
|
506
|
-
case "left":
|
|
507
|
-
top = referenceRect.top + referenceRect.height / 2 - popoverRect.height / 2;
|
|
508
|
-
left = referenceRect.left - popoverRect.width - offset;
|
|
509
|
-
break;
|
|
510
|
-
case "right":
|
|
511
|
-
top = referenceRect.top + referenceRect.height / 2 - popoverRect.height / 2;
|
|
512
|
-
left = referenceRect.right + offset;
|
|
513
|
-
break;
|
|
514
|
-
}
|
|
515
|
-
const viewportWidth = window.innerWidth;
|
|
516
|
-
const viewportHeight = window.innerHeight;
|
|
517
|
-
if (left < 10)
|
|
518
|
-
left = 10;
|
|
519
|
-
if (left + popoverRect.width > viewportWidth - 10) {
|
|
520
|
-
left = viewportWidth - popoverRect.width - 10;
|
|
521
|
-
}
|
|
522
|
-
if (top < 10)
|
|
523
|
-
top = 10;
|
|
524
|
-
if (top + popoverRect.height > viewportHeight - 10) {
|
|
525
|
-
top = viewportHeight - popoverRect.height - 10;
|
|
526
|
-
}
|
|
527
|
-
popoverStyle.value = {
|
|
528
|
-
top: `${top}px`,
|
|
529
|
-
left: `${left}px`,
|
|
530
|
-
zIndex: props.zIndex.toString()
|
|
531
|
-
};
|
|
532
|
-
};
|
|
533
|
-
onMounted(() => {
|
|
534
|
-
window.addEventListener("resize", () => {
|
|
535
|
-
if (visible.value) {
|
|
536
|
-
updatePosition();
|
|
537
|
-
}
|
|
538
|
-
});
|
|
539
|
-
});
|
|
540
|
-
return (_ctx, _cache) => {
|
|
541
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
542
|
-
createBaseVNode("div", {
|
|
543
|
-
ref_key: "referenceEl",
|
|
544
|
-
ref: referenceEl,
|
|
545
|
-
class: "popover-reference",
|
|
546
|
-
onMouseenter: showPopover,
|
|
547
|
-
onMouseleave: hidePopover
|
|
548
|
-
}, [
|
|
549
|
-
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
550
|
-
], 544),
|
|
551
|
-
visible.value ? (openBlock(), createBlock(Teleport, {
|
|
552
|
-
key: 0,
|
|
553
|
-
to: "body"
|
|
554
|
-
}, [
|
|
555
|
-
createBaseVNode("div", {
|
|
556
|
-
ref_key: "popoverEl",
|
|
557
|
-
ref: popoverEl,
|
|
558
|
-
style: normalizeStyle(popoverStyle.value),
|
|
559
|
-
class: normalizeClass(["popover", { "popover--left": props.placement === "left" }])
|
|
560
|
-
}, [
|
|
561
|
-
props.title !== "" ? (openBlock(), createElementBlock("h3", _hoisted_2, toDisplayString(props.title), 1)) : createCommentVNode("", true),
|
|
562
|
-
createBaseVNode("p", {
|
|
563
|
-
class: "content",
|
|
564
|
-
innerHTML: props.content
|
|
565
|
-
}, null, 8, _hoisted_3)
|
|
566
|
-
], 6)
|
|
567
|
-
])) : createCommentVNode("", true)
|
|
568
|
-
]);
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
});
|
|
572
|
-
const PopOver_vue_vue_type_style_index_0_scoped_e6f071d2_lang = "";
|
|
573
|
-
const PopOver = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e6f071d2"]]);
|
|
574
|
-
export {
|
|
575
|
-
PopOver as P,
|
|
576
|
-
useNodeStore as u
|
|
577
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|