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,921 @@
|
|
|
1
|
+
import { a as axios, d as defineComponent, r as ref, n as onMounted, l as computed, c as openBlock, e as createElementBlock, p as createBaseVNode, F as Fragment, q as renderList, g as createTextVNode, t as toDisplayString, i as createCommentVNode, a4 as withDirectives, a5 as vModelText, x as withKeys, f as createVNode, af as vModelDynamic, s as normalizeClass, T as normalizeStyle, _ as _export_sfc, b as resolveComponent, w as withCtx, h as createBlock, u as unref, R as nextTick, a6 as Teleport } from "./index-552863fd.js";
|
|
2
|
+
import { D as DropDownGeneric } from "./dropDownGeneric-50a91b99.js";
|
|
3
|
+
import { u as useNodeStore } from "./PopOver-b37ff9be.js";
|
|
4
|
+
import { C as CodeLoader } from "./vue-content-loader.es-6b36f05e.js";
|
|
5
|
+
import { G as GenericNodeSettings } from "./genericNodeSettings-65587f20.js";
|
|
6
|
+
import { N as NodeButton, a as NodeTitle } from "./nodeTitle-cf9bae3c.js";
|
|
7
|
+
import "./dropDown-5e7e9a5a.js";
|
|
8
|
+
import "./designer-e5bbe26f.js";
|
|
9
|
+
const _imports_0 = "/images/airbyte.png";
|
|
10
|
+
const getAirbyteConnectors = async () => {
|
|
11
|
+
const response = await axios.get(`/airbyte/available_connectors`);
|
|
12
|
+
return response.data;
|
|
13
|
+
};
|
|
14
|
+
const getAirbyteConnectorTemplate = async (connector_name) => {
|
|
15
|
+
const response = await axios.get(`/airbyte/config_template?connector_name=${connector_name}`);
|
|
16
|
+
return response.data;
|
|
17
|
+
};
|
|
18
|
+
const getAirbyteAvailableConfigs = async () => {
|
|
19
|
+
const response = await axios.get(`/airbyte/available_configs`);
|
|
20
|
+
return response.data;
|
|
21
|
+
};
|
|
22
|
+
const setAirbyteConfigGetStreams = async (data) => {
|
|
23
|
+
await axios.post(`/airbyte/set_airbyte_configs_for_streams`, data);
|
|
24
|
+
};
|
|
25
|
+
const processProperties = (properties) => {
|
|
26
|
+
return Object.entries(properties).map(([propKey, propValue]) => ({
|
|
27
|
+
key: propKey,
|
|
28
|
+
type: propValue.type,
|
|
29
|
+
description: propValue.description ?? "",
|
|
30
|
+
title: propValue.title ?? "",
|
|
31
|
+
airbyte_secret: propValue.airbyte_secret || false,
|
|
32
|
+
input_value: propValue.default || null,
|
|
33
|
+
default: propValue.default || null
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
const computeSchema = (schema) => {
|
|
37
|
+
const entries = Object.entries(schema.properties);
|
|
38
|
+
const localParsedConfig = entries.map(([key, value]) => {
|
|
39
|
+
var _a;
|
|
40
|
+
const isRequired = ((_a = schema.required) == null ? void 0 : _a.includes(key)) || false;
|
|
41
|
+
const baseField = {
|
|
42
|
+
title: value.title,
|
|
43
|
+
type: value.type,
|
|
44
|
+
key,
|
|
45
|
+
required: isRequired,
|
|
46
|
+
description: value.description,
|
|
47
|
+
isOpen: false,
|
|
48
|
+
airbyte_secret: value.airbyte_secret || false,
|
|
49
|
+
input_value: value.default || null,
|
|
50
|
+
default: value.default || null,
|
|
51
|
+
properties: []
|
|
52
|
+
};
|
|
53
|
+
if ("oneOf" in value && Array.isArray(value.oneOf)) {
|
|
54
|
+
return {
|
|
55
|
+
...baseField,
|
|
56
|
+
oneOf: value.oneOf.map((option) => {
|
|
57
|
+
const mappedProperties = option.properties ? Object.entries(option.properties).reduce(
|
|
58
|
+
(acc, [propKey, propValue]) => {
|
|
59
|
+
if (propKey === "auth_type") {
|
|
60
|
+
acc[propKey] = {
|
|
61
|
+
type: propValue.type,
|
|
62
|
+
const: propValue.const,
|
|
63
|
+
input_value: propValue.const,
|
|
64
|
+
default: propValue.const
|
|
65
|
+
};
|
|
66
|
+
} else {
|
|
67
|
+
acc[propKey] = {
|
|
68
|
+
title: propValue.title,
|
|
69
|
+
type: propValue.type,
|
|
70
|
+
description: propValue.description,
|
|
71
|
+
airbyte_secret: propValue.airbyte_secret,
|
|
72
|
+
input_value: propValue.default || null,
|
|
73
|
+
default: propValue.default
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return acc;
|
|
77
|
+
},
|
|
78
|
+
{}
|
|
79
|
+
) : {};
|
|
80
|
+
return {
|
|
81
|
+
title: option.title,
|
|
82
|
+
type: option.type,
|
|
83
|
+
description: option.description,
|
|
84
|
+
required: option.required || [],
|
|
85
|
+
properties: mappedProperties
|
|
86
|
+
};
|
|
87
|
+
}),
|
|
88
|
+
selectedOption: void 0
|
|
89
|
+
};
|
|
90
|
+
} else if (value.properties) {
|
|
91
|
+
return {
|
|
92
|
+
...baseField,
|
|
93
|
+
properties: processProperties(value.properties)
|
|
94
|
+
};
|
|
95
|
+
} else {
|
|
96
|
+
return baseField;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return localParsedConfig;
|
|
100
|
+
};
|
|
101
|
+
const processPropertyValue = (value, type) => {
|
|
102
|
+
if (value === null || value === void 0 || value === "") {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
if (type === "integer" || type === "number") {
|
|
106
|
+
return typeof value === "string" ? Number(value) : value;
|
|
107
|
+
}
|
|
108
|
+
if (type === "array" && Array.isArray(value)) {
|
|
109
|
+
return value;
|
|
110
|
+
}
|
|
111
|
+
if (type === "string" && typeof value === "string") {
|
|
112
|
+
try {
|
|
113
|
+
JSON.parse(value);
|
|
114
|
+
return value;
|
|
115
|
+
} catch {
|
|
116
|
+
if (value.includes("{") && value.includes("}")) {
|
|
117
|
+
try {
|
|
118
|
+
const parsed = JSON.parse(value.replace(/\s+/g, " "));
|
|
119
|
+
return JSON.stringify(parsed, null, 2);
|
|
120
|
+
} catch {
|
|
121
|
+
return value.trim();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return value;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return value;
|
|
128
|
+
};
|
|
129
|
+
const getConfigSettings = (parsedConfig) => {
|
|
130
|
+
const result = {};
|
|
131
|
+
parsedConfig.forEach((item) => {
|
|
132
|
+
if (item.oneOf && Array.isArray(item.oneOf) && item.selectedOption !== void 0 && item.selectedOption < item.oneOf.length) {
|
|
133
|
+
const selectedOption = item.oneOf[item.selectedOption];
|
|
134
|
+
if (!(selectedOption == null ? void 0 : selectedOption.properties)) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (item.input_value) {
|
|
138
|
+
result[item.key] = {};
|
|
139
|
+
Object.entries(item.input_value).forEach(([key, value]) => {
|
|
140
|
+
var _a, _b;
|
|
141
|
+
const processedValue = processPropertyValue(
|
|
142
|
+
value,
|
|
143
|
+
((_b = (_a = selectedOption.properties) == null ? void 0 : _a[key]) == null ? void 0 : _b.type) ?? "string"
|
|
144
|
+
);
|
|
145
|
+
if (processedValue !== null) {
|
|
146
|
+
result[item.key][key] = processedValue;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
} else if (item.properties && item.properties.length > 0) {
|
|
151
|
+
result[item.key] = {};
|
|
152
|
+
item.properties.forEach((property) => {
|
|
153
|
+
const value = processPropertyValue(property.input_value, property.type);
|
|
154
|
+
if (value !== null) {
|
|
155
|
+
result[item.key][property.key] = value;
|
|
156
|
+
} else if (property.default !== null) {
|
|
157
|
+
result[item.key][property.key] = property.default;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
} else if (item.input_value !== null && item.input_value !== "") {
|
|
161
|
+
const value = processPropertyValue(item.input_value, item.type);
|
|
162
|
+
if (value !== null) {
|
|
163
|
+
result[item.key] = value;
|
|
164
|
+
}
|
|
165
|
+
} else if (item.default !== null) {
|
|
166
|
+
result[item.key] = item.default;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
return result;
|
|
170
|
+
};
|
|
171
|
+
const _hoisted_1$1 = { class: "form-container" };
|
|
172
|
+
const _hoisted_2$1 = { class: "form-grid" };
|
|
173
|
+
const _hoisted_3$1 = {
|
|
174
|
+
key: 0,
|
|
175
|
+
class: "single-item"
|
|
176
|
+
};
|
|
177
|
+
const _hoisted_4$1 = ["onMouseover"];
|
|
178
|
+
const _hoisted_5$1 = {
|
|
179
|
+
key: 0,
|
|
180
|
+
class: "tag"
|
|
181
|
+
};
|
|
182
|
+
const _hoisted_6$1 = { class: "array-input-section" };
|
|
183
|
+
const _hoisted_7$1 = { class: "input-with-button" };
|
|
184
|
+
const _hoisted_8$1 = ["onUpdate:modelValue", "placeholder", "onKeyup"];
|
|
185
|
+
const _hoisted_9$1 = ["onClick"];
|
|
186
|
+
const _hoisted_10$1 = { class: "items-container" };
|
|
187
|
+
const _hoisted_11$1 = ["onClick"];
|
|
188
|
+
const _hoisted_12$1 = {
|
|
189
|
+
key: 1,
|
|
190
|
+
class: "collapsible-section"
|
|
191
|
+
};
|
|
192
|
+
const _hoisted_13$1 = ["onMouseover"];
|
|
193
|
+
const _hoisted_14$1 = {
|
|
194
|
+
key: 0,
|
|
195
|
+
class: "tag"
|
|
196
|
+
};
|
|
197
|
+
const _hoisted_15 = {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: "nested-content"
|
|
200
|
+
};
|
|
201
|
+
const _hoisted_16 = ["onMouseover"];
|
|
202
|
+
const _hoisted_17 = {
|
|
203
|
+
key: 0,
|
|
204
|
+
class: "tag"
|
|
205
|
+
};
|
|
206
|
+
const _hoisted_18 = ["onUpdate:modelValue", "type", "placeholder"];
|
|
207
|
+
const _hoisted_19 = {
|
|
208
|
+
key: 2,
|
|
209
|
+
class: "single-item"
|
|
210
|
+
};
|
|
211
|
+
const _hoisted_20 = ["onMouseover"];
|
|
212
|
+
const _hoisted_21 = {
|
|
213
|
+
key: 0,
|
|
214
|
+
class: "tag"
|
|
215
|
+
};
|
|
216
|
+
const _hoisted_22 = ["onUpdate:modelValue", "type", "placeholder"];
|
|
217
|
+
const _hoisted_23 = {
|
|
218
|
+
key: 3,
|
|
219
|
+
class: "collapsible-section"
|
|
220
|
+
};
|
|
221
|
+
const _hoisted_24 = ["onClick"];
|
|
222
|
+
const _hoisted_25 = { class: "minimal-chevron" };
|
|
223
|
+
const _hoisted_26 = {
|
|
224
|
+
key: 0,
|
|
225
|
+
class: "tag"
|
|
226
|
+
};
|
|
227
|
+
const _hoisted_27 = {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: "nested-content"
|
|
230
|
+
};
|
|
231
|
+
const _hoisted_28 = ["onMouseover"];
|
|
232
|
+
const _hoisted_29 = {
|
|
233
|
+
key: 0,
|
|
234
|
+
class: "tag"
|
|
235
|
+
};
|
|
236
|
+
const _hoisted_30 = ["onUpdate:modelValue", "type", "placeholder"];
|
|
237
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
238
|
+
__name: "airbyteConfigForm",
|
|
239
|
+
props: {
|
|
240
|
+
parsedConfig: {}
|
|
241
|
+
},
|
|
242
|
+
setup(__props, { expose: __expose }) {
|
|
243
|
+
const props = __props;
|
|
244
|
+
const popover = ref({
|
|
245
|
+
show: false,
|
|
246
|
+
content: "",
|
|
247
|
+
x: 0,
|
|
248
|
+
y: 0
|
|
249
|
+
});
|
|
250
|
+
const localConfig = ref([...props.parsedConfig]);
|
|
251
|
+
const selectedValues = ref(new Array(props.parsedConfig.length).fill(""));
|
|
252
|
+
const newArrayValue = ref({});
|
|
253
|
+
function isStringArray(value) {
|
|
254
|
+
return Array.isArray(value) && value.every((item) => typeof item === "string");
|
|
255
|
+
}
|
|
256
|
+
const getArrayValues = (item) => {
|
|
257
|
+
if (!item.input_value) {
|
|
258
|
+
item.input_value = [];
|
|
259
|
+
}
|
|
260
|
+
if (!isStringArray(item.input_value)) {
|
|
261
|
+
item.input_value = [];
|
|
262
|
+
}
|
|
263
|
+
return item.input_value;
|
|
264
|
+
};
|
|
265
|
+
const addArrayValue = (item) => {
|
|
266
|
+
const value = newArrayValue.value[item.key];
|
|
267
|
+
if (!(value == null ? void 0 : value.trim()))
|
|
268
|
+
return;
|
|
269
|
+
if (!item.input_value || !isStringArray(item.input_value)) {
|
|
270
|
+
item.input_value = [];
|
|
271
|
+
}
|
|
272
|
+
const currentArray = item.input_value;
|
|
273
|
+
if (!currentArray.includes(value)) {
|
|
274
|
+
currentArray.push(value);
|
|
275
|
+
newArrayValue.value[item.key] = "";
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
const removeArrayValue = (item, index) => {
|
|
279
|
+
if (isStringArray(item.input_value)) {
|
|
280
|
+
item.input_value.splice(index, 1);
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
onMounted(() => {
|
|
284
|
+
props.parsedConfig.forEach((item, index) => {
|
|
285
|
+
if (item.oneOf && typeof item.selectedOption === "number" && item.selectedOption >= 0) {
|
|
286
|
+
selectedValues.value[index] = item.oneOf[item.selectedOption].title;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
const showPopover = (content, event) => {
|
|
291
|
+
if (!content)
|
|
292
|
+
return;
|
|
293
|
+
popover.value = {
|
|
294
|
+
show: true,
|
|
295
|
+
content,
|
|
296
|
+
x: event.clientX + 10,
|
|
297
|
+
y: event.clientY + 10
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
const hidePopover = () => {
|
|
301
|
+
popover.value.show = false;
|
|
302
|
+
};
|
|
303
|
+
const toggle = (index) => {
|
|
304
|
+
localConfig.value[index].isOpen = !localConfig.value[index].isOpen;
|
|
305
|
+
};
|
|
306
|
+
const isRequired = (schema, fieldName) => {
|
|
307
|
+
var _a;
|
|
308
|
+
return ((_a = schema.required) == null ? void 0 : _a.includes(fieldName)) || false;
|
|
309
|
+
};
|
|
310
|
+
const updateSelectedOption = (item, selectedValue, index) => {
|
|
311
|
+
if (!item.oneOf)
|
|
312
|
+
return;
|
|
313
|
+
const optionIndex = item.oneOf.findIndex((opt) => opt.title === selectedValue);
|
|
314
|
+
if (optionIndex === -1)
|
|
315
|
+
return;
|
|
316
|
+
selectedValues.value[index] = selectedValue;
|
|
317
|
+
const localItem = localConfig.value[index];
|
|
318
|
+
if (!localItem || !localItem.oneOf)
|
|
319
|
+
return;
|
|
320
|
+
localItem.selectedOption = optionIndex;
|
|
321
|
+
const selectedOption = localItem.oneOf[optionIndex];
|
|
322
|
+
const previousValue = localItem.input_value;
|
|
323
|
+
const newInputValue = {};
|
|
324
|
+
if (selectedOption.properties) {
|
|
325
|
+
Object.entries(selectedOption.properties).forEach(([key, prop]) => {
|
|
326
|
+
if (key === "auth_type") {
|
|
327
|
+
newInputValue[key] = prop.const;
|
|
328
|
+
} else if (previousValue && typeof previousValue === "object" && key in previousValue) {
|
|
329
|
+
newInputValue[key] = previousValue[key];
|
|
330
|
+
} else {
|
|
331
|
+
newInputValue[key] = prop.input_value ?? prop.default ?? "";
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
localItem.input_value = newInputValue;
|
|
336
|
+
};
|
|
337
|
+
const computedSchema = computed(() => {
|
|
338
|
+
return props.parsedConfig.map((item) => {
|
|
339
|
+
if (item.oneOf) {
|
|
340
|
+
return {
|
|
341
|
+
...item,
|
|
342
|
+
selectedOption: item.selectedOption,
|
|
343
|
+
oneOf: item.oneOf.map((option) => ({
|
|
344
|
+
...option,
|
|
345
|
+
properties: option.properties ? Object.entries(option.properties).reduce(
|
|
346
|
+
(acc, [key, value]) => {
|
|
347
|
+
acc[key] = { ...value };
|
|
348
|
+
return acc;
|
|
349
|
+
},
|
|
350
|
+
{}
|
|
351
|
+
) : {}
|
|
352
|
+
}))
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
return item;
|
|
356
|
+
});
|
|
357
|
+
});
|
|
358
|
+
__expose({
|
|
359
|
+
localConfig
|
|
360
|
+
});
|
|
361
|
+
return (_ctx, _cache) => {
|
|
362
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
363
|
+
createBaseVNode("div", _hoisted_2$1, [
|
|
364
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(computedSchema.value, (item, index) => {
|
|
365
|
+
return openBlock(), createElementBlock("div", {
|
|
366
|
+
key: index,
|
|
367
|
+
class: "form-item-wrapper"
|
|
368
|
+
}, [
|
|
369
|
+
item.type === "array" ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
370
|
+
createBaseVNode("div", {
|
|
371
|
+
class: "compact-header",
|
|
372
|
+
onMouseover: ($event) => showPopover(item.description ?? "", $event),
|
|
373
|
+
onMouseleave: hidePopover
|
|
374
|
+
}, [
|
|
375
|
+
createTextVNode(toDisplayString(item.title || item.key) + " ", 1),
|
|
376
|
+
item.required ? (openBlock(), createElementBlock("span", _hoisted_5$1, "*")) : createCommentVNode("", true)
|
|
377
|
+
], 40, _hoisted_4$1),
|
|
378
|
+
createBaseVNode("div", _hoisted_6$1, [
|
|
379
|
+
createBaseVNode("div", _hoisted_7$1, [
|
|
380
|
+
withDirectives(createBaseVNode("input", {
|
|
381
|
+
"onUpdate:modelValue": ($event) => newArrayValue.value[item.key] = $event,
|
|
382
|
+
type: "text",
|
|
383
|
+
class: "minimal-input",
|
|
384
|
+
placeholder: `Add new ${item.title || item.key}`,
|
|
385
|
+
onKeyup: withKeys(($event) => addArrayValue(item), ["enter"])
|
|
386
|
+
}, null, 40, _hoisted_8$1), [
|
|
387
|
+
[vModelText, newArrayValue.value[item.key]]
|
|
388
|
+
]),
|
|
389
|
+
createBaseVNode("button", {
|
|
390
|
+
class: "add-btn",
|
|
391
|
+
type: "button",
|
|
392
|
+
onClick: ($event) => addArrayValue(item)
|
|
393
|
+
}, "Add", 8, _hoisted_9$1)
|
|
394
|
+
]),
|
|
395
|
+
createBaseVNode("div", _hoisted_10$1, [
|
|
396
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(getArrayValues(item), (value, valueIndex) => {
|
|
397
|
+
return openBlock(), createElementBlock("div", {
|
|
398
|
+
key: valueIndex,
|
|
399
|
+
class: "item-box"
|
|
400
|
+
}, [
|
|
401
|
+
createTextVNode(toDisplayString(value) + " ", 1),
|
|
402
|
+
createBaseVNode("span", {
|
|
403
|
+
class: "remove-btn",
|
|
404
|
+
onClick: ($event) => removeArrayValue(item, valueIndex)
|
|
405
|
+
}, "x", 8, _hoisted_11$1)
|
|
406
|
+
]);
|
|
407
|
+
}), 128))
|
|
408
|
+
])
|
|
409
|
+
])
|
|
410
|
+
])) : item.oneOf ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
|
|
411
|
+
createBaseVNode("div", {
|
|
412
|
+
class: "compact-header",
|
|
413
|
+
onMouseover: ($event) => showPopover(item.description ?? "", $event),
|
|
414
|
+
onMouseleave: hidePopover
|
|
415
|
+
}, [
|
|
416
|
+
createTextVNode(toDisplayString(item.title || item.key) + " ", 1),
|
|
417
|
+
item.required ? (openBlock(), createElementBlock("span", _hoisted_14$1, "*")) : createCommentVNode("", true)
|
|
418
|
+
], 40, _hoisted_13$1),
|
|
419
|
+
createVNode(DropDownGeneric, {
|
|
420
|
+
modelValue: selectedValues.value[index],
|
|
421
|
+
"onUpdate:modelValue": ($event) => selectedValues.value[index] = $event,
|
|
422
|
+
"option-list": item.oneOf.map((opt) => opt.title),
|
|
423
|
+
"allow-other": false,
|
|
424
|
+
style: { "width": "100%", "margin-bottom": "8px" },
|
|
425
|
+
onChange: (value) => updateSelectedOption(item, value, index)
|
|
426
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "option-list", "onChange"]),
|
|
427
|
+
item.selectedOption !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
428
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.oneOf[item.selectedOption].properties, (property, propKey) => {
|
|
429
|
+
return openBlock(), createElementBlock("div", {
|
|
430
|
+
key: propKey,
|
|
431
|
+
class: "nested-item"
|
|
432
|
+
}, [
|
|
433
|
+
propKey !== "auth_type" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
434
|
+
createBaseVNode("div", {
|
|
435
|
+
class: "compact-header",
|
|
436
|
+
onMouseover: ($event) => showPopover(property.description, $event),
|
|
437
|
+
onMouseleave: hidePopover
|
|
438
|
+
}, [
|
|
439
|
+
createTextVNode(toDisplayString(property.title || propKey) + " ", 1),
|
|
440
|
+
isRequired(item.oneOf[item.selectedOption], propKey) ? (openBlock(), createElementBlock("span", _hoisted_17, "*")) : createCommentVNode("", true)
|
|
441
|
+
], 40, _hoisted_16),
|
|
442
|
+
withDirectives(createBaseVNode("input", {
|
|
443
|
+
"onUpdate:modelValue": ($event) => item.input_value[propKey] = $event,
|
|
444
|
+
type: property.airbyte_secret ? "password" : "text",
|
|
445
|
+
class: "minimal-input",
|
|
446
|
+
placeholder: property.title || propKey
|
|
447
|
+
}, null, 8, _hoisted_18), [
|
|
448
|
+
[vModelDynamic, item.input_value[propKey]]
|
|
449
|
+
])
|
|
450
|
+
], 64)) : createCommentVNode("", true)
|
|
451
|
+
]);
|
|
452
|
+
}), 128))
|
|
453
|
+
])) : createCommentVNode("", true)
|
|
454
|
+
])) : !item.properties || item.properties.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_19, [
|
|
455
|
+
createBaseVNode("div", {
|
|
456
|
+
class: "compact-header",
|
|
457
|
+
onMouseover: ($event) => showPopover(item.description ?? "", $event),
|
|
458
|
+
onMouseleave: hidePopover
|
|
459
|
+
}, [
|
|
460
|
+
createTextVNode(toDisplayString(item.title || item.key) + " ", 1),
|
|
461
|
+
item.required ? (openBlock(), createElementBlock("span", _hoisted_21, "*")) : createCommentVNode("", true)
|
|
462
|
+
], 40, _hoisted_20),
|
|
463
|
+
withDirectives(createBaseVNode("input", {
|
|
464
|
+
"onUpdate:modelValue": ($event) => item.input_value = $event,
|
|
465
|
+
type: item.airbyte_secret ? "password" : "text",
|
|
466
|
+
class: "minimal-input",
|
|
467
|
+
placeholder: item.title || item.key
|
|
468
|
+
}, null, 8, _hoisted_22), [
|
|
469
|
+
[vModelDynamic, item.input_value]
|
|
470
|
+
])
|
|
471
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_23, [
|
|
472
|
+
createBaseVNode("button", {
|
|
473
|
+
class: normalizeClass(["minimal-header", { "is-open": item.isOpen }]),
|
|
474
|
+
onClick: ($event) => toggle(index)
|
|
475
|
+
}, [
|
|
476
|
+
createBaseVNode("span", _hoisted_25, toDisplayString(item.isOpen ? "−" : "+"), 1),
|
|
477
|
+
createTextVNode(" " + toDisplayString(item.title) + " ", 1),
|
|
478
|
+
item.required ? (openBlock(), createElementBlock("span", _hoisted_26, "*")) : createCommentVNode("", true)
|
|
479
|
+
], 10, _hoisted_24),
|
|
480
|
+
item.isOpen && item.properties && item.properties.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_27, [
|
|
481
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(item.properties, (property, propIndex) => {
|
|
482
|
+
return openBlock(), createElementBlock("div", {
|
|
483
|
+
key: propIndex,
|
|
484
|
+
class: "nested-item"
|
|
485
|
+
}, [
|
|
486
|
+
createBaseVNode("div", {
|
|
487
|
+
class: "compact-header",
|
|
488
|
+
onMouseover: ($event) => showPopover(property.description, $event),
|
|
489
|
+
onMouseleave: hidePopover
|
|
490
|
+
}, [
|
|
491
|
+
createTextVNode(toDisplayString(property.key) + " ", 1),
|
|
492
|
+
property.required ? (openBlock(), createElementBlock("span", _hoisted_29, "*")) : createCommentVNode("", true)
|
|
493
|
+
], 40, _hoisted_28),
|
|
494
|
+
withDirectives(createBaseVNode("input", {
|
|
495
|
+
"onUpdate:modelValue": ($event) => property.input_value = $event,
|
|
496
|
+
type: property.airbyte_secret ? "password" : "text",
|
|
497
|
+
class: "minimal-input",
|
|
498
|
+
placeholder: property.key
|
|
499
|
+
}, null, 8, _hoisted_30), [
|
|
500
|
+
[vModelDynamic, property.input_value]
|
|
501
|
+
])
|
|
502
|
+
]);
|
|
503
|
+
}), 128))
|
|
504
|
+
])) : createCommentVNode("", true)
|
|
505
|
+
]))
|
|
506
|
+
]);
|
|
507
|
+
}), 128))
|
|
508
|
+
]),
|
|
509
|
+
popover.value.show ? (openBlock(), createElementBlock("div", {
|
|
510
|
+
key: 0,
|
|
511
|
+
class: "minimal-popover",
|
|
512
|
+
style: normalizeStyle({ top: popover.value.y + "px", left: popover.value.x + "px" })
|
|
513
|
+
}, toDisplayString(popover.value.content), 5)) : createCommentVNode("", true)
|
|
514
|
+
]);
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
const airbyteConfigForm_vue_vue_type_style_index_0_scoped_b2f2d704_lang = "";
|
|
519
|
+
const AirbyteForm = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b2f2d704"]]);
|
|
520
|
+
const _hoisted_1 = { key: 0 };
|
|
521
|
+
const _hoisted_2 = { class: "listbox-wrapper to-front" };
|
|
522
|
+
const _hoisted_3 = { key: 0 };
|
|
523
|
+
const _hoisted_4 = { class: "listbox-subtitle flex justify-between items-center" };
|
|
524
|
+
const _hoisted_5 = { class: "flex items-center gap-2" };
|
|
525
|
+
const _hoisted_6 = { class: "material-icons" };
|
|
526
|
+
const _hoisted_7 = { class: "flex gap-2" };
|
|
527
|
+
const _hoisted_8 = ["disabled"];
|
|
528
|
+
const _hoisted_9 = { class: "material-icons" };
|
|
529
|
+
const _hoisted_10 = {
|
|
530
|
+
key: 1,
|
|
531
|
+
class: "config-section"
|
|
532
|
+
};
|
|
533
|
+
const _hoisted_11 = {
|
|
534
|
+
key: 1,
|
|
535
|
+
class: "stream-section"
|
|
536
|
+
};
|
|
537
|
+
const _hoisted_12 = ["disabled"];
|
|
538
|
+
const _hoisted_13 = {
|
|
539
|
+
key: 2,
|
|
540
|
+
class: "stream-section"
|
|
541
|
+
};
|
|
542
|
+
const _hoisted_14 = {
|
|
543
|
+
key: 1,
|
|
544
|
+
class: "config-section"
|
|
545
|
+
};
|
|
546
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
547
|
+
__name: "airbyteReader",
|
|
548
|
+
props: {
|
|
549
|
+
nodeId: {}
|
|
550
|
+
},
|
|
551
|
+
setup(__props, { expose: __expose }) {
|
|
552
|
+
const nodeStore = useNodeStore();
|
|
553
|
+
const nodeExternalSource = ref(null);
|
|
554
|
+
const backupAirbyteConfig = ref(null);
|
|
555
|
+
const sourceSelected = ref(false);
|
|
556
|
+
const availableConnectors = ref([]);
|
|
557
|
+
const isConfigCollapsed = ref(false);
|
|
558
|
+
const availableConfigs = ref([]);
|
|
559
|
+
const loadedConnectors = ref(false);
|
|
560
|
+
const connectorSelected = ref(false);
|
|
561
|
+
const initialSelectedStream = ref(null);
|
|
562
|
+
const inputValues = ref(null);
|
|
563
|
+
const selectedConnector = ref("");
|
|
564
|
+
const isFetchingStreams = ref(false);
|
|
565
|
+
const isValidating = ref(false);
|
|
566
|
+
const validationMessage = ref("");
|
|
567
|
+
const validationStatus = ref("success");
|
|
568
|
+
const airbyteConfigTemplate = ref(null);
|
|
569
|
+
const airbyteConfig = ref(null);
|
|
570
|
+
const getConnectors = async () => {
|
|
571
|
+
availableConnectors.value = await getAirbyteConnectors();
|
|
572
|
+
loadedConnectors.value = true;
|
|
573
|
+
};
|
|
574
|
+
const getAvailableConfigs = async () => {
|
|
575
|
+
availableConfigs.value = await getAirbyteAvailableConfigs();
|
|
576
|
+
};
|
|
577
|
+
getAvailableConfigs();
|
|
578
|
+
getConnectors();
|
|
579
|
+
const validateConfig = async () => {
|
|
580
|
+
var _a;
|
|
581
|
+
if (!((_a = airbyteConfig.value) == null ? void 0 : _a.parsed_config))
|
|
582
|
+
return;
|
|
583
|
+
isValidating.value = true;
|
|
584
|
+
validationMessage.value = "";
|
|
585
|
+
try {
|
|
586
|
+
await validateSelection();
|
|
587
|
+
validationStatus.value = "success";
|
|
588
|
+
validationMessage.value = "Configuration validated successfully";
|
|
589
|
+
} catch (error) {
|
|
590
|
+
validationStatus.value = "error";
|
|
591
|
+
validationMessage.value = error instanceof Error ? error.message : "Validation failed";
|
|
592
|
+
} finally {
|
|
593
|
+
isValidating.value = false;
|
|
594
|
+
setTimeout(() => {
|
|
595
|
+
validationMessage.value = "";
|
|
596
|
+
}, 5e3);
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
const resetConfig = async () => {
|
|
600
|
+
if (!confirm("Are you sure you want to reset all settings? This cannot be undone.") || !backupAirbyteConfig.value)
|
|
601
|
+
return;
|
|
602
|
+
if (!backupAirbyteConfig.value) {
|
|
603
|
+
console.error("Backup config is missing");
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
airbyteConfig.value = { ...backupAirbyteConfig.value };
|
|
607
|
+
selectedConnector.value = backupAirbyteConfig.value.source_name;
|
|
608
|
+
initialSelectedStream.value = backupAirbyteConfig.value.selected_stream;
|
|
609
|
+
const connectorInputData = await getAirbyteConnectorTemplate(selectedConnector.value);
|
|
610
|
+
if (!connectorInputData)
|
|
611
|
+
return;
|
|
612
|
+
airbyteConfigTemplate.value = connectorInputData;
|
|
613
|
+
sourceSelected.value = true;
|
|
614
|
+
};
|
|
615
|
+
const fetchAvailableStreams = async () => {
|
|
616
|
+
var _a;
|
|
617
|
+
if (!((_a = airbyteConfig.value) == null ? void 0 : _a.parsed_config))
|
|
618
|
+
return;
|
|
619
|
+
isFetchingStreams.value = true;
|
|
620
|
+
try {
|
|
621
|
+
inputValues.value = getConfigSettings(airbyteConfig.value.parsed_config);
|
|
622
|
+
airbyteConfig.value.mapped_config_spec = inputValues.value;
|
|
623
|
+
await setAirbyteConfigGetStreams(airbyteConfig.value);
|
|
624
|
+
airbyteConfigTemplate.value = await getAirbyteConnectorTemplate(selectedConnector.value);
|
|
625
|
+
} catch (error) {
|
|
626
|
+
console.error("Error fetching streams:", error);
|
|
627
|
+
} finally {
|
|
628
|
+
isFetchingStreams.value = false;
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
const loadNodeData = async (nodeId) => {
|
|
632
|
+
var _a;
|
|
633
|
+
const nodeResult = await nodeStore.getNodeData(nodeId, false);
|
|
634
|
+
nodeExternalSource.value = nodeResult == null ? void 0 : nodeResult.setting_input;
|
|
635
|
+
if (!((_a = nodeExternalSource.value) == null ? void 0 : _a.is_setup) || !nodeExternalSource.value.source_settings)
|
|
636
|
+
return;
|
|
637
|
+
airbyteConfig.value = nodeExternalSource.value.source_settings;
|
|
638
|
+
backupAirbyteConfig.value = { ...airbyteConfig.value };
|
|
639
|
+
selectedConnector.value = airbyteConfig.value.source_name;
|
|
640
|
+
sourceSelected.value = true;
|
|
641
|
+
initialSelectedStream.value = airbyteConfig.value.selected_stream;
|
|
642
|
+
const connectorInputData = await getAirbyteConnectorTemplate(selectedConnector.value);
|
|
643
|
+
if (!connectorInputData)
|
|
644
|
+
return;
|
|
645
|
+
airbyteConfigTemplate.value = connectorInputData;
|
|
646
|
+
if (!airbyteConfig.value.parsed_config) {
|
|
647
|
+
airbyteConfig.value.parsed_config = computeSchema(airbyteConfigTemplate.value.config_spec);
|
|
648
|
+
}
|
|
649
|
+
if (!connectorInputData.available_streams && airbyteConfig.value.parsed_config) {
|
|
650
|
+
await fetchAvailableStreams();
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
const selectConnector = () => {
|
|
654
|
+
var _a;
|
|
655
|
+
if (((_a = airbyteConfig.value) == null ? void 0 : _a.source_name) === selectedConnector.value)
|
|
656
|
+
return;
|
|
657
|
+
if (availableConfigs.value.includes("source-" + selectedConnector.value)) {
|
|
658
|
+
getConfig();
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
sourceSelected.value = false;
|
|
662
|
+
connectorSelected.value = true;
|
|
663
|
+
airbyteConfigTemplate.value = null;
|
|
664
|
+
airbyteConfig.value = null;
|
|
665
|
+
};
|
|
666
|
+
const getConfig = async () => {
|
|
667
|
+
connectorSelected.value = false;
|
|
668
|
+
sourceSelected.value = true;
|
|
669
|
+
const connectorInputData = await getAirbyteConnectorTemplate(selectedConnector.value);
|
|
670
|
+
if (!connectorInputData)
|
|
671
|
+
return;
|
|
672
|
+
airbyteConfigTemplate.value = connectorInputData;
|
|
673
|
+
const parsed_config = computeSchema(airbyteConfigTemplate.value.config_spec);
|
|
674
|
+
airbyteConfig.value = {
|
|
675
|
+
parsed_config,
|
|
676
|
+
mapped_config_spec: {},
|
|
677
|
+
config_mode: "in_line",
|
|
678
|
+
selected_stream: "",
|
|
679
|
+
source_name: selectedConnector.value
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
const validateSelection = async () => {
|
|
683
|
+
if (!nodeExternalSource.value || !airbyteConfig.value)
|
|
684
|
+
throw new Error("Invalid configuration");
|
|
685
|
+
nodeExternalSource.value.is_setup = true;
|
|
686
|
+
nodeExternalSource.value.source_settings = airbyteConfig.value;
|
|
687
|
+
nodeExternalSource.value.source_settings.mapped_config_spec = getConfigSettings(
|
|
688
|
+
airbyteConfig.value.parsed_config
|
|
689
|
+
);
|
|
690
|
+
if (initialSelectedStream.value != airbyteConfig.value.selected_stream) {
|
|
691
|
+
nodeExternalSource.value.source_settings.fields = [];
|
|
692
|
+
}
|
|
693
|
+
await nodeStore.updateSettings(nodeExternalSource);
|
|
694
|
+
};
|
|
695
|
+
const pushNodeData = async () => {
|
|
696
|
+
if (!nodeExternalSource.value || !airbyteConfig.value)
|
|
697
|
+
return;
|
|
698
|
+
nodeExternalSource.value.is_setup = true;
|
|
699
|
+
nodeExternalSource.value.source_settings = airbyteConfig.value;
|
|
700
|
+
nodeExternalSource.value.source_settings.mapped_config_spec = getConfigSettings(
|
|
701
|
+
airbyteConfig.value.parsed_config
|
|
702
|
+
);
|
|
703
|
+
if (initialSelectedStream.value != airbyteConfig.value.selected_stream) {
|
|
704
|
+
nodeExternalSource.value.source_settings.fields = [];
|
|
705
|
+
}
|
|
706
|
+
await nodeStore.updateSettings(nodeExternalSource);
|
|
707
|
+
};
|
|
708
|
+
__expose({
|
|
709
|
+
loadNodeData,
|
|
710
|
+
pushNodeData
|
|
711
|
+
});
|
|
712
|
+
return (_ctx, _cache) => {
|
|
713
|
+
const _component_el_option = resolveComponent("el-option");
|
|
714
|
+
const _component_el_select = resolveComponent("el-select");
|
|
715
|
+
return nodeExternalSource.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
716
|
+
createVNode(GenericNodeSettings, {
|
|
717
|
+
modelValue: nodeExternalSource.value,
|
|
718
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => nodeExternalSource.value = $event)
|
|
719
|
+
}, {
|
|
720
|
+
default: withCtx(() => {
|
|
721
|
+
var _a, _b, _c, _d;
|
|
722
|
+
return [
|
|
723
|
+
_cache[8] || (_cache[8] = createBaseVNode("div", { class: "listbox-wrapper" }, [
|
|
724
|
+
createBaseVNode("div", { class: "listbox-subtitle" }, [
|
|
725
|
+
createBaseVNode("img", {
|
|
726
|
+
src: _imports_0,
|
|
727
|
+
alt: "Airbyte Icon",
|
|
728
|
+
class: "file-icon"
|
|
729
|
+
}),
|
|
730
|
+
createBaseVNode("span", null, "Get data from Airbyte supported source")
|
|
731
|
+
]),
|
|
732
|
+
createBaseVNode("div", { class: "attention-notice" }, [
|
|
733
|
+
createBaseVNode("span", { class: "warning-icon" }, "⚠️"),
|
|
734
|
+
createBaseVNode("span", { class: "docker-notice" }, "Running Docker instance required")
|
|
735
|
+
])
|
|
736
|
+
], -1)),
|
|
737
|
+
createBaseVNode("div", _hoisted_2, [
|
|
738
|
+
createVNode(DropDownGeneric, {
|
|
739
|
+
modelValue: selectedConnector.value,
|
|
740
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedConnector.value = $event),
|
|
741
|
+
"option-list": availableConnectors.value,
|
|
742
|
+
title: "Load data from",
|
|
743
|
+
"is-loading": !loadedConnectors.value,
|
|
744
|
+
"allow-other": false,
|
|
745
|
+
onChange: selectConnector
|
|
746
|
+
}, null, 8, ["modelValue", "option-list", "is-loading"])
|
|
747
|
+
]),
|
|
748
|
+
sourceSelected.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
749
|
+
createBaseVNode("div", _hoisted_4, [
|
|
750
|
+
createBaseVNode("div", _hoisted_5, [
|
|
751
|
+
_cache[4] || (_cache[4] = createBaseVNode("span", null, "Config settings", -1)),
|
|
752
|
+
createBaseVNode("button", {
|
|
753
|
+
class: "icon-button",
|
|
754
|
+
onClick: _cache[1] || (_cache[1] = ($event) => isConfigCollapsed.value = !isConfigCollapsed.value)
|
|
755
|
+
}, [
|
|
756
|
+
createBaseVNode("span", _hoisted_6, toDisplayString(isConfigCollapsed.value ? "expand_more" : "expand_less"), 1)
|
|
757
|
+
])
|
|
758
|
+
]),
|
|
759
|
+
createBaseVNode("div", _hoisted_7, [
|
|
760
|
+
((_a = airbyteConfig.value) == null ? void 0 : _a.parsed_config) ? (openBlock(), createElementBlock("button", {
|
|
761
|
+
key: 0,
|
|
762
|
+
class: "secondary-button",
|
|
763
|
+
onClick: resetConfig
|
|
764
|
+
}, _cache[5] || (_cache[5] = [
|
|
765
|
+
createTextVNode(" Reset settings "),
|
|
766
|
+
createBaseVNode("span", { class: "material-icons" }, "restart_alt", -1)
|
|
767
|
+
]))) : createCommentVNode("", true),
|
|
768
|
+
((_b = airbyteConfig.value) == null ? void 0 : _b.parsed_config) ? (openBlock(), createElementBlock("button", {
|
|
769
|
+
key: 1,
|
|
770
|
+
class: "secondary-button",
|
|
771
|
+
disabled: isValidating.value,
|
|
772
|
+
onClick: validateConfig
|
|
773
|
+
}, [
|
|
774
|
+
createTextVNode(toDisplayString(isValidating.value ? "Validating..." : "Validate") + " ", 1),
|
|
775
|
+
createBaseVNode("span", {
|
|
776
|
+
class: normalizeClass(["material-icons", { spin: isValidating.value }])
|
|
777
|
+
}, "check_circle", 2)
|
|
778
|
+
], 8, _hoisted_8)) : createCommentVNode("", true)
|
|
779
|
+
])
|
|
780
|
+
]),
|
|
781
|
+
validationMessage.value ? (openBlock(), createElementBlock("div", {
|
|
782
|
+
key: 0,
|
|
783
|
+
class: normalizeClass(["validation-banner", validationStatus.value])
|
|
784
|
+
}, [
|
|
785
|
+
createBaseVNode("span", _hoisted_9, toDisplayString(validationStatus.value === "success" ? "check_circle" : "warning"), 1),
|
|
786
|
+
createTextVNode(" " + toDisplayString(validationMessage.value), 1)
|
|
787
|
+
], 2)) : createCommentVNode("", true),
|
|
788
|
+
((_c = airbyteConfig.value) == null ? void 0 : _c.parsed_config) ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
789
|
+
!isConfigCollapsed.value ? (openBlock(), createBlock(AirbyteForm, {
|
|
790
|
+
key: 0,
|
|
791
|
+
ref: "airbyteForm",
|
|
792
|
+
"parsed-config": airbyteConfig.value.parsed_config
|
|
793
|
+
}, null, 8, ["parsed-config"])) : createCommentVNode("", true),
|
|
794
|
+
!((_d = airbyteConfigTemplate.value) == null ? void 0 : _d.available_streams) ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
795
|
+
createBaseVNode("button", {
|
|
796
|
+
class: "primary-button",
|
|
797
|
+
disabled: isFetchingStreams.value,
|
|
798
|
+
onClick: fetchAvailableStreams
|
|
799
|
+
}, [
|
|
800
|
+
createTextVNode(toDisplayString(isFetchingStreams.value ? "Loading streams..." : "Load available streams") + " ", 1),
|
|
801
|
+
createBaseVNode("span", {
|
|
802
|
+
class: normalizeClass(["material-icons", { spin: isFetchingStreams.value }])
|
|
803
|
+
}, "refresh", 2)
|
|
804
|
+
], 8, _hoisted_12)
|
|
805
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
806
|
+
_cache[6] || (_cache[6] = createBaseVNode("div", { class: "listbox-subtitle" }, [
|
|
807
|
+
createBaseVNode("span", null, "Select stream")
|
|
808
|
+
], -1)),
|
|
809
|
+
createVNode(_component_el_select, {
|
|
810
|
+
modelValue: airbyteConfig.value.selected_stream,
|
|
811
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => airbyteConfig.value.selected_stream = $event),
|
|
812
|
+
placeholder: "Select a stream",
|
|
813
|
+
size: "small",
|
|
814
|
+
class: "stream-select"
|
|
815
|
+
}, {
|
|
816
|
+
default: withCtx(() => [
|
|
817
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(airbyteConfigTemplate.value.available_streams, (stream) => {
|
|
818
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
819
|
+
key: stream,
|
|
820
|
+
label: stream,
|
|
821
|
+
value: stream
|
|
822
|
+
}, null, 8, ["label", "value"]);
|
|
823
|
+
}), 128))
|
|
824
|
+
]),
|
|
825
|
+
_: 1
|
|
826
|
+
}, 8, ["modelValue"])
|
|
827
|
+
]))
|
|
828
|
+
])) : (openBlock(), createBlock(unref(CodeLoader), { key: 2 }))
|
|
829
|
+
])) : connectorSelected.value ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
830
|
+
createBaseVNode("button", {
|
|
831
|
+
class: "file-upload-label",
|
|
832
|
+
onClick: getConfig
|
|
833
|
+
}, _cache[7] || (_cache[7] = [
|
|
834
|
+
createTextVNode(" Load settings "),
|
|
835
|
+
createBaseVNode("span", { class: "material-icons file-icon" }, "refresh", -1)
|
|
836
|
+
]))
|
|
837
|
+
])) : createCommentVNode("", true)
|
|
838
|
+
];
|
|
839
|
+
}),
|
|
840
|
+
_: 1
|
|
841
|
+
}, 8, ["modelValue"])
|
|
842
|
+
])) : createCommentVNode("", true);
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
const airbyteReader_vue_vue_type_style_index_0_scoped_9dcbd94f_lang = "";
|
|
847
|
+
const airbyteSource = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-9dcbd94f"]]);
|
|
848
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
849
|
+
__name: "AirbyteReader",
|
|
850
|
+
props: {
|
|
851
|
+
nodeId: {
|
|
852
|
+
type: Number,
|
|
853
|
+
required: true
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
setup(__props) {
|
|
857
|
+
const nodeStore = useNodeStore();
|
|
858
|
+
const props = __props;
|
|
859
|
+
const childComp = ref(null);
|
|
860
|
+
const el = ref(null);
|
|
861
|
+
const drawer = ref(false);
|
|
862
|
+
const closeOnDrawer = () => {
|
|
863
|
+
var _a;
|
|
864
|
+
(_a = childComp.value) == null ? void 0 : _a.pushNodeData();
|
|
865
|
+
drawer.value = false;
|
|
866
|
+
nodeStore.isDrawerOpen = false;
|
|
867
|
+
};
|
|
868
|
+
const openDrawer = async () => {
|
|
869
|
+
if (nodeStore.node_id === props.nodeId) {
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
console.log("openDrawer");
|
|
873
|
+
drawer.value = true;
|
|
874
|
+
const drawerOpen = nodeStore.isDrawerOpen;
|
|
875
|
+
nodeStore.isDrawerOpen = true;
|
|
876
|
+
await nextTick();
|
|
877
|
+
if (nodeStore.node_id === props.nodeId && drawerOpen) {
|
|
878
|
+
console.log("No need to load data");
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
if (childComp.value) {
|
|
882
|
+
await childComp.value.loadNodeData(props.nodeId);
|
|
883
|
+
nodeStore.openDrawer(closeOnDrawer);
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
onMounted(async () => {
|
|
887
|
+
await nextTick();
|
|
888
|
+
});
|
|
889
|
+
return (_ctx, _cache) => {
|
|
890
|
+
return openBlock(), createElementBlock("div", {
|
|
891
|
+
ref_key: "el",
|
|
892
|
+
ref: el
|
|
893
|
+
}, [
|
|
894
|
+
createVNode(NodeButton, {
|
|
895
|
+
ref: "nodeButton",
|
|
896
|
+
"node-id": __props.nodeId,
|
|
897
|
+
"image-src": "airbyte.png",
|
|
898
|
+
title: `${__props.nodeId}: External source`,
|
|
899
|
+
onClick: openDrawer
|
|
900
|
+
}, null, 8, ["node-id", "title"]),
|
|
901
|
+
drawer.value ? (openBlock(), createBlock(Teleport, {
|
|
902
|
+
key: 0,
|
|
903
|
+
to: "#nodesettings"
|
|
904
|
+
}, [
|
|
905
|
+
createVNode(NodeTitle, {
|
|
906
|
+
title: "External source",
|
|
907
|
+
intro: "Import data from an external source"
|
|
908
|
+
}),
|
|
909
|
+
createVNode(airbyteSource, {
|
|
910
|
+
ref_key: "childComp",
|
|
911
|
+
ref: childComp,
|
|
912
|
+
"node-id": __props.nodeId
|
|
913
|
+
}, null, 8, ["node-id"])
|
|
914
|
+
])) : createCommentVNode("", true)
|
|
915
|
+
], 512);
|
|
916
|
+
};
|
|
917
|
+
}
|
|
918
|
+
});
|
|
919
|
+
export {
|
|
920
|
+
_sfc_main as default
|
|
921
|
+
};
|