Flowfile 0.3.5__py3-none-any.whl → 0.3.7__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 +27 -6
- flowfile/api.py +1 -0
- flowfile/web/__init__.py +2 -2
- flowfile/web/static/assets/CloudConnectionManager-2dfdce2f.css +86 -0
- flowfile/web/static/assets/CloudConnectionManager-c20a740f.js +783 -0
- flowfile/web/static/assets/CloudStorageReader-29d14fcc.css +143 -0
- flowfile/web/static/assets/CloudStorageReader-960b400a.js +437 -0
- flowfile/web/static/assets/CloudStorageWriter-49c9a4b2.css +138 -0
- flowfile/web/static/assets/CloudStorageWriter-e3decbdd.js +430 -0
- flowfile/web/static/assets/{CrossJoin-dfcf7351.js → CrossJoin-d67e2405.js} +8 -8
- flowfile/web/static/assets/{DatabaseConnectionSettings-b2afb1d7.js → DatabaseConnectionSettings-a81e0f7e.js} +2 -2
- flowfile/web/static/assets/{DatabaseManager-824a49b2.js → DatabaseManager-9ea35e84.js} +2 -2
- flowfile/web/static/assets/{DatabaseReader-a48124d8.js → DatabaseReader-9578bfa5.js} +9 -9
- flowfile/web/static/assets/{DatabaseWriter-b47cbae2.js → DatabaseWriter-19531098.js} +9 -9
- flowfile/web/static/assets/{ExploreData-fdfc45a4.js → ExploreData-40476474.js} +47141 -43697
- flowfile/web/static/assets/{ExternalSource-861b0e71.js → ExternalSource-2297ef96.js} +6 -6
- flowfile/web/static/assets/{Filter-f87bb897.js → Filter-f211c03a.js} +8 -8
- flowfile/web/static/assets/{Formula-b8cefc31.css → Formula-29f19d21.css} +10 -0
- flowfile/web/static/assets/{Formula-1e2ed720.js → Formula-4207ea31.js} +75 -9
- flowfile/web/static/assets/{FuzzyMatch-b6cc4fdd.js → FuzzyMatch-bf120df0.js} +9 -9
- flowfile/web/static/assets/{GraphSolver-6a371f4c.js → GraphSolver-5bb7497a.js} +5 -5
- flowfile/web/static/assets/{GroupBy-f7b7f472.js → GroupBy-92c81b65.js} +6 -6
- flowfile/web/static/assets/{Join-eec38203.js → Join-4e49a274.js} +23 -15
- flowfile/web/static/assets/{Join-41c0f331.css → Join-f45eff22.css} +20 -20
- flowfile/web/static/assets/{ManualInput-9aaa46fb.js → ManualInput-90998ae8.js} +106 -34
- flowfile/web/static/assets/{ManualInput-ac7b9972.css → ManualInput-a71b52c6.css} +29 -17
- flowfile/web/static/assets/{Output-3b2ca045.js → Output-81e3e917.js} +4 -4
- flowfile/web/static/assets/{Pivot-a4f5d88f.js → Pivot-a3419842.js} +6 -6
- flowfile/web/static/assets/{PolarsCode-49ce444f.js → PolarsCode-72710deb.js} +6 -6
- flowfile/web/static/assets/{Read-07acdc9a.js → Read-c4059daf.js} +6 -6
- flowfile/web/static/assets/{RecordCount-6a21da56.js → RecordCount-c2b5e095.js} +5 -5
- flowfile/web/static/assets/{RecordId-949bdc17.js → RecordId-10baf191.js} +6 -6
- flowfile/web/static/assets/{Sample-7afca6e1.js → Sample-3ed9a0ae.js} +5 -5
- flowfile/web/static/assets/{SecretManager-b41c029d.js → SecretManager-0d49c0e8.js} +2 -2
- flowfile/web/static/assets/{Select-32b28406.js → Select-8a02a0b3.js} +8 -8
- flowfile/web/static/assets/{SettingsSection-a0f15a05.js → SettingsSection-4c0f45f5.js} +1 -1
- flowfile/web/static/assets/{Sort-fc6ba0e2.js → Sort-f55c9f9d.js} +6 -6
- flowfile/web/static/assets/{TextToRows-23127596.js → TextToRows-5dbc2145.js} +8 -8
- flowfile/web/static/assets/{UnavailableFields-c42880a3.js → UnavailableFields-a1768e52.js} +2 -2
- flowfile/web/static/assets/{Union-39eecc6c.js → Union-f2aefdc9.js} +5 -5
- flowfile/web/static/assets/{Unique-a0e8fe61.js → Unique-46b250da.js} +8 -8
- flowfile/web/static/assets/{Unpivot-1e2d43f0.js → Unpivot-25ac84cc.js} +5 -5
- flowfile/web/static/assets/api-6ef0dcef.js +80 -0
- flowfile/web/static/assets/{api-44ca9e9c.js → api-a0abbdc7.js} +1 -1
- flowfile/web/static/assets/cloud_storage_reader-aa1415d6.png +0 -0
- flowfile/web/static/assets/{designer-267d44f1.js → designer-13eabd83.js} +36 -34
- flowfile/web/static/assets/{documentation-6c0810a2.js → documentation-b87e7f6f.js} +1 -1
- flowfile/web/static/assets/{dropDown-52790b15.js → dropDown-13564764.js} +1 -1
- flowfile/web/static/assets/{fullEditor-e272b506.js → fullEditor-fd2cd6f9.js} +2 -2
- flowfile/web/static/assets/{genericNodeSettings-4bdcf98e.js → genericNodeSettings-71e11604.js} +3 -3
- flowfile/web/static/assets/{index-e235a8bc.js → index-f6c15e76.js} +59 -22
- flowfile/web/static/assets/{nodeTitle-fc3fc4b7.js → nodeTitle-988d9efe.js} +3 -3
- flowfile/web/static/assets/{secretApi-cdc2a3fd.js → secretApi-dd636aa2.js} +1 -1
- flowfile/web/static/assets/{selectDynamic-96aa82cd.js → selectDynamic-af36165e.js} +3 -3
- flowfile/web/static/assets/{vue-codemirror.esm-25e75a08.js → vue-codemirror.esm-2847001e.js} +2 -1
- flowfile/web/static/assets/{vue-content-loader.es-6c4b1c24.js → vue-content-loader.es-0371da73.js} +1 -1
- flowfile/web/static/index.html +1 -1
- {flowfile-0.3.5.dist-info → flowfile-0.3.7.dist-info}/METADATA +9 -4
- {flowfile-0.3.5.dist-info → flowfile-0.3.7.dist-info}/RECORD +131 -124
- {flowfile-0.3.5.dist-info → flowfile-0.3.7.dist-info}/entry_points.txt +2 -0
- flowfile_core/__init__.py +3 -0
- flowfile_core/auth/jwt.py +39 -0
- flowfile_core/configs/node_store/nodes.py +9 -6
- flowfile_core/configs/settings.py +6 -5
- flowfile_core/database/connection.py +63 -15
- flowfile_core/database/init_db.py +0 -1
- flowfile_core/database/models.py +49 -2
- flowfile_core/flowfile/code_generator/code_generator.py +472 -17
- flowfile_core/flowfile/connection_manager/models.py +1 -1
- flowfile_core/flowfile/database_connection_manager/db_connections.py +216 -2
- flowfile_core/flowfile/extensions.py +1 -1
- flowfile_core/flowfile/flow_data_engine/cloud_storage_reader.py +259 -0
- flowfile_core/flowfile/flow_data_engine/create/funcs.py +19 -8
- flowfile_core/flowfile/flow_data_engine/flow_data_engine.py +1062 -311
- flowfile_core/flowfile/flow_data_engine/flow_file_column/main.py +12 -2
- flowfile_core/flowfile/flow_data_engine/fuzzy_matching/settings_validator.py +1 -1
- flowfile_core/flowfile/flow_data_engine/join/__init__.py +2 -1
- flowfile_core/flowfile/flow_data_engine/join/utils.py +25 -0
- flowfile_core/flowfile/flow_data_engine/polars_code_parser.py +3 -1
- flowfile_core/flowfile/flow_data_engine/subprocess_operations/subprocess_operations.py +29 -22
- flowfile_core/flowfile/flow_data_engine/utils.py +1 -40
- flowfile_core/flowfile/flow_graph.py +718 -253
- flowfile_core/flowfile/flow_graph_utils.py +2 -2
- flowfile_core/flowfile/flow_node/flow_node.py +563 -117
- flowfile_core/flowfile/flow_node/models.py +154 -20
- flowfile_core/flowfile/flow_node/schema_callback.py +3 -2
- flowfile_core/flowfile/handler.py +2 -33
- flowfile_core/flowfile/manage/open_flowfile.py +1 -2
- flowfile_core/flowfile/sources/external_sources/__init__.py +0 -2
- flowfile_core/flowfile/sources/external_sources/factory.py +4 -7
- flowfile_core/flowfile/util/calculate_layout.py +0 -2
- flowfile_core/flowfile/utils.py +35 -26
- flowfile_core/main.py +35 -15
- flowfile_core/routes/cloud_connections.py +77 -0
- flowfile_core/routes/logs.py +2 -7
- flowfile_core/routes/public.py +1 -0
- flowfile_core/routes/routes.py +130 -90
- flowfile_core/routes/secrets.py +72 -14
- flowfile_core/schemas/__init__.py +8 -0
- flowfile_core/schemas/cloud_storage_schemas.py +215 -0
- flowfile_core/schemas/input_schema.py +121 -71
- flowfile_core/schemas/output_model.py +19 -3
- flowfile_core/schemas/schemas.py +150 -12
- flowfile_core/schemas/transform_schema.py +175 -35
- flowfile_core/utils/utils.py +40 -1
- flowfile_core/utils/validate_setup.py +41 -0
- flowfile_frame/__init__.py +9 -1
- flowfile_frame/cloud_storage/frame_helpers.py +39 -0
- flowfile_frame/cloud_storage/secret_manager.py +73 -0
- flowfile_frame/expr.py +28 -1
- flowfile_frame/expr.pyi +76 -61
- flowfile_frame/flow_frame.py +481 -208
- flowfile_frame/flow_frame.pyi +140 -91
- flowfile_frame/flow_frame_methods.py +160 -22
- flowfile_frame/group_frame.py +3 -0
- flowfile_frame/utils.py +25 -3
- flowfile_worker/external_sources/s3_source/main.py +216 -0
- flowfile_worker/external_sources/s3_source/models.py +142 -0
- flowfile_worker/funcs.py +51 -6
- flowfile_worker/models.py +22 -2
- flowfile_worker/routes.py +40 -38
- flowfile_worker/utils.py +1 -1
- test_utils/s3/commands.py +46 -0
- test_utils/s3/data_generator.py +292 -0
- test_utils/s3/demo_data_generator.py +186 -0
- test_utils/s3/fixtures.py +214 -0
- flowfile/web/static/assets/AirbyteReader-1ac35765.css +0 -314
- flowfile/web/static/assets/AirbyteReader-e08044e5.js +0 -922
- flowfile/web/static/assets/dropDownGeneric-60f56a8a.js +0 -72
- flowfile/web/static/assets/dropDownGeneric-895680d6.css +0 -10
- flowfile_core/flowfile/sources/external_sources/airbyte_sources/airbyte.py +0 -159
- flowfile_core/flowfile/sources/external_sources/airbyte_sources/models.py +0 -172
- flowfile_core/flowfile/sources/external_sources/airbyte_sources/settings.py +0 -173
- flowfile_core/schemas/defaults.py +0 -9
- flowfile_core/schemas/external_sources/airbyte_schemas.py +0 -20
- flowfile_core/schemas/models.py +0 -193
- flowfile_worker/external_sources/airbyte_sources/cache_manager.py +0 -161
- flowfile_worker/external_sources/airbyte_sources/main.py +0 -89
- flowfile_worker/external_sources/airbyte_sources/models.py +0 -133
- flowfile_worker/external_sources/airbyte_sources/settings.py +0 -0
- {flowfile-0.3.5.dist-info → flowfile-0.3.7.dist-info}/LICENSE +0 -0
- {flowfile-0.3.5.dist-info → flowfile-0.3.7.dist-info}/WHEEL +0 -0
- {flowfile_core/flowfile/sources/external_sources/airbyte_sources → flowfile_frame/cloud_storage}/__init__.py +0 -0
- {flowfile_core/schemas/external_sources → flowfile_worker/external_sources/s3_source}/__init__.py +0 -0
- {flowfile_worker/external_sources/airbyte_sources → test_utils/s3}/__init__.py +0 -0
|
@@ -1,922 +0,0 @@
|
|
|
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, a5 as withDirectives, a6 as vModelText, x as withKeys, f as createVNode, ah 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, a7 as Teleport } from "./index-e235a8bc.js";
|
|
2
|
-
import { D as DropDownGeneric } from "./dropDownGeneric-60f56a8a.js";
|
|
3
|
-
import { u as useNodeStore } from "./vue-codemirror.esm-25e75a08.js";
|
|
4
|
-
import { C as CodeLoader } from "./vue-content-loader.es-6c4b1c24.js";
|
|
5
|
-
import { G as GenericNodeSettings } from "./genericNodeSettings-4bdcf98e.js";
|
|
6
|
-
import { N as NodeButton, a as NodeTitle } from "./nodeTitle-fc3fc4b7.js";
|
|
7
|
-
import "./dropDown-52790b15.js";
|
|
8
|
-
import "./designer-267d44f1.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]
|
|
842
|
-
}, 8, ["modelValue"])
|
|
843
|
-
])) : createCommentVNode("", true);
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
});
|
|
847
|
-
const airbyteReader_vue_vue_type_style_index_0_scoped_9dcbd94f_lang = "";
|
|
848
|
-
const airbyteSource = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-9dcbd94f"]]);
|
|
849
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
850
|
-
__name: "AirbyteReader",
|
|
851
|
-
props: {
|
|
852
|
-
nodeId: {
|
|
853
|
-
type: Number,
|
|
854
|
-
required: true
|
|
855
|
-
}
|
|
856
|
-
},
|
|
857
|
-
setup(__props) {
|
|
858
|
-
const nodeStore = useNodeStore();
|
|
859
|
-
const props = __props;
|
|
860
|
-
const childComp = ref(null);
|
|
861
|
-
const el = ref(null);
|
|
862
|
-
const drawer = ref(false);
|
|
863
|
-
const closeOnDrawer = () => {
|
|
864
|
-
var _a;
|
|
865
|
-
(_a = childComp.value) == null ? void 0 : _a.pushNodeData();
|
|
866
|
-
drawer.value = false;
|
|
867
|
-
nodeStore.isDrawerOpen = false;
|
|
868
|
-
};
|
|
869
|
-
const openDrawer = async () => {
|
|
870
|
-
if (nodeStore.node_id === props.nodeId) {
|
|
871
|
-
return;
|
|
872
|
-
}
|
|
873
|
-
console.log("openDrawer");
|
|
874
|
-
drawer.value = true;
|
|
875
|
-
const drawerOpen = nodeStore.isDrawerOpen;
|
|
876
|
-
nodeStore.isDrawerOpen = true;
|
|
877
|
-
await nextTick();
|
|
878
|
-
if (nodeStore.node_id === props.nodeId && drawerOpen) {
|
|
879
|
-
console.log("No need to load data");
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
if (childComp.value) {
|
|
883
|
-
await childComp.value.loadNodeData(props.nodeId);
|
|
884
|
-
nodeStore.openDrawer(closeOnDrawer);
|
|
885
|
-
}
|
|
886
|
-
};
|
|
887
|
-
onMounted(async () => {
|
|
888
|
-
await nextTick();
|
|
889
|
-
});
|
|
890
|
-
return (_ctx, _cache) => {
|
|
891
|
-
return openBlock(), createElementBlock("div", {
|
|
892
|
-
ref_key: "el",
|
|
893
|
-
ref: el
|
|
894
|
-
}, [
|
|
895
|
-
createVNode(NodeButton, {
|
|
896
|
-
ref: "nodeButton",
|
|
897
|
-
"node-id": __props.nodeId,
|
|
898
|
-
"image-src": "airbyte.png",
|
|
899
|
-
title: `${__props.nodeId}: External source`,
|
|
900
|
-
onClick: openDrawer
|
|
901
|
-
}, null, 8, ["node-id", "title"]),
|
|
902
|
-
drawer.value ? (openBlock(), createBlock(Teleport, {
|
|
903
|
-
key: 0,
|
|
904
|
-
to: "#nodesettings"
|
|
905
|
-
}, [
|
|
906
|
-
createVNode(NodeTitle, {
|
|
907
|
-
title: "External source",
|
|
908
|
-
intro: "Import data from an external source"
|
|
909
|
-
}),
|
|
910
|
-
createVNode(airbyteSource, {
|
|
911
|
-
ref_key: "childComp",
|
|
912
|
-
ref: childComp,
|
|
913
|
-
"node-id": __props.nodeId
|
|
914
|
-
}, null, 8, ["node-id"])
|
|
915
|
-
])) : createCommentVNode("", true)
|
|
916
|
-
], 512);
|
|
917
|
-
};
|
|
918
|
-
}
|
|
919
|
-
});
|
|
920
|
-
export {
|
|
921
|
-
_sfc_main as default
|
|
922
|
-
};
|