Flowfile 0.2.2__py3-none-any.whl → 0.3.0.1__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 +14 -7
- flowfile/__main__.py +51 -15
- flowfile/api.py +379 -0
- flowfile/web/__init__.py +155 -0
- flowfile/web/static/assets/AirbyteReader-1ac35765.css +314 -0
- flowfile/web/static/assets/AirbyteReader-cb0c1d4a.js +921 -0
- flowfile/web/static/assets/CrossJoin-41efa4cb.css +100 -0
- flowfile/web/static/assets/CrossJoin-a514fa59.js +153 -0
- flowfile/web/static/assets/DatabaseConnectionSettings-0c04b2e5.css +77 -0
- flowfile/web/static/assets/DatabaseConnectionSettings-f2cecf33.js +151 -0
- flowfile/web/static/assets/DatabaseManager-30fa27e5.css +64 -0
- flowfile/web/static/assets/DatabaseManager-83ee3c98.js +484 -0
- flowfile/web/static/assets/DatabaseReader-dc0c6881.js +426 -0
- flowfile/web/static/assets/DatabaseReader-f50c6558.css +158 -0
- flowfile/web/static/assets/DatabaseWriter-2f570e53.css +96 -0
- flowfile/web/static/assets/DatabaseWriter-5afe9f8d.js +312 -0
- flowfile/web/static/assets/ExploreData-5bdae813.css +45 -0
- flowfile/web/static/assets/ExploreData-c7ee19cf.js +118306 -0
- flowfile/web/static/assets/ExternalSource-17b23a01.js +225 -0
- flowfile/web/static/assets/ExternalSource-e37b6275.css +94 -0
- flowfile/web/static/assets/Filter-90856b4f.js +238 -0
- flowfile/web/static/assets/Filter-a9d08ba1.css +20 -0
- flowfile/web/static/assets/Formula-38b71e9e.js +197 -0
- flowfile/web/static/assets/Formula-d60a74f4.css +17 -0
- flowfile/web/static/assets/FuzzyMatch-6857de82.css +254 -0
- flowfile/web/static/assets/FuzzyMatch-d0f1fe81.js +422 -0
- flowfile/web/static/assets/GoogleSheet-854294a4.js +2616 -0
- flowfile/web/static/assets/GoogleSheet-92084da7.css +233 -0
- flowfile/web/static/assets/GraphSolver-0c86bbc6.js +382 -0
- flowfile/web/static/assets/GraphSolver-17fd26db.css +68 -0
- flowfile/web/static/assets/GroupBy-ab1ea74b.css +51 -0
- flowfile/web/static/assets/GroupBy-f2772e9f.js +413 -0
- flowfile/web/static/assets/Join-41c0f331.css +109 -0
- flowfile/web/static/assets/Join-bc3e1cf7.js +247 -0
- flowfile/web/static/assets/ManualInput-03aa0245.js +391 -0
- flowfile/web/static/assets/ManualInput-ac7b9972.css +84 -0
- flowfile/web/static/assets/Output-48f81019.css +2642 -0
- flowfile/web/static/assets/Output-5b35eee8.js +536 -0
- flowfile/web/static/assets/Pivot-7164087c.js +408 -0
- flowfile/web/static/assets/Pivot-f415e85f.css +35 -0
- flowfile/web/static/assets/PolarsCode-3abf6507.js +2863 -0
- flowfile/web/static/assets/PolarsCode-650322d1.css +35 -0
- flowfile/web/static/assets/PopOver-b37ff9be.js +577 -0
- flowfile/web/static/assets/PopOver-bccfde04.css +32 -0
- flowfile/web/static/assets/Read-65966a3e.js +701 -0
- flowfile/web/static/assets/Read-80dc1675.css +197 -0
- flowfile/web/static/assets/RecordCount-c66c6d6d.js +121 -0
- flowfile/web/static/assets/RecordId-826dc095.js +339 -0
- flowfile/web/static/assets/Sample-4ed555c8.js +184 -0
- flowfile/web/static/assets/SecretManager-eac1e97d.js +382 -0
- flowfile/web/static/assets/Select-085f05cc.js +231 -0
- flowfile/web/static/assets/SettingsSection-1f5e79c1.js +87 -0
- flowfile/web/static/assets/SettingsSection-9c836ecc.css +47 -0
- flowfile/web/static/assets/Sort-3e6cb414.js +309 -0
- flowfile/web/static/assets/Sort-7ccfa0fe.css +51 -0
- flowfile/web/static/assets/TextToRows-606349bc.js +307 -0
- flowfile/web/static/assets/TextToRows-c92d1ec2.css +48 -0
- flowfile/web/static/assets/UnavailableFields-5edd5322.css +49 -0
- flowfile/web/static/assets/UnavailableFields-b41976ed.js +36 -0
- flowfile/web/static/assets/Union-8d9ac7f9.css +30 -0
- flowfile/web/static/assets/Union-fca91665.js +145 -0
- flowfile/web/static/assets/Unique-a59f830e.js +273 -0
- flowfile/web/static/assets/Unique-b5615727.css +51 -0
- flowfile/web/static/assets/Unpivot-246e9bbd.css +77 -0
- flowfile/web/static/assets/Unpivot-c3815565.js +441 -0
- flowfile/web/static/assets/airbyte-292aa232.png +0 -0
- flowfile/web/static/assets/api-22b338bd.js +60 -0
- flowfile/web/static/assets/cross_join-d30c0290.png +0 -0
- flowfile/web/static/assets/database_reader-ce1e55f3.svg +24 -0
- flowfile/web/static/assets/database_writer-b4ad0753.svg +23 -0
- flowfile/web/static/assets/designer-2394122a.css +10697 -0
- flowfile/web/static/assets/designer-e5bbe26f.js +69712 -0
- flowfile/web/static/assets/documentation-08045cf2.js +33 -0
- flowfile/web/static/assets/documentation-12216a74.css +50 -0
- flowfile/web/static/assets/dropDown-35135ba8.css +143 -0
- flowfile/web/static/assets/dropDown-5e7e9a5a.js +319 -0
- flowfile/web/static/assets/dropDownGeneric-50a91b99.js +72 -0
- flowfile/web/static/assets/dropDownGeneric-895680d6.css +10 -0
- flowfile/web/static/assets/element-icons-9c88a535.woff +0 -0
- flowfile/web/static/assets/element-icons-de5eb258.ttf +0 -0
- flowfile/web/static/assets/explore_data-8a0a2861.png +0 -0
- flowfile/web/static/assets/fa-brands-400-808443ae.ttf +0 -0
- flowfile/web/static/assets/fa-brands-400-d7236a19.woff2 +0 -0
- flowfile/web/static/assets/fa-regular-400-54cf6086.ttf +0 -0
- flowfile/web/static/assets/fa-regular-400-e3456d12.woff2 +0 -0
- flowfile/web/static/assets/fa-solid-900-aa759986.woff2 +0 -0
- flowfile/web/static/assets/fa-solid-900-d2f05935.ttf +0 -0
- flowfile/web/static/assets/fa-v4compatibility-0ce9033c.woff2 +0 -0
- flowfile/web/static/assets/fa-v4compatibility-30f6abf6.ttf +0 -0
- flowfile/web/static/assets/filter-d7708bda.png +0 -0
- flowfile/web/static/assets/formula-eeeb1611.png +0 -0
- flowfile/web/static/assets/fullEditor-178376bb.css +256 -0
- flowfile/web/static/assets/fullEditor-705c6ccb.js +630 -0
- flowfile/web/static/assets/fuzzy_match-40c161b2.png +0 -0
- flowfile/web/static/assets/genericNodeSettings-65587f20.js +137 -0
- flowfile/web/static/assets/genericNodeSettings-924759c7.css +46 -0
- flowfile/web/static/assets/graph_solver-8b7888b8.png +0 -0
- flowfile/web/static/assets/group_by-80561fc3.png +0 -0
- flowfile/web/static/assets/index-552863fd.js +58652 -0
- flowfile/web/static/assets/index-681a3ed0.css +8843 -0
- flowfile/web/static/assets/input_data-ab2eb678.png +0 -0
- flowfile/web/static/assets/join-349043ae.png +0 -0
- flowfile/web/static/assets/manual_input-ae98f31d.png +0 -0
- flowfile/web/static/assets/nodeTitle-cf9bae3c.js +227 -0
- flowfile/web/static/assets/nodeTitle-f4b12bcb.css +134 -0
- flowfile/web/static/assets/old_join-5d0eb604.png +0 -0
- flowfile/web/static/assets/output-06ec0371.png +0 -0
- flowfile/web/static/assets/pivot-9660df51.png +0 -0
- flowfile/web/static/assets/polars_code-05ce5dc6.png +0 -0
- flowfile/web/static/assets/record_count-dab44eb5.png +0 -0
- flowfile/web/static/assets/record_id-0b15856b.png +0 -0
- flowfile/web/static/assets/sample-693a88b5.png +0 -0
- flowfile/web/static/assets/secretApi-3ad510e1.js +46 -0
- flowfile/web/static/assets/select-b0d0437a.png +0 -0
- flowfile/web/static/assets/selectDynamic-b062bc9b.css +107 -0
- flowfile/web/static/assets/selectDynamic-bd644891.js +302 -0
- flowfile/web/static/assets/sort-2aa579f0.png +0 -0
- flowfile/web/static/assets/summarize-2a099231.png +0 -0
- flowfile/web/static/assets/text_to_rows-859b29ea.png +0 -0
- flowfile/web/static/assets/union-2d8609f4.png +0 -0
- flowfile/web/static/assets/unique-1958b98a.png +0 -0
- flowfile/web/static/assets/unpivot-d3cb4b5b.png +0 -0
- flowfile/web/static/assets/view-7a0f0be1.png +0 -0
- flowfile/web/static/assets/vue-codemirror.esm-dd17b478.js +22281 -0
- flowfile/web/static/assets/vue-content-loader.es-6b36f05e.js +210 -0
- flowfile/web/static/flowfile.svg +47 -0
- flowfile/web/static/icons/flowfile.png +0 -0
- flowfile/web/static/images/airbyte.png +0 -0
- flowfile/web/static/images/flowfile.svg +47 -0
- flowfile/web/static/images/google.svg +1 -0
- flowfile/web/static/images/sheets.png +0 -0
- flowfile/web/static/index.html +22 -0
- flowfile/web/static/vite.svg +1 -0
- flowfile/web/static/vue.svg +1 -0
- flowfile-0.3.0.1.dist-info/METADATA +219 -0
- {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/RECORD +147 -16
- {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/entry_points.txt +1 -1
- flowfile_core/configs/settings.py +7 -32
- flowfile_core/flowfile/FlowfileFlow.py +4 -2
- flowfile_core/flowfile/analytics/analytics_processor.py +1 -1
- flowfile_core/main.py +4 -1
- flowfile_core/schemas/input_schema.py +1 -8
- flowfile_frame/__init__.py +1 -2
- flowfile_frame/flow_frame.py +6 -6
- flowfile_frame/utils.py +1 -140
- flowfile-0.2.2.dist-info/METADATA +0 -225
- flowfile_frame/__main__.py +0 -12
- {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/LICENSE +0 -0
- {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { u as useNodeStore, P as PopOver } from "./PopOver-b37ff9be.js";
|
|
8
|
+
import { d as defineComponent, r as ref, m as watch, n as onMounted, c as openBlock, e as createElementBlock, q as renderList, p as createBaseVNode, t as toDisplayString, F as Fragment, _ as _export_sfc, s as normalizeClass, f as createVNode, w as withCtx, al as shallowRef, u as unref, a as axios, R as nextTick, i as createCommentVNode, l as computed, am as debounce, T as normalizeStyle, h as createBlock } from "./index-552863fd.js";
|
|
9
|
+
import { V as ViewPlugin, D as Decoration, E as EditorState, a as autocompletion, R as RangeSetBuilder, T } from "./vue-codemirror.esm-dd17b478.js";
|
|
10
|
+
const _hoisted_1$5 = { class: "cool-button-container" };
|
|
11
|
+
const _hoisted_2$4 = ["onClick"];
|
|
12
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
13
|
+
__name: "columnsSelector",
|
|
14
|
+
emits: ["value-selected"],
|
|
15
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
16
|
+
const emit = __emit;
|
|
17
|
+
const ranVal = ref(0);
|
|
18
|
+
const showOptions = ref(false);
|
|
19
|
+
const nodeStore = useNodeStore();
|
|
20
|
+
const menuContents = ref({
|
|
21
|
+
title: "Existing fields",
|
|
22
|
+
icon: "room",
|
|
23
|
+
children: []
|
|
24
|
+
});
|
|
25
|
+
watch(
|
|
26
|
+
() => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
return (_b = (_a = nodeStore.nodeData) == null ? void 0 : _a.main_input) == null ? void 0 : _b.table_schema;
|
|
29
|
+
},
|
|
30
|
+
(newColumns) => {
|
|
31
|
+
if (newColumns) {
|
|
32
|
+
updateColumnData(newColumns);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{ deep: true }
|
|
36
|
+
);
|
|
37
|
+
const handleButtonClick = (columnSelector) => {
|
|
38
|
+
const val = columnSelector.node_type === "c" ? `[${columnSelector.label}]` : columnSelector.label;
|
|
39
|
+
ranVal.value++;
|
|
40
|
+
emit("value-selected", val);
|
|
41
|
+
};
|
|
42
|
+
const updateColumnData = (columns) => {
|
|
43
|
+
const childrenNodes = columns.map((col) => ({
|
|
44
|
+
label: col.name,
|
|
45
|
+
hasAction: true,
|
|
46
|
+
node_type: "c",
|
|
47
|
+
name: col.name + "(" + col.data_type + ")"
|
|
48
|
+
}));
|
|
49
|
+
if (menuContents.value) {
|
|
50
|
+
menuContents.value.children = childrenNodes;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
onMounted(async () => {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
if ((_b = (_a = nodeStore.nodeData) == null ? void 0 : _a.main_input) == null ? void 0 : _b.columns) {
|
|
56
|
+
updateColumnData(nodeStore.nodeData.main_input.table_schema);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
__expose({ showOptions });
|
|
60
|
+
return (_ctx, _cache) => {
|
|
61
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(menuContents.value.children, (child, index) => {
|
|
62
|
+
return openBlock(), createElementBlock("div", { key: index }, [
|
|
63
|
+
createBaseVNode("div", _hoisted_1$5, [
|
|
64
|
+
createBaseVNode("button", {
|
|
65
|
+
class: "cool-button",
|
|
66
|
+
onClick: ($event) => handleButtonClick(child)
|
|
67
|
+
}, toDisplayString(child.name), 9, _hoisted_2$4)
|
|
68
|
+
])
|
|
69
|
+
]);
|
|
70
|
+
}), 128);
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const columnsSelector_vue_vue_type_style_index_0_scoped_93995232_lang = "";
|
|
75
|
+
const ColumnSelector = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-93995232"]]);
|
|
76
|
+
const _hoisted_1$4 = { class: "radio-menu" };
|
|
77
|
+
const _hoisted_2$3 = ["onClick"];
|
|
78
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
79
|
+
__name: "Sidebar",
|
|
80
|
+
props: {
|
|
81
|
+
options: {
|
|
82
|
+
type: Array,
|
|
83
|
+
required: true
|
|
84
|
+
},
|
|
85
|
+
modelValue: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: ""
|
|
88
|
+
},
|
|
89
|
+
defaultIcon: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: "fas fa-circle"
|
|
92
|
+
// Default Font Awesome icon
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
emits: ["update:modelValue"],
|
|
96
|
+
setup(__props, { emit: __emit }) {
|
|
97
|
+
const props = __props;
|
|
98
|
+
const emits = __emit;
|
|
99
|
+
const selectedOption = ref(props.modelValue);
|
|
100
|
+
const onToggle = (value) => {
|
|
101
|
+
emits("update:modelValue", value);
|
|
102
|
+
};
|
|
103
|
+
watch(
|
|
104
|
+
() => props.modelValue,
|
|
105
|
+
(newValue) => {
|
|
106
|
+
selectedOption.value = newValue;
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
return (_ctx, _cache) => {
|
|
110
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
111
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
|
|
112
|
+
return openBlock(), createElementBlock("label", {
|
|
113
|
+
key: index,
|
|
114
|
+
class: normalizeClass(["radio-option", { selected: selectedOption.value === option.value }]),
|
|
115
|
+
onClick: ($event) => onToggle(option.value)
|
|
116
|
+
}, [
|
|
117
|
+
createVNode(PopOver, {
|
|
118
|
+
content: option.text
|
|
119
|
+
}, {
|
|
120
|
+
default: withCtx(() => [
|
|
121
|
+
createBaseVNode("i", {
|
|
122
|
+
class: normalizeClass([option.icon || __props.defaultIcon, "icon"])
|
|
123
|
+
}, null, 2)
|
|
124
|
+
]),
|
|
125
|
+
_: 2
|
|
126
|
+
}, 1032, ["content"])
|
|
127
|
+
], 10, _hoisted_2$3);
|
|
128
|
+
}), 128))
|
|
129
|
+
]);
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
const Sidebar_vue_vue_type_style_index_0_scoped_a8e433fb_lang = "";
|
|
134
|
+
const Sidebar = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-a8e433fb"]]);
|
|
135
|
+
const _hoisted_1$3 = { class: "function-editor-root" };
|
|
136
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
137
|
+
__name: "FunctionEditor",
|
|
138
|
+
props: {
|
|
139
|
+
editorString: {},
|
|
140
|
+
columns: { default: () => [] }
|
|
141
|
+
},
|
|
142
|
+
emits: ["update-editor-string"],
|
|
143
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
144
|
+
const props = __props;
|
|
145
|
+
const emit = __emit;
|
|
146
|
+
const expressionsList = ref([]);
|
|
147
|
+
const expressionDocs = ref({});
|
|
148
|
+
const fetchExpressions = async () => {
|
|
149
|
+
try {
|
|
150
|
+
const response = await axios.get("editor/expressions");
|
|
151
|
+
expressionsList.value = response.data;
|
|
152
|
+
} catch (error) {
|
|
153
|
+
console.error("Failed to fetch expressions:", error);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const fetchExpressionDocs = async () => {
|
|
157
|
+
try {
|
|
158
|
+
const response = await axios.get("editor/expression_doc");
|
|
159
|
+
const docsMap = {};
|
|
160
|
+
response.data.forEach((category) => {
|
|
161
|
+
category.expressions.forEach((expr) => {
|
|
162
|
+
docsMap[expr.name] = expr.doc;
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
expressionDocs.value = docsMap;
|
|
166
|
+
} catch (error) {
|
|
167
|
+
console.error("Failed to fetch expression docs:", error);
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
onMounted(() => {
|
|
171
|
+
fetchExpressions();
|
|
172
|
+
fetchExpressionDocs();
|
|
173
|
+
});
|
|
174
|
+
const polarsCompletions = (context) => {
|
|
175
|
+
let functionWord = context.matchBefore(/\w+/);
|
|
176
|
+
let columnWord = context.matchBefore(/\[\w*/);
|
|
177
|
+
if ((!functionWord || functionWord.from === functionWord.to) && (!columnWord || columnWord.from === columnWord.to) && !context.explicit) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
const options = [];
|
|
181
|
+
if (functionWord && context.state.sliceDoc(functionWord.from - 1, functionWord.from) !== "[") {
|
|
182
|
+
const currentText = functionWord.text.toLowerCase();
|
|
183
|
+
expressionsList.value.filter((funcName) => funcName.toLowerCase().startsWith(currentText)).forEach((funcName) => {
|
|
184
|
+
options.push({
|
|
185
|
+
label: funcName,
|
|
186
|
+
type: "function",
|
|
187
|
+
info: expressionDocs.value[funcName] || `Function: ${funcName}`,
|
|
188
|
+
apply: (editorView) => {
|
|
189
|
+
const insert = funcName + "(";
|
|
190
|
+
editorView.dispatch({
|
|
191
|
+
changes: { from: functionWord.from, to: functionWord.to, insert },
|
|
192
|
+
selection: { anchor: functionWord.from + insert.length }
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
if (columnWord) {
|
|
199
|
+
const bracketContent = columnWord.text.slice(1).toLowerCase();
|
|
200
|
+
props.columns.filter((column) => column.toLowerCase().startsWith(bracketContent)).forEach((column) => {
|
|
201
|
+
options.push({
|
|
202
|
+
label: column,
|
|
203
|
+
type: "variable",
|
|
204
|
+
info: `Column: ${column}`,
|
|
205
|
+
apply: (editorView) => {
|
|
206
|
+
editorView.dispatch({
|
|
207
|
+
changes: {
|
|
208
|
+
from: columnWord.from + 1,
|
|
209
|
+
to: columnWord.to,
|
|
210
|
+
insert: column
|
|
211
|
+
},
|
|
212
|
+
selection: { anchor: columnWord.from + 1 + column.length }
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
return {
|
|
219
|
+
from: (functionWord == null ? void 0 : functionWord.from) || (columnWord ? columnWord.from + 1 : context.pos),
|
|
220
|
+
options
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
const insertTextAtCursor = (text) => {
|
|
224
|
+
if (view.value) {
|
|
225
|
+
view.value.dispatch({
|
|
226
|
+
changes: {
|
|
227
|
+
from: view.value.state.selection.main.head,
|
|
228
|
+
to: view.value.state.selection.main.head,
|
|
229
|
+
insert: text
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
const code = ref(props.editorString);
|
|
235
|
+
const view = shallowRef(null);
|
|
236
|
+
const highlightPlugin = ViewPlugin.fromClass(
|
|
237
|
+
class {
|
|
238
|
+
constructor(view2) {
|
|
239
|
+
__publicField(this, "decorations");
|
|
240
|
+
this.decorations = this.buildDecorations(view2);
|
|
241
|
+
}
|
|
242
|
+
update(update) {
|
|
243
|
+
if (update.docChanged || update.viewportChanged) {
|
|
244
|
+
this.decorations = this.buildDecorations(update.view);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
buildDecorations(view2) {
|
|
248
|
+
const builder = new RangeSetBuilder();
|
|
249
|
+
const { doc } = view2.state;
|
|
250
|
+
const regexFunction = /\b([a-zA-Z_]\w*)\(/g;
|
|
251
|
+
const regexColumn = /\[[^\]]+\]/g;
|
|
252
|
+
const regexString = /(["'])(?:(?=(\\?))\2.)*?\1/g;
|
|
253
|
+
const matches = [];
|
|
254
|
+
for (let { from, to } of view2.visibleRanges) {
|
|
255
|
+
const text = doc.sliceString(from, to);
|
|
256
|
+
let match;
|
|
257
|
+
regexFunction.lastIndex = 0;
|
|
258
|
+
while ((match = regexFunction.exec(text)) !== null) {
|
|
259
|
+
const start = from + match.index;
|
|
260
|
+
const end = start + match[1].length;
|
|
261
|
+
matches.push({ start, end, type: "function" });
|
|
262
|
+
}
|
|
263
|
+
regexColumn.lastIndex = 0;
|
|
264
|
+
while ((match = regexColumn.exec(text)) !== null) {
|
|
265
|
+
const start = from + match.index;
|
|
266
|
+
const end = start + match[0].length;
|
|
267
|
+
matches.push({ start, end, type: "column" });
|
|
268
|
+
}
|
|
269
|
+
regexString.lastIndex = 0;
|
|
270
|
+
while ((match = regexString.exec(text)) !== null) {
|
|
271
|
+
const start = from + match.index;
|
|
272
|
+
const end = start + match[0].length;
|
|
273
|
+
matches.push({ start, end, type: "string" });
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
matches.sort((a, b) => a.start - b.start);
|
|
277
|
+
for (const match of matches) {
|
|
278
|
+
if (match.type === "function") {
|
|
279
|
+
builder.add(match.start, match.end, Decoration.mark({ class: "cm-function" }));
|
|
280
|
+
} else if (match.type === "column") {
|
|
281
|
+
builder.add(match.start, match.end, Decoration.mark({ class: "cm-column" }));
|
|
282
|
+
} else if (match.type === "string") {
|
|
283
|
+
builder.add(match.start, match.end, Decoration.mark({ class: "cm-string" }));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return builder.finish();
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
decorations: (v) => v.decorations
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
const extensions = [
|
|
294
|
+
EditorState.tabSize.of(2),
|
|
295
|
+
autocompletion({
|
|
296
|
+
override: [polarsCompletions],
|
|
297
|
+
defaultKeymap: true,
|
|
298
|
+
activateOnTyping: true,
|
|
299
|
+
icons: false
|
|
300
|
+
}),
|
|
301
|
+
highlightPlugin
|
|
302
|
+
];
|
|
303
|
+
const handleReady = (payload) => {
|
|
304
|
+
view.value = payload.view;
|
|
305
|
+
};
|
|
306
|
+
watch(code, (newCode) => {
|
|
307
|
+
emit("update-editor-string", newCode);
|
|
308
|
+
});
|
|
309
|
+
__expose({ insertTextAtCursor });
|
|
310
|
+
return (_ctx, _cache) => {
|
|
311
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
312
|
+
createVNode(unref(T), {
|
|
313
|
+
modelValue: code.value,
|
|
314
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => code.value = $event),
|
|
315
|
+
placeholder: "Code goes here...",
|
|
316
|
+
style: { height: "250px" },
|
|
317
|
+
autofocus: true,
|
|
318
|
+
"indent-with-tab": true,
|
|
319
|
+
"tab-size": 2,
|
|
320
|
+
extensions,
|
|
321
|
+
onReady: handleReady
|
|
322
|
+
}, null, 8, ["modelValue"])
|
|
323
|
+
]);
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
const FunctionEditor_vue_vue_type_style_index_0_lang = "";
|
|
328
|
+
const _hoisted_1$2 = { class: "container" };
|
|
329
|
+
const _hoisted_2$2 = {
|
|
330
|
+
key: 0,
|
|
331
|
+
class: "result-content loading"
|
|
332
|
+
};
|
|
333
|
+
const _hoisted_3$2 = {
|
|
334
|
+
key: 1,
|
|
335
|
+
class: "result-content loading"
|
|
336
|
+
};
|
|
337
|
+
const _hoisted_4$1 = {
|
|
338
|
+
key: 2,
|
|
339
|
+
class: "result-content success"
|
|
340
|
+
};
|
|
341
|
+
const _hoisted_5$1 = { class: "content" };
|
|
342
|
+
const _hoisted_6 = {
|
|
343
|
+
key: 3,
|
|
344
|
+
class: "result-content error"
|
|
345
|
+
};
|
|
346
|
+
const _hoisted_7 = { class: "content" };
|
|
347
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
348
|
+
__name: "instantFuncResults",
|
|
349
|
+
props: {
|
|
350
|
+
nodeId: { type: Number, required: true }
|
|
351
|
+
},
|
|
352
|
+
setup(__props, { expose: __expose }) {
|
|
353
|
+
const nodeStore = useNodeStore();
|
|
354
|
+
const hasInput = ref(false);
|
|
355
|
+
const props = __props;
|
|
356
|
+
const instantFuncResult = ref({
|
|
357
|
+
result: "",
|
|
358
|
+
success: false
|
|
359
|
+
});
|
|
360
|
+
const getInstantFuncResults = async (funcString, flowId) => {
|
|
361
|
+
if (funcString !== "") {
|
|
362
|
+
hasInput.value = true;
|
|
363
|
+
const response = await axios.get("/custom_functions/instant_result", {
|
|
364
|
+
params: {
|
|
365
|
+
node_id: props.nodeId,
|
|
366
|
+
flow_id: flowId,
|
|
367
|
+
func_string: funcString
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
instantFuncResult.value = response.data;
|
|
371
|
+
console.log(instantFuncResult.value.result);
|
|
372
|
+
} else {
|
|
373
|
+
hasInput.value = false;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
onMounted(() => {
|
|
377
|
+
if (nodeStore.inputCode !== "") {
|
|
378
|
+
hasInput.value = true;
|
|
379
|
+
getInstantFuncResults(nodeStore.inputCode, nodeStore.flow_id);
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
__expose({ getInstantFuncResults });
|
|
383
|
+
return (_ctx, _cache) => {
|
|
384
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
385
|
+
!hasInput.value ? (openBlock(), createElementBlock("div", _hoisted_2$2, _cache[0] || (_cache[0] = [
|
|
386
|
+
createBaseVNode("div", { class: "label" }, "Waiting for input", -1),
|
|
387
|
+
createBaseVNode("div", { class: "content" }, null, -1)
|
|
388
|
+
]))) : instantFuncResult.value.success === null ? (openBlock(), createElementBlock("div", _hoisted_3$2, _cache[1] || (_cache[1] = [
|
|
389
|
+
createBaseVNode("div", { class: "label" }, "Processing", -1),
|
|
390
|
+
createBaseVNode("div", { class: "content" }, "Function valid, run process to see results", -1)
|
|
391
|
+
]))) : instantFuncResult.value.success ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
392
|
+
_cache[2] || (_cache[2] = createBaseVNode("div", { class: "label" }, "Example result", -1)),
|
|
393
|
+
createBaseVNode("div", _hoisted_5$1, toDisplayString(instantFuncResult.value.result), 1)
|
|
394
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
395
|
+
_cache[3] || (_cache[3] = createBaseVNode("div", { class: "label" }, "Validation error", -1)),
|
|
396
|
+
createBaseVNode("div", _hoisted_7, toDisplayString(instantFuncResult.value.result), 1)
|
|
397
|
+
]))
|
|
398
|
+
]);
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
const instantFuncResults_vue_vue_type_style_index_0_scoped_66ed8b64_lang = "";
|
|
403
|
+
const InstantFuncResults = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-66ed8b64"]]);
|
|
404
|
+
const _hoisted_1$1 = ["onClick"];
|
|
405
|
+
const _hoisted_2$1 = {
|
|
406
|
+
key: 0,
|
|
407
|
+
class: "toggle-icon"
|
|
408
|
+
};
|
|
409
|
+
const _hoisted_3$1 = {
|
|
410
|
+
key: 0,
|
|
411
|
+
class: "tree-subview"
|
|
412
|
+
};
|
|
413
|
+
const _hoisted_4 = { class: "cool-button-container" };
|
|
414
|
+
const _hoisted_5 = ["onClick"];
|
|
415
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
416
|
+
__name: "FuncSelector",
|
|
417
|
+
emits: ["value-selected"],
|
|
418
|
+
setup(__props, { emit: __emit }) {
|
|
419
|
+
const nodeStore = useNodeStore();
|
|
420
|
+
const formatDoc = (doc) => {
|
|
421
|
+
if (!doc)
|
|
422
|
+
return "";
|
|
423
|
+
return doc.replace(/\n/g, "<br>");
|
|
424
|
+
};
|
|
425
|
+
const emit = __emit;
|
|
426
|
+
const handleButtonClick = (funcName) => {
|
|
427
|
+
emit("value-selected", funcName);
|
|
428
|
+
};
|
|
429
|
+
const openNodes = ref(/* @__PURE__ */ new Set());
|
|
430
|
+
const toggle = (expressionGroup) => {
|
|
431
|
+
const key = expressionGroup.expression_type;
|
|
432
|
+
if (openNodes.value.has(key)) {
|
|
433
|
+
openNodes.value.delete(key);
|
|
434
|
+
} else {
|
|
435
|
+
openNodes.value.add(key);
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
const isOpen = (expressionGroup) => {
|
|
439
|
+
const key = expressionGroup.expression_type;
|
|
440
|
+
return openNodes.value.has(key);
|
|
441
|
+
};
|
|
442
|
+
onMounted(async () => {
|
|
443
|
+
await nextTick();
|
|
444
|
+
apiData.value = await nodeStore.getExpressionsOverview();
|
|
445
|
+
});
|
|
446
|
+
const apiData = ref([
|
|
447
|
+
{
|
|
448
|
+
expression_type: "date_functions",
|
|
449
|
+
expressions: [
|
|
450
|
+
{
|
|
451
|
+
name: "add_days",
|
|
452
|
+
doc: "\n Add a specified number of days to a date or timestamp.\n\n Parameters:\n - s (Any): The date or timestamp to add days to. Can be a Flowfile expression or any other value.\n - days (int): The number of days to add.\n\n Returns:\n - pl.Expr: A Flowfile expression representing the result of adding `days` to `s`.\n\n Note: If `s` is not a Flowfile expression, it will be converted into one.\n "
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
name: "add_hours",
|
|
456
|
+
doc: "\n Add a specified number of hours to a timestamp.\n\n Parameters:\n - s (Any): The timestamp to add hours to. Can be a Flowfile expression or any other value.\n - hours (int): The number of hours to add.\n\n Returns:\n - pl.Expr: A Flowfile expression representing the result of adding `hours` to `s`.\n\n Note: If `s` is not a Flowfile expression, it will be converted into one.\n "
|
|
457
|
+
}
|
|
458
|
+
// Add more expressions as needed
|
|
459
|
+
]
|
|
460
|
+
}
|
|
461
|
+
// Add more expression groups as needed
|
|
462
|
+
]);
|
|
463
|
+
return (_ctx, _cache) => {
|
|
464
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(apiData.value, (expressionGroup) => {
|
|
465
|
+
return openBlock(), createElementBlock("div", {
|
|
466
|
+
key: expressionGroup.expression_type,
|
|
467
|
+
class: "tree-node"
|
|
468
|
+
}, [
|
|
469
|
+
createBaseVNode("div", {
|
|
470
|
+
onClick: ($event) => toggle(expressionGroup)
|
|
471
|
+
}, [
|
|
472
|
+
createBaseVNode("span", null, toDisplayString(expressionGroup.expression_type), 1),
|
|
473
|
+
expressionGroup.expressions ? (openBlock(), createElementBlock("span", _hoisted_2$1, toDisplayString(isOpen(expressionGroup) ? "▼" : "▶"), 1)) : createCommentVNode("", true)
|
|
474
|
+
], 8, _hoisted_1$1),
|
|
475
|
+
expressionGroup.expressions && isOpen(expressionGroup) ? (openBlock(), createElementBlock("ul", _hoisted_3$1, [
|
|
476
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(expressionGroup.expressions, (expression) => {
|
|
477
|
+
return openBlock(), createElementBlock("li", {
|
|
478
|
+
key: expression.name,
|
|
479
|
+
class: "tree-leaf"
|
|
480
|
+
}, [
|
|
481
|
+
createBaseVNode("div", null, [
|
|
482
|
+
createVNode(PopOver, {
|
|
483
|
+
content: formatDoc(expression.doc),
|
|
484
|
+
title: expression.name
|
|
485
|
+
}, {
|
|
486
|
+
default: withCtx(() => [
|
|
487
|
+
createBaseVNode("div", _hoisted_4, [
|
|
488
|
+
createBaseVNode("button", {
|
|
489
|
+
class: "cool-button",
|
|
490
|
+
onClick: ($event) => handleButtonClick(expression.name)
|
|
491
|
+
}, toDisplayString(expression.name), 9, _hoisted_5)
|
|
492
|
+
])
|
|
493
|
+
]),
|
|
494
|
+
_: 2
|
|
495
|
+
}, 1032, ["content", "title"])
|
|
496
|
+
])
|
|
497
|
+
]);
|
|
498
|
+
}), 128))
|
|
499
|
+
])) : createCommentVNode("", true)
|
|
500
|
+
]);
|
|
501
|
+
}), 128);
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
const FuncSelector_vue_vue_type_style_index_0_scoped_967e57c5_lang = "";
|
|
506
|
+
const FuncSelector = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-967e57c5"]]);
|
|
507
|
+
const _hoisted_1 = { class: "container" };
|
|
508
|
+
const _hoisted_2 = { class: "selector" };
|
|
509
|
+
const _hoisted_3 = {
|
|
510
|
+
ref: "editorWrapper",
|
|
511
|
+
class: "editor-wrapper"
|
|
512
|
+
};
|
|
513
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
514
|
+
__name: "fullEditor",
|
|
515
|
+
props: {
|
|
516
|
+
editorString: { type: String, required: true }
|
|
517
|
+
},
|
|
518
|
+
setup(__props, { expose: __expose }) {
|
|
519
|
+
const optionSelection = ref("");
|
|
520
|
+
const nodeStore = useNodeStore();
|
|
521
|
+
const radioOptions = [
|
|
522
|
+
{ value: "fields", text: "Fields", icon: "fa fa-columns" },
|
|
523
|
+
{ value: "functions", text: "Functions", icon: "fas fa-atom" }
|
|
524
|
+
];
|
|
525
|
+
const props = __props;
|
|
526
|
+
const startX = ref(0);
|
|
527
|
+
const startWidth = ref(0);
|
|
528
|
+
const treeNodeWidth = ref("200px");
|
|
529
|
+
const instantFuncResultsRef = ref(null);
|
|
530
|
+
const code = ref(props.editorString);
|
|
531
|
+
nodeStore.setInputCode(props.editorString);
|
|
532
|
+
const functionEditor = ref(null);
|
|
533
|
+
const showTools = ref(true);
|
|
534
|
+
const showHideOptions = () => {
|
|
535
|
+
showTools.value = !showTools.value;
|
|
536
|
+
};
|
|
537
|
+
const showSideBar = computed(() => parseInt(treeNodeWidth.value.replace("px", "")) > 50);
|
|
538
|
+
const handleCodeChange = (newCode) => {
|
|
539
|
+
code.value = newCode;
|
|
540
|
+
nodeStore.setInputCode(newCode);
|
|
541
|
+
};
|
|
542
|
+
const resizeWidth = (event) => {
|
|
543
|
+
const deltaX = event.clientX - startX.value;
|
|
544
|
+
const newWidth = startWidth.value + deltaX;
|
|
545
|
+
treeNodeWidth.value = Math.min(newWidth, 300) + "px";
|
|
546
|
+
};
|
|
547
|
+
watch(
|
|
548
|
+
code,
|
|
549
|
+
debounce((newCode) => {
|
|
550
|
+
if (instantFuncResultsRef.value) {
|
|
551
|
+
instantFuncResultsRef.value.getInstantFuncResults(newCode, nodeStore.flow_id);
|
|
552
|
+
}
|
|
553
|
+
}, 1500)
|
|
554
|
+
);
|
|
555
|
+
__expose({ showHideOptions, functionEditor, showTools });
|
|
556
|
+
const handleNodeSelected = (nodeLabel) => {
|
|
557
|
+
var _a;
|
|
558
|
+
(_a = functionEditor.value) == null ? void 0 : _a.insertTextAtCursor(nodeLabel);
|
|
559
|
+
};
|
|
560
|
+
onMounted(async () => {
|
|
561
|
+
await nextTick();
|
|
562
|
+
if (instantFuncResultsRef.value) {
|
|
563
|
+
instantFuncResultsRef.value.getInstantFuncResults(props.editorString, nodeStore.flow_id);
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
const initResize = (event) => {
|
|
567
|
+
startX.value = event.clientX;
|
|
568
|
+
startWidth.value = parseInt(treeNodeWidth.value.replace("px", ""));
|
|
569
|
+
document.addEventListener("mousemove", resizeWidth);
|
|
570
|
+
document.addEventListener("mouseup", stopResize);
|
|
571
|
+
};
|
|
572
|
+
const stopResize = () => {
|
|
573
|
+
document.removeEventListener("mousemove", resizeWidth);
|
|
574
|
+
document.removeEventListener("mouseup", stopResize);
|
|
575
|
+
};
|
|
576
|
+
return (_ctx, _cache) => {
|
|
577
|
+
var _a, _b;
|
|
578
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
579
|
+
createBaseVNode("div", _hoisted_1, [
|
|
580
|
+
showSideBar.value ? (openBlock(), createElementBlock("div", {
|
|
581
|
+
key: 0,
|
|
582
|
+
class: "options-container",
|
|
583
|
+
style: normalizeStyle({ width: treeNodeWidth.value })
|
|
584
|
+
}, [
|
|
585
|
+
createVNode(Sidebar, {
|
|
586
|
+
modelValue: optionSelection.value,
|
|
587
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => optionSelection.value = $event),
|
|
588
|
+
options: radioOptions
|
|
589
|
+
}, null, 8, ["modelValue"]),
|
|
590
|
+
_cache[1] || (_cache[1] = createBaseVNode("div", { class: "divider" }, null, -1)),
|
|
591
|
+
createBaseVNode("div", _hoisted_2, [
|
|
592
|
+
optionSelection.value === "fields" ? (openBlock(), createBlock(ColumnSelector, {
|
|
593
|
+
key: 0,
|
|
594
|
+
onValueSelected: handleNodeSelected
|
|
595
|
+
})) : (openBlock(), createBlock(FuncSelector, {
|
|
596
|
+
key: 1,
|
|
597
|
+
ref: "func-selector",
|
|
598
|
+
onValueSelected: handleNodeSelected
|
|
599
|
+
}, null, 512))
|
|
600
|
+
])
|
|
601
|
+
], 4)) : createCommentVNode("", true),
|
|
602
|
+
createBaseVNode("div", {
|
|
603
|
+
class: "resizer",
|
|
604
|
+
onMousedown: initResize
|
|
605
|
+
}, null, 32),
|
|
606
|
+
createBaseVNode("div", _hoisted_3, [
|
|
607
|
+
createVNode(_sfc_main$3, {
|
|
608
|
+
ref_key: "functionEditor",
|
|
609
|
+
ref: functionEditor,
|
|
610
|
+
class: "prism-editor-ref",
|
|
611
|
+
"editor-string": code.value,
|
|
612
|
+
columns: (_b = (_a = unref(nodeStore).nodeData) == null ? void 0 : _a.main_input) == null ? void 0 : _b.columns,
|
|
613
|
+
onUpdateEditorString: handleCodeChange
|
|
614
|
+
}, null, 8, ["editor-string", "columns"])
|
|
615
|
+
], 512)
|
|
616
|
+
]),
|
|
617
|
+
createVNode(InstantFuncResults, {
|
|
618
|
+
ref_key: "instantFuncResultsRef",
|
|
619
|
+
ref: instantFuncResultsRef,
|
|
620
|
+
"node-id": unref(nodeStore).node_id
|
|
621
|
+
}, null, 8, ["node-id"])
|
|
622
|
+
], 64);
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
});
|
|
626
|
+
const fullEditor_vue_vue_type_style_index_0_scoped_9df088eb_lang = "";
|
|
627
|
+
const mainEditorRef = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9df088eb"]]);
|
|
628
|
+
export {
|
|
629
|
+
mainEditorRef as default
|
|
630
|
+
};
|
|
Binary file
|