Flowfile 0.3.0__py3-none-any.whl → 0.3.0.2__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 +13 -6
- flowfile/__main__.py +50 -15
- flowfile/api.py +383 -0
- flowfile/readme.md +130 -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.2.dist-info/METADATA +235 -0
- {flowfile-0.3.0.dist-info → flowfile-0.3.0.2.dist-info}/RECORD +147 -15
- {flowfile-0.3.0.dist-info → flowfile-0.3.0.2.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 +0 -1
- flowfile_frame/utils.py +0 -139
- flowfile-0.3.0.dist-info/METADATA +0 -219
- flowfile_frame/__main__.py +0 -12
- {flowfile-0.3.0.dist-info → flowfile-0.3.0.2.dist-info}/LICENSE +0 -0
- {flowfile-0.3.0.dist-info → flowfile-0.3.0.2.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,536 @@
|
|
|
1
|
+
import { u as useNodeStore } from "./PopOver-b37ff9be.js";
|
|
2
|
+
import { d as defineComponent, r as ref, m as watch, c as openBlock, e as createElementBlock, p as createBaseVNode, f as createVNode, w as withCtx, F as Fragment, q as renderList, h as createBlock, u as unref, an as ElOption, ao as ElSelect, _ as _export_sfc, b as resolveComponent, i as createCommentVNode, l as computed, g as createTextVNode, a as axios, n as onMounted, R as nextTick, a6 as Teleport } from "./index-552863fd.js";
|
|
3
|
+
import { w as warning_filled_default, F as FileBrowser } from "./designer-e5bbe26f.js";
|
|
4
|
+
import { N as NodeButton, a as NodeTitle } from "./nodeTitle-cf9bae3c.js";
|
|
5
|
+
const createDefaultParquetSettings = () => {
|
|
6
|
+
return {
|
|
7
|
+
file_type: "parquet"
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
const createDefaultCsvSettings = () => {
|
|
11
|
+
return {
|
|
12
|
+
delimiter: ",",
|
|
13
|
+
encoding: "utf-8",
|
|
14
|
+
file_type: "csv"
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const createDefaultExcelSettings = () => {
|
|
18
|
+
return {
|
|
19
|
+
sheet_name: "Sheet1",
|
|
20
|
+
file_type: "excel"
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const createDefaultOutputSettings = () => {
|
|
24
|
+
return {
|
|
25
|
+
name: "",
|
|
26
|
+
directory: "",
|
|
27
|
+
file_type: "parquet",
|
|
28
|
+
fields: [],
|
|
29
|
+
write_mode: "overwrite",
|
|
30
|
+
output_csv_table: createDefaultCsvSettings(),
|
|
31
|
+
output_parquet_table: createDefaultParquetSettings(),
|
|
32
|
+
output_excel_table: createDefaultExcelSettings()
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const _hoisted_1$4 = { class: "csv-table-settings" };
|
|
36
|
+
const _hoisted_2$2 = { class: "input-group" };
|
|
37
|
+
const _hoisted_3$2 = { class: "input-group" };
|
|
38
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
39
|
+
__name: "outputCsv",
|
|
40
|
+
props: {
|
|
41
|
+
modelValue: {
|
|
42
|
+
type: Object,
|
|
43
|
+
required: true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
emits: ["update:modelValue"],
|
|
47
|
+
setup(__props, { emit: __emit }) {
|
|
48
|
+
const props = __props;
|
|
49
|
+
const emit = __emit;
|
|
50
|
+
const localCsvTable = ref(props.modelValue);
|
|
51
|
+
const csv_settings = {
|
|
52
|
+
delimiter_options: [",", ";", "|", "tab"],
|
|
53
|
+
encoding_options: ["utf-8", "ISO-8859-1", "ASCII"]
|
|
54
|
+
};
|
|
55
|
+
const updateParent = () => {
|
|
56
|
+
emit("update:modelValue", localCsvTable.value);
|
|
57
|
+
};
|
|
58
|
+
watch(
|
|
59
|
+
() => props.modelValue,
|
|
60
|
+
(newVal) => {
|
|
61
|
+
localCsvTable.value = newVal;
|
|
62
|
+
},
|
|
63
|
+
{ deep: true }
|
|
64
|
+
);
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
67
|
+
createBaseVNode("div", _hoisted_2$2, [
|
|
68
|
+
_cache[2] || (_cache[2] = createBaseVNode("label", { for: "delimiter" }, "File delimiter:", -1)),
|
|
69
|
+
createVNode(unref(ElSelect), {
|
|
70
|
+
modelValue: localCsvTable.value.delimiter,
|
|
71
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => localCsvTable.value.delimiter = $event),
|
|
72
|
+
placeholder: "Select delimiter",
|
|
73
|
+
size: "small",
|
|
74
|
+
style: { "max-width": "200px" },
|
|
75
|
+
onChange: updateParent
|
|
76
|
+
}, {
|
|
77
|
+
default: withCtx(() => [
|
|
78
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(csv_settings.delimiter_options, (option) => {
|
|
79
|
+
return openBlock(), createBlock(unref(ElOption), {
|
|
80
|
+
key: option,
|
|
81
|
+
label: option,
|
|
82
|
+
value: option
|
|
83
|
+
}, null, 8, ["label", "value"]);
|
|
84
|
+
}), 128))
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 8, ["modelValue"])
|
|
88
|
+
]),
|
|
89
|
+
createBaseVNode("div", _hoisted_3$2, [
|
|
90
|
+
_cache[3] || (_cache[3] = createBaseVNode("label", { for: "encoding" }, "File encoding:", -1)),
|
|
91
|
+
createVNode(unref(ElSelect), {
|
|
92
|
+
modelValue: localCsvTable.value.encoding,
|
|
93
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => localCsvTable.value.encoding = $event),
|
|
94
|
+
placeholder: "Select encoding",
|
|
95
|
+
size: "small",
|
|
96
|
+
style: { "max-width": "200px" },
|
|
97
|
+
onChange: updateParent
|
|
98
|
+
}, {
|
|
99
|
+
default: withCtx(() => [
|
|
100
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(csv_settings.encoding_options, (option) => {
|
|
101
|
+
return openBlock(), createBlock(unref(ElOption), {
|
|
102
|
+
key: option,
|
|
103
|
+
label: option,
|
|
104
|
+
value: option
|
|
105
|
+
}, null, 8, ["label", "value"]);
|
|
106
|
+
}), 128))
|
|
107
|
+
]),
|
|
108
|
+
_: 1
|
|
109
|
+
}, 8, ["modelValue"])
|
|
110
|
+
])
|
|
111
|
+
]);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
const outputCsv_vue_vue_type_style_index_0_scoped_9ecfb42a_lang = "";
|
|
116
|
+
const CsvTableConfig = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-9ecfb42a"]]);
|
|
117
|
+
const _hoisted_1$3 = { class: "excel-table-settings" };
|
|
118
|
+
const _hoisted_2$1 = { class: "mandatory-section" };
|
|
119
|
+
const _hoisted_3$1 = {
|
|
120
|
+
key: 0,
|
|
121
|
+
class: "section-divider"
|
|
122
|
+
};
|
|
123
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
124
|
+
__name: "outputExcel",
|
|
125
|
+
props: {
|
|
126
|
+
modelValue: {
|
|
127
|
+
type: Object,
|
|
128
|
+
required: true
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
emits: ["update:modelValue"],
|
|
132
|
+
setup(__props, { emit: __emit }) {
|
|
133
|
+
const props = __props;
|
|
134
|
+
const emit = __emit;
|
|
135
|
+
const localExcelTable = ref(props.modelValue);
|
|
136
|
+
const showOptionalSettings = ref(false);
|
|
137
|
+
const updateParent = () => {
|
|
138
|
+
emit("update:modelValue", localExcelTable.value);
|
|
139
|
+
};
|
|
140
|
+
watch(
|
|
141
|
+
() => props.modelValue,
|
|
142
|
+
(newVal) => {
|
|
143
|
+
localExcelTable.value = newVal;
|
|
144
|
+
},
|
|
145
|
+
{ deep: true }
|
|
146
|
+
);
|
|
147
|
+
return (_ctx, _cache) => {
|
|
148
|
+
const _component_el_input = resolveComponent("el-input");
|
|
149
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
150
|
+
createBaseVNode("div", _hoisted_2$1, [
|
|
151
|
+
_cache[1] || (_cache[1] = createBaseVNode("label", { for: "sheet-name" }, "Sheet Name:", -1)),
|
|
152
|
+
createVNode(_component_el_input, {
|
|
153
|
+
id: "sheet-name",
|
|
154
|
+
modelValue: localExcelTable.value.sheet_name,
|
|
155
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => localExcelTable.value.sheet_name = $event),
|
|
156
|
+
type: "text",
|
|
157
|
+
required: "",
|
|
158
|
+
size: "small",
|
|
159
|
+
onInput: updateParent
|
|
160
|
+
}, null, 8, ["modelValue"]),
|
|
161
|
+
showOptionalSettings.value ? (openBlock(), createElementBlock("hr", _hoisted_3$1)) : createCommentVNode("", true)
|
|
162
|
+
])
|
|
163
|
+
]);
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
const outputExcel_vue_vue_type_style_index_0_scoped_45248953_lang = "";
|
|
168
|
+
const ExcelTableConfig = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-45248953"]]);
|
|
169
|
+
const _hoisted_1$2 = { class: "parquet-table-settings" };
|
|
170
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
171
|
+
__name: "outputParquet",
|
|
172
|
+
props: {
|
|
173
|
+
modelValue: {
|
|
174
|
+
type: Object,
|
|
175
|
+
required: true
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
emits: ["update:modelValue"],
|
|
179
|
+
setup(__props, { emit: __emit }) {
|
|
180
|
+
const props = __props;
|
|
181
|
+
const localParquetTable = ref(props.modelValue);
|
|
182
|
+
watch(
|
|
183
|
+
() => props.modelValue,
|
|
184
|
+
(newVal) => {
|
|
185
|
+
localParquetTable.value = newVal;
|
|
186
|
+
},
|
|
187
|
+
{ deep: true }
|
|
188
|
+
);
|
|
189
|
+
return (_ctx, _cache) => {
|
|
190
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
const outputParquet_vue_vue_type_style_index_0_scoped_7db0128e_lang = "";
|
|
195
|
+
const ParquetTableConfig = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7db0128e"]]);
|
|
196
|
+
const _hoisted_1$1 = {
|
|
197
|
+
key: 0,
|
|
198
|
+
class: "listbox-wrapper"
|
|
199
|
+
};
|
|
200
|
+
const _hoisted_2 = { class: "main-part" };
|
|
201
|
+
const _hoisted_3 = { class: "file-upload-row" };
|
|
202
|
+
const _hoisted_4 = {
|
|
203
|
+
key: 1,
|
|
204
|
+
class: "warning-message"
|
|
205
|
+
};
|
|
206
|
+
const _hoisted_5 = { class: "main-part" };
|
|
207
|
+
const _hoisted_6 = { class: "file-type-row" };
|
|
208
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
209
|
+
__name: "output",
|
|
210
|
+
setup(__props, { expose: __expose }) {
|
|
211
|
+
const nodeStore = useNodeStore();
|
|
212
|
+
const nodeOutput = ref(null);
|
|
213
|
+
const dataLoaded = ref(false);
|
|
214
|
+
const showFileSelectionModal = ref(false);
|
|
215
|
+
const selectedDirectoryExists = ref(null);
|
|
216
|
+
const localFileInfos = ref([]);
|
|
217
|
+
const hasFileExtension = computed(() => {
|
|
218
|
+
var _a, _b;
|
|
219
|
+
return ((_b = (_a = nodeOutput.value) == null ? void 0 : _a.output_settings.name) == null ? void 0 : _b.includes(".")) ?? false;
|
|
220
|
+
});
|
|
221
|
+
function getWriteOptions(fileType) {
|
|
222
|
+
return fileType === "csv" ? ["overwrite", "new file", "append"] : ["overwrite", "new file"];
|
|
223
|
+
}
|
|
224
|
+
async function fetchFiles() {
|
|
225
|
+
var _a, _b;
|
|
226
|
+
try {
|
|
227
|
+
const response = await axios.get("/files/files_in_local_directory/", {
|
|
228
|
+
params: { directory: (_a = nodeOutput.value) == null ? void 0 : _a.output_settings.directory },
|
|
229
|
+
headers: { accept: "application/json" }
|
|
230
|
+
});
|
|
231
|
+
localFileInfos.value = response.data;
|
|
232
|
+
selectedDirectoryExists.value = true;
|
|
233
|
+
} catch (err) {
|
|
234
|
+
const axiosError = err;
|
|
235
|
+
if (((_b = axiosError.response) == null ? void 0 : _b.status) === 404) {
|
|
236
|
+
localFileInfos.value = [];
|
|
237
|
+
selectedDirectoryExists.value = false;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
function detectFileType(fileName) {
|
|
242
|
+
var _a;
|
|
243
|
+
if (!fileName)
|
|
244
|
+
return;
|
|
245
|
+
const extension = (_a = fileName.split(".").pop()) == null ? void 0 : _a.toLowerCase();
|
|
246
|
+
if (!extension || !["csv", "xlsx", "xls", "parquet"].includes(extension)) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const verifiedExtension = extension;
|
|
250
|
+
const fileTypeMap = {
|
|
251
|
+
csv: "csv",
|
|
252
|
+
xlsx: "excel",
|
|
253
|
+
xls: "excel",
|
|
254
|
+
parquet: "parquet"
|
|
255
|
+
};
|
|
256
|
+
if (nodeOutput.value && fileTypeMap[verifiedExtension]) {
|
|
257
|
+
nodeOutput.value.output_settings.file_type = fileTypeMap[verifiedExtension];
|
|
258
|
+
nodeOutput.value.output_settings.write_mode = "overwrite";
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function handleFileNameChange() {
|
|
262
|
+
var _a;
|
|
263
|
+
if ((_a = nodeOutput.value) == null ? void 0 : _a.output_settings.name) {
|
|
264
|
+
detectFileType(nodeOutput.value.output_settings.name);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function handleFileTypeChange() {
|
|
268
|
+
if (!nodeOutput.value)
|
|
269
|
+
return;
|
|
270
|
+
const fileExtMap = {
|
|
271
|
+
csv: ".csv",
|
|
272
|
+
excel: ".xlsx",
|
|
273
|
+
parquet: ".parquet"
|
|
274
|
+
};
|
|
275
|
+
const baseName = nodeOutput.value.output_settings.name.split(".")[0];
|
|
276
|
+
nodeOutput.value.output_settings.name = baseName + (fileExtMap[nodeOutput.value.output_settings.file_type] || "");
|
|
277
|
+
if (!nodeOutput.value.output_settings.write_mode) {
|
|
278
|
+
nodeOutput.value.output_settings.write_mode = "overwrite";
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function handleDirectorySelected(directoryPath) {
|
|
282
|
+
if (!nodeOutput.value)
|
|
283
|
+
return;
|
|
284
|
+
nodeOutput.value.output_settings.directory = directoryPath;
|
|
285
|
+
showFileSelectionModal.value = false;
|
|
286
|
+
fetchFiles();
|
|
287
|
+
}
|
|
288
|
+
function handleFileSelected(filePath, currentPath, fileName) {
|
|
289
|
+
if (!nodeOutput.value)
|
|
290
|
+
return;
|
|
291
|
+
nodeOutput.value.output_settings.name = fileName;
|
|
292
|
+
nodeOutput.value.output_settings.directory = currentPath;
|
|
293
|
+
showFileSelectionModal.value = false;
|
|
294
|
+
detectFileType(fileName);
|
|
295
|
+
}
|
|
296
|
+
function handleFolderChange() {
|
|
297
|
+
fetchFiles();
|
|
298
|
+
}
|
|
299
|
+
const querySearch = (queryString, cb) => {
|
|
300
|
+
const results = queryString ? localFileInfos.value.filter(
|
|
301
|
+
(item) => item.file_name.toLowerCase().startsWith(queryString.toLowerCase())
|
|
302
|
+
) : localFileInfos.value;
|
|
303
|
+
cb(results);
|
|
304
|
+
};
|
|
305
|
+
async function loadNodeData(nodeId) {
|
|
306
|
+
const nodeResult = await nodeStore.getNodeData(nodeId, false);
|
|
307
|
+
if ((nodeResult == null ? void 0 : nodeResult.setting_input) && nodeResult.setting_input.is_setup) {
|
|
308
|
+
nodeOutput.value = nodeResult.setting_input;
|
|
309
|
+
console.log("this is all good", nodeResult == null ? void 0 : nodeResult.setting_input);
|
|
310
|
+
} else {
|
|
311
|
+
nodeOutput.value = {
|
|
312
|
+
output_settings: createDefaultOutputSettings(),
|
|
313
|
+
flow_id: nodeStore.flow_id,
|
|
314
|
+
node_id: nodeId,
|
|
315
|
+
cache_results: false,
|
|
316
|
+
pos_x: 0,
|
|
317
|
+
pos_y: 0,
|
|
318
|
+
is_setup: false,
|
|
319
|
+
description: ""
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
dataLoaded.value = true;
|
|
323
|
+
}
|
|
324
|
+
async function pushNodeData() {
|
|
325
|
+
var _a;
|
|
326
|
+
if ((_a = nodeOutput.value) == null ? void 0 : _a.output_settings) {
|
|
327
|
+
await nodeStore.updateSettings(nodeOutput);
|
|
328
|
+
dataLoaded.value = false;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
__expose({
|
|
332
|
+
loadNodeData,
|
|
333
|
+
pushNodeData
|
|
334
|
+
});
|
|
335
|
+
return (_ctx, _cache) => {
|
|
336
|
+
const _component_el_input = resolveComponent("el-input");
|
|
337
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
338
|
+
const _component_el_autocomplete = resolveComponent("el-autocomplete");
|
|
339
|
+
const _component_el_option = resolveComponent("el-option");
|
|
340
|
+
const _component_el_select = resolveComponent("el-select");
|
|
341
|
+
const _component_el_dialog = resolveComponent("el-dialog");
|
|
342
|
+
return dataLoaded.value && nodeOutput.value && nodeOutput.value.output_settings ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
343
|
+
createBaseVNode("div", _hoisted_2, [
|
|
344
|
+
createBaseVNode("div", _hoisted_3, [
|
|
345
|
+
createBaseVNode("label", {
|
|
346
|
+
class: "file-upload-label",
|
|
347
|
+
onClick: _cache[0] || (_cache[0] = ($event) => showFileSelectionModal.value = true)
|
|
348
|
+
}, _cache[9] || (_cache[9] = [
|
|
349
|
+
createBaseVNode("i", { class: "file-icon fas fa-upload" }, null, -1),
|
|
350
|
+
createBaseVNode("span", { class: "file-label-text" }, "Folder", -1)
|
|
351
|
+
])),
|
|
352
|
+
nodeOutput.value.output_settings ? (openBlock(), createBlock(_component_el_input, {
|
|
353
|
+
key: 0,
|
|
354
|
+
modelValue: nodeOutput.value.output_settings.directory,
|
|
355
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => nodeOutput.value.output_settings.directory = $event),
|
|
356
|
+
size: "small",
|
|
357
|
+
onChange: handleFolderChange
|
|
358
|
+
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
|
|
359
|
+
selectedDirectoryExists.value === false ? (openBlock(), createElementBlock("span", _hoisted_4, [
|
|
360
|
+
createVNode(_component_el_icon, null, {
|
|
361
|
+
default: withCtx(() => [
|
|
362
|
+
createVNode(unref(warning_filled_default))
|
|
363
|
+
]),
|
|
364
|
+
_: 1
|
|
365
|
+
})
|
|
366
|
+
])) : createCommentVNode("", true)
|
|
367
|
+
]),
|
|
368
|
+
createVNode(_component_el_autocomplete, {
|
|
369
|
+
modelValue: nodeOutput.value.output_settings.name,
|
|
370
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => nodeOutput.value.output_settings.name = $event),
|
|
371
|
+
"fetch-suggestions": querySearch,
|
|
372
|
+
clearable: "",
|
|
373
|
+
class: "inline-input w-50",
|
|
374
|
+
placeholder: "Select file or create file",
|
|
375
|
+
"trigger-on-focus": false,
|
|
376
|
+
onChange: handleFileNameChange,
|
|
377
|
+
onSelect: handleFileNameChange
|
|
378
|
+
}, null, 8, ["modelValue"])
|
|
379
|
+
]),
|
|
380
|
+
createBaseVNode("div", _hoisted_5, [
|
|
381
|
+
createBaseVNode("div", _hoisted_6, [
|
|
382
|
+
_cache[10] || (_cache[10] = createTextVNode(" File type: ")),
|
|
383
|
+
createVNode(_component_el_select, {
|
|
384
|
+
modelValue: nodeOutput.value.output_settings.file_type,
|
|
385
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => nodeOutput.value.output_settings.file_type = $event),
|
|
386
|
+
class: "m-2",
|
|
387
|
+
placeholder: "Select",
|
|
388
|
+
size: "small",
|
|
389
|
+
disabled: hasFileExtension.value,
|
|
390
|
+
onChange: handleFileTypeChange
|
|
391
|
+
}, {
|
|
392
|
+
default: withCtx(() => [
|
|
393
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(["csv", "excel", "parquet"], (type) => {
|
|
394
|
+
return createVNode(_component_el_option, {
|
|
395
|
+
key: type,
|
|
396
|
+
label: type,
|
|
397
|
+
value: type
|
|
398
|
+
}, null, 8, ["label", "value"]);
|
|
399
|
+
}), 64))
|
|
400
|
+
]),
|
|
401
|
+
_: 1
|
|
402
|
+
}, 8, ["modelValue", "disabled"])
|
|
403
|
+
]),
|
|
404
|
+
_cache[11] || (_cache[11] = createTextVNode(" Writing option: ")),
|
|
405
|
+
createVNode(_component_el_select, {
|
|
406
|
+
modelValue: nodeOutput.value.output_settings.write_mode,
|
|
407
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => nodeOutput.value.output_settings.write_mode = $event),
|
|
408
|
+
class: "m-2",
|
|
409
|
+
placeholder: "Select output option",
|
|
410
|
+
size: "small",
|
|
411
|
+
disabled: !nodeOutput.value.output_settings.file_type
|
|
412
|
+
}, {
|
|
413
|
+
default: withCtx(() => [
|
|
414
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getWriteOptions(nodeOutput.value.output_settings.file_type), (option) => {
|
|
415
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
416
|
+
key: option,
|
|
417
|
+
label: option,
|
|
418
|
+
value: option
|
|
419
|
+
}, null, 8, ["label", "value"]);
|
|
420
|
+
}), 128))
|
|
421
|
+
]),
|
|
422
|
+
_: 1
|
|
423
|
+
}, 8, ["modelValue", "disabled"]),
|
|
424
|
+
nodeOutput.value.output_settings.file_type === "csv" ? (openBlock(), createBlock(CsvTableConfig, {
|
|
425
|
+
key: 0,
|
|
426
|
+
modelValue: nodeOutput.value.output_settings.output_csv_table,
|
|
427
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => nodeOutput.value.output_settings.output_csv_table = $event)
|
|
428
|
+
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
|
|
429
|
+
nodeOutput.value.output_settings.file_type === "excel" ? (openBlock(), createBlock(ExcelTableConfig, {
|
|
430
|
+
key: 1,
|
|
431
|
+
modelValue: nodeOutput.value.output_settings.output_excel_table,
|
|
432
|
+
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => nodeOutput.value.output_settings.output_excel_table = $event)
|
|
433
|
+
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
|
|
434
|
+
nodeOutput.value.output_settings.file_type === "parquet" ? (openBlock(), createBlock(ParquetTableConfig, {
|
|
435
|
+
key: 2,
|
|
436
|
+
modelValue: nodeOutput.value.output_settings.output_parquet_table,
|
|
437
|
+
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => nodeOutput.value.output_settings.output_parquet_table = $event)
|
|
438
|
+
}, null, 8, ["modelValue"])) : createCommentVNode("", true)
|
|
439
|
+
]),
|
|
440
|
+
createVNode(_component_el_dialog, {
|
|
441
|
+
modelValue: showFileSelectionModal.value,
|
|
442
|
+
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => showFileSelectionModal.value = $event),
|
|
443
|
+
title: "Select directory or file to write to",
|
|
444
|
+
width: "70%"
|
|
445
|
+
}, {
|
|
446
|
+
default: withCtx(() => [
|
|
447
|
+
createVNode(FileBrowser, {
|
|
448
|
+
"allowed-file-types": ["csv", "xlsx", "parquet"],
|
|
449
|
+
"allow-directory-selection": true,
|
|
450
|
+
mode: "create",
|
|
451
|
+
onDirectorySelected: handleDirectorySelected,
|
|
452
|
+
onOverwriteFile: handleFileSelected,
|
|
453
|
+
onCreateFile: handleFileSelected
|
|
454
|
+
})
|
|
455
|
+
]),
|
|
456
|
+
_: 1
|
|
457
|
+
}, 8, ["modelValue"])
|
|
458
|
+
])) : createCommentVNode("", true);
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
const output_vue_vue_type_style_index_0_scoped_3955fb0e_lang = "";
|
|
463
|
+
const outputPage = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3955fb0e"]]);
|
|
464
|
+
const _hoisted_1 = { ref: "el" };
|
|
465
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
466
|
+
__name: "Output",
|
|
467
|
+
props: {
|
|
468
|
+
nodeId: {
|
|
469
|
+
type: Number,
|
|
470
|
+
required: true
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
setup(__props) {
|
|
474
|
+
const props = __props;
|
|
475
|
+
const nodeStore = useNodeStore();
|
|
476
|
+
ref(false);
|
|
477
|
+
const childComp = ref(null);
|
|
478
|
+
const closeOnDrawer = () => {
|
|
479
|
+
var _a;
|
|
480
|
+
console.log("closeOnDrawer");
|
|
481
|
+
if (drawer.value) {
|
|
482
|
+
(_a = childComp.value) == null ? void 0 : _a.pushNodeData();
|
|
483
|
+
drawer.value = false;
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
const drawer = ref(false);
|
|
487
|
+
const openDrawer = async () => {
|
|
488
|
+
if (nodeStore.node_id === props.nodeId) {
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
nodeStore.closeDrawer();
|
|
492
|
+
drawer.value = true;
|
|
493
|
+
const drawerOpen = nodeStore.isDrawerOpen;
|
|
494
|
+
nodeStore.isDrawerOpen = true;
|
|
495
|
+
await nextTick();
|
|
496
|
+
if (nodeStore.node_id === props.nodeId && drawerOpen) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
if (childComp.value) {
|
|
500
|
+
childComp.value.loadNodeData(props.nodeId);
|
|
501
|
+
nodeStore.openDrawer(closeOnDrawer);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
onMounted(async () => {
|
|
505
|
+
await nextTick();
|
|
506
|
+
});
|
|
507
|
+
return (_ctx, _cache) => {
|
|
508
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
509
|
+
createVNode(NodeButton, {
|
|
510
|
+
ref: "nodeButton",
|
|
511
|
+
"node-id": __props.nodeId,
|
|
512
|
+
"image-src": "output.png",
|
|
513
|
+
title: `${__props.nodeId}: Write data`,
|
|
514
|
+
onClick: openDrawer
|
|
515
|
+
}, null, 8, ["node-id", "title"]),
|
|
516
|
+
drawer.value ? (openBlock(), createBlock(Teleport, {
|
|
517
|
+
key: 0,
|
|
518
|
+
to: "#nodesettings"
|
|
519
|
+
}, [
|
|
520
|
+
createVNode(NodeTitle, {
|
|
521
|
+
title: "Write data",
|
|
522
|
+
intro: "Write data to a file or database"
|
|
523
|
+
}),
|
|
524
|
+
createVNode(outputPage, {
|
|
525
|
+
ref_key: "childComp",
|
|
526
|
+
ref: childComp,
|
|
527
|
+
"node-id": __props.nodeId
|
|
528
|
+
}, null, 8, ["node-id"])
|
|
529
|
+
])) : createCommentVNode("", true)
|
|
530
|
+
], 512);
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
export {
|
|
535
|
+
_sfc_main as default
|
|
536
|
+
};
|