Flowfile 0.2.2__py3-none-any.whl → 0.3.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Flowfile might be problematic. Click here for more details.

Files changed (149) hide show
  1. flowfile/__init__.py +14 -7
  2. flowfile/__main__.py +51 -15
  3. flowfile/api.py +379 -0
  4. flowfile/web/__init__.py +155 -0
  5. flowfile/web/static/assets/AirbyteReader-1ac35765.css +314 -0
  6. flowfile/web/static/assets/AirbyteReader-cb0c1d4a.js +921 -0
  7. flowfile/web/static/assets/CrossJoin-41efa4cb.css +100 -0
  8. flowfile/web/static/assets/CrossJoin-a514fa59.js +153 -0
  9. flowfile/web/static/assets/DatabaseConnectionSettings-0c04b2e5.css +77 -0
  10. flowfile/web/static/assets/DatabaseConnectionSettings-f2cecf33.js +151 -0
  11. flowfile/web/static/assets/DatabaseManager-30fa27e5.css +64 -0
  12. flowfile/web/static/assets/DatabaseManager-83ee3c98.js +484 -0
  13. flowfile/web/static/assets/DatabaseReader-dc0c6881.js +426 -0
  14. flowfile/web/static/assets/DatabaseReader-f50c6558.css +158 -0
  15. flowfile/web/static/assets/DatabaseWriter-2f570e53.css +96 -0
  16. flowfile/web/static/assets/DatabaseWriter-5afe9f8d.js +312 -0
  17. flowfile/web/static/assets/ExploreData-5bdae813.css +45 -0
  18. flowfile/web/static/assets/ExploreData-c7ee19cf.js +118306 -0
  19. flowfile/web/static/assets/ExternalSource-17b23a01.js +225 -0
  20. flowfile/web/static/assets/ExternalSource-e37b6275.css +94 -0
  21. flowfile/web/static/assets/Filter-90856b4f.js +238 -0
  22. flowfile/web/static/assets/Filter-a9d08ba1.css +20 -0
  23. flowfile/web/static/assets/Formula-38b71e9e.js +197 -0
  24. flowfile/web/static/assets/Formula-d60a74f4.css +17 -0
  25. flowfile/web/static/assets/FuzzyMatch-6857de82.css +254 -0
  26. flowfile/web/static/assets/FuzzyMatch-d0f1fe81.js +422 -0
  27. flowfile/web/static/assets/GoogleSheet-854294a4.js +2616 -0
  28. flowfile/web/static/assets/GoogleSheet-92084da7.css +233 -0
  29. flowfile/web/static/assets/GraphSolver-0c86bbc6.js +382 -0
  30. flowfile/web/static/assets/GraphSolver-17fd26db.css +68 -0
  31. flowfile/web/static/assets/GroupBy-ab1ea74b.css +51 -0
  32. flowfile/web/static/assets/GroupBy-f2772e9f.js +413 -0
  33. flowfile/web/static/assets/Join-41c0f331.css +109 -0
  34. flowfile/web/static/assets/Join-bc3e1cf7.js +247 -0
  35. flowfile/web/static/assets/ManualInput-03aa0245.js +391 -0
  36. flowfile/web/static/assets/ManualInput-ac7b9972.css +84 -0
  37. flowfile/web/static/assets/Output-48f81019.css +2642 -0
  38. flowfile/web/static/assets/Output-5b35eee8.js +536 -0
  39. flowfile/web/static/assets/Pivot-7164087c.js +408 -0
  40. flowfile/web/static/assets/Pivot-f415e85f.css +35 -0
  41. flowfile/web/static/assets/PolarsCode-3abf6507.js +2863 -0
  42. flowfile/web/static/assets/PolarsCode-650322d1.css +35 -0
  43. flowfile/web/static/assets/PopOver-b37ff9be.js +577 -0
  44. flowfile/web/static/assets/PopOver-bccfde04.css +32 -0
  45. flowfile/web/static/assets/Read-65966a3e.js +701 -0
  46. flowfile/web/static/assets/Read-80dc1675.css +197 -0
  47. flowfile/web/static/assets/RecordCount-c66c6d6d.js +121 -0
  48. flowfile/web/static/assets/RecordId-826dc095.js +339 -0
  49. flowfile/web/static/assets/Sample-4ed555c8.js +184 -0
  50. flowfile/web/static/assets/SecretManager-eac1e97d.js +382 -0
  51. flowfile/web/static/assets/Select-085f05cc.js +231 -0
  52. flowfile/web/static/assets/SettingsSection-1f5e79c1.js +87 -0
  53. flowfile/web/static/assets/SettingsSection-9c836ecc.css +47 -0
  54. flowfile/web/static/assets/Sort-3e6cb414.js +309 -0
  55. flowfile/web/static/assets/Sort-7ccfa0fe.css +51 -0
  56. flowfile/web/static/assets/TextToRows-606349bc.js +307 -0
  57. flowfile/web/static/assets/TextToRows-c92d1ec2.css +48 -0
  58. flowfile/web/static/assets/UnavailableFields-5edd5322.css +49 -0
  59. flowfile/web/static/assets/UnavailableFields-b41976ed.js +36 -0
  60. flowfile/web/static/assets/Union-8d9ac7f9.css +30 -0
  61. flowfile/web/static/assets/Union-fca91665.js +145 -0
  62. flowfile/web/static/assets/Unique-a59f830e.js +273 -0
  63. flowfile/web/static/assets/Unique-b5615727.css +51 -0
  64. flowfile/web/static/assets/Unpivot-246e9bbd.css +77 -0
  65. flowfile/web/static/assets/Unpivot-c3815565.js +441 -0
  66. flowfile/web/static/assets/airbyte-292aa232.png +0 -0
  67. flowfile/web/static/assets/api-22b338bd.js +60 -0
  68. flowfile/web/static/assets/cross_join-d30c0290.png +0 -0
  69. flowfile/web/static/assets/database_reader-ce1e55f3.svg +24 -0
  70. flowfile/web/static/assets/database_writer-b4ad0753.svg +23 -0
  71. flowfile/web/static/assets/designer-2394122a.css +10697 -0
  72. flowfile/web/static/assets/designer-e5bbe26f.js +69712 -0
  73. flowfile/web/static/assets/documentation-08045cf2.js +33 -0
  74. flowfile/web/static/assets/documentation-12216a74.css +50 -0
  75. flowfile/web/static/assets/dropDown-35135ba8.css +143 -0
  76. flowfile/web/static/assets/dropDown-5e7e9a5a.js +319 -0
  77. flowfile/web/static/assets/dropDownGeneric-50a91b99.js +72 -0
  78. flowfile/web/static/assets/dropDownGeneric-895680d6.css +10 -0
  79. flowfile/web/static/assets/element-icons-9c88a535.woff +0 -0
  80. flowfile/web/static/assets/element-icons-de5eb258.ttf +0 -0
  81. flowfile/web/static/assets/explore_data-8a0a2861.png +0 -0
  82. flowfile/web/static/assets/fa-brands-400-808443ae.ttf +0 -0
  83. flowfile/web/static/assets/fa-brands-400-d7236a19.woff2 +0 -0
  84. flowfile/web/static/assets/fa-regular-400-54cf6086.ttf +0 -0
  85. flowfile/web/static/assets/fa-regular-400-e3456d12.woff2 +0 -0
  86. flowfile/web/static/assets/fa-solid-900-aa759986.woff2 +0 -0
  87. flowfile/web/static/assets/fa-solid-900-d2f05935.ttf +0 -0
  88. flowfile/web/static/assets/fa-v4compatibility-0ce9033c.woff2 +0 -0
  89. flowfile/web/static/assets/fa-v4compatibility-30f6abf6.ttf +0 -0
  90. flowfile/web/static/assets/filter-d7708bda.png +0 -0
  91. flowfile/web/static/assets/formula-eeeb1611.png +0 -0
  92. flowfile/web/static/assets/fullEditor-178376bb.css +256 -0
  93. flowfile/web/static/assets/fullEditor-705c6ccb.js +630 -0
  94. flowfile/web/static/assets/fuzzy_match-40c161b2.png +0 -0
  95. flowfile/web/static/assets/genericNodeSettings-65587f20.js +137 -0
  96. flowfile/web/static/assets/genericNodeSettings-924759c7.css +46 -0
  97. flowfile/web/static/assets/graph_solver-8b7888b8.png +0 -0
  98. flowfile/web/static/assets/group_by-80561fc3.png +0 -0
  99. flowfile/web/static/assets/index-552863fd.js +58652 -0
  100. flowfile/web/static/assets/index-681a3ed0.css +8843 -0
  101. flowfile/web/static/assets/input_data-ab2eb678.png +0 -0
  102. flowfile/web/static/assets/join-349043ae.png +0 -0
  103. flowfile/web/static/assets/manual_input-ae98f31d.png +0 -0
  104. flowfile/web/static/assets/nodeTitle-cf9bae3c.js +227 -0
  105. flowfile/web/static/assets/nodeTitle-f4b12bcb.css +134 -0
  106. flowfile/web/static/assets/old_join-5d0eb604.png +0 -0
  107. flowfile/web/static/assets/output-06ec0371.png +0 -0
  108. flowfile/web/static/assets/pivot-9660df51.png +0 -0
  109. flowfile/web/static/assets/polars_code-05ce5dc6.png +0 -0
  110. flowfile/web/static/assets/record_count-dab44eb5.png +0 -0
  111. flowfile/web/static/assets/record_id-0b15856b.png +0 -0
  112. flowfile/web/static/assets/sample-693a88b5.png +0 -0
  113. flowfile/web/static/assets/secretApi-3ad510e1.js +46 -0
  114. flowfile/web/static/assets/select-b0d0437a.png +0 -0
  115. flowfile/web/static/assets/selectDynamic-b062bc9b.css +107 -0
  116. flowfile/web/static/assets/selectDynamic-bd644891.js +302 -0
  117. flowfile/web/static/assets/sort-2aa579f0.png +0 -0
  118. flowfile/web/static/assets/summarize-2a099231.png +0 -0
  119. flowfile/web/static/assets/text_to_rows-859b29ea.png +0 -0
  120. flowfile/web/static/assets/union-2d8609f4.png +0 -0
  121. flowfile/web/static/assets/unique-1958b98a.png +0 -0
  122. flowfile/web/static/assets/unpivot-d3cb4b5b.png +0 -0
  123. flowfile/web/static/assets/view-7a0f0be1.png +0 -0
  124. flowfile/web/static/assets/vue-codemirror.esm-dd17b478.js +22281 -0
  125. flowfile/web/static/assets/vue-content-loader.es-6b36f05e.js +210 -0
  126. flowfile/web/static/flowfile.svg +47 -0
  127. flowfile/web/static/icons/flowfile.png +0 -0
  128. flowfile/web/static/images/airbyte.png +0 -0
  129. flowfile/web/static/images/flowfile.svg +47 -0
  130. flowfile/web/static/images/google.svg +1 -0
  131. flowfile/web/static/images/sheets.png +0 -0
  132. flowfile/web/static/index.html +22 -0
  133. flowfile/web/static/vite.svg +1 -0
  134. flowfile/web/static/vue.svg +1 -0
  135. flowfile-0.3.0.1.dist-info/METADATA +219 -0
  136. {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/RECORD +147 -16
  137. {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/entry_points.txt +1 -1
  138. flowfile_core/configs/settings.py +7 -32
  139. flowfile_core/flowfile/FlowfileFlow.py +4 -2
  140. flowfile_core/flowfile/analytics/analytics_processor.py +1 -1
  141. flowfile_core/main.py +4 -1
  142. flowfile_core/schemas/input_schema.py +1 -8
  143. flowfile_frame/__init__.py +1 -2
  144. flowfile_frame/flow_frame.py +6 -6
  145. flowfile_frame/utils.py +1 -140
  146. flowfile-0.2.2.dist-info/METADATA +0 -225
  147. flowfile_frame/__main__.py +0 -12
  148. {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/LICENSE +0 -0
  149. {flowfile-0.2.2.dist-info → flowfile-0.3.0.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,184 @@
1
+ import { d as defineComponent, r as ref, n as onMounted, R as nextTick, o as onUnmounted, b as resolveComponent, c as openBlock, e as createElementBlock, f as createVNode, w as withCtx, p as createBaseVNode, g as createTextVNode, a4 as withDirectives, a5 as vModelText, i as createCommentVNode, h as createBlock, a6 as Teleport } from "./index-552863fd.js";
2
+ import { u as useNodeStore } from "./PopOver-b37ff9be.js";
3
+ import { G as GenericNodeSettings } from "./genericNodeSettings-65587f20.js";
4
+ import { N as NodeButton, a as NodeTitle } from "./nodeTitle-cf9bae3c.js";
5
+ import "./designer-e5bbe26f.js";
6
+ const _hoisted_1$1 = {
7
+ key: 0,
8
+ class: "listbox-wrapper"
9
+ };
10
+ const _hoisted_2 = { class: "listbox-wrapper" };
11
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
12
+ __name: "sample",
13
+ setup(__props, { expose: __expose }) {
14
+ const nodeStore = useNodeStore();
15
+ const showContextMenu = ref(false);
16
+ const showContextMenuRemove = ref(false);
17
+ const dataLoaded = ref(false);
18
+ const contextMenuColumn = ref(null);
19
+ const contextMenuRef = ref(null);
20
+ const nodeSample = ref(null);
21
+ const nodeData = ref(null);
22
+ const sampleSize = ref(1e3);
23
+ const loadNodeData = async (nodeId) => {
24
+ var _a, _b, _c;
25
+ nodeData.value = await nodeStore.getNodeData(nodeId, false);
26
+ nodeSample.value = (_a = nodeData.value) == null ? void 0 : _a.setting_input;
27
+ if (!((_b = nodeData.value) == null ? void 0 : _b.setting_input.is_setup) && nodeSample.value) {
28
+ nodeSample.value.sample_size = sampleSize.value;
29
+ } else {
30
+ if (nodeSample.value) {
31
+ sampleSize.value = nodeSample.value.sample_size;
32
+ }
33
+ }
34
+ dataLoaded.value = true;
35
+ if ((_c = nodeSample.value) == null ? void 0 : _c.is_setup) {
36
+ nodeSample.value.is_setup = true;
37
+ }
38
+ };
39
+ const handleClickOutside = (event) => {
40
+ var _a;
41
+ if (!((_a = contextMenuRef.value) == null ? void 0 : _a.contains(event.target))) {
42
+ showContextMenu.value = false;
43
+ contextMenuColumn.value = null;
44
+ showContextMenuRemove.value = false;
45
+ }
46
+ };
47
+ const pushNodeData = async () => {
48
+ if (nodeSample.value) {
49
+ nodeSample.value.sample_size = sampleSize.value;
50
+ }
51
+ nodeStore.updateSettings(nodeSample);
52
+ dataLoaded.value = false;
53
+ nodeStore.isDrawerOpen = false;
54
+ };
55
+ __expose({
56
+ loadNodeData,
57
+ pushNodeData
58
+ });
59
+ onMounted(async () => {
60
+ await nextTick();
61
+ window.addEventListener("click", handleClickOutside);
62
+ });
63
+ onUnmounted(() => {
64
+ window.removeEventListener("click", handleClickOutside);
65
+ });
66
+ return (_ctx, _cache) => {
67
+ const _component_el_col = resolveComponent("el-col");
68
+ const _component_el_row = resolveComponent("el-row");
69
+ return dataLoaded.value && nodeSample.value ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
70
+ createVNode(GenericNodeSettings, {
71
+ modelValue: nodeSample.value,
72
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => nodeSample.value = $event)
73
+ }, {
74
+ default: withCtx(() => [
75
+ createBaseVNode("div", _hoisted_2, [
76
+ _cache[3] || (_cache[3] = createBaseVNode("div", { class: "listbox-subtitle" }, "Settings", -1)),
77
+ createVNode(_component_el_row, null, {
78
+ default: withCtx(() => [
79
+ createVNode(_component_el_col, {
80
+ span: 10,
81
+ class: "grid-content"
82
+ }, {
83
+ default: withCtx(() => _cache[2] || (_cache[2] = [
84
+ createTextVNode("Offset")
85
+ ])),
86
+ _: 1
87
+ }),
88
+ createVNode(_component_el_col, {
89
+ span: 8,
90
+ class: "grid-content"
91
+ }, {
92
+ default: withCtx(() => [
93
+ withDirectives(createBaseVNode("input", {
94
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => sampleSize.value = $event),
95
+ type: "number",
96
+ min: "0",
97
+ step: "1"
98
+ }, null, 512), [
99
+ [vModelText, sampleSize.value]
100
+ ])
101
+ ]),
102
+ _: 1
103
+ })
104
+ ]),
105
+ _: 1
106
+ })
107
+ ])
108
+ ]),
109
+ _: 1
110
+ }, 8, ["modelValue"])
111
+ ])) : createCommentVNode("", true);
112
+ };
113
+ }
114
+ });
115
+ const _hoisted_1 = { ref: "el" };
116
+ const _sfc_main = /* @__PURE__ */ defineComponent({
117
+ __name: "Sample",
118
+ props: {
119
+ nodeId: {
120
+ type: Number,
121
+ required: true
122
+ }
123
+ },
124
+ setup(__props) {
125
+ const nodeStore = useNodeStore();
126
+ const childComp = ref(null);
127
+ const props = __props;
128
+ const drawer = ref(false);
129
+ const closeOnDrawer = () => {
130
+ var _a;
131
+ (_a = childComp.value) == null ? void 0 : _a.pushNodeData();
132
+ drawer.value = false;
133
+ nodeStore.isDrawerOpen = false;
134
+ };
135
+ const openDrawer = async () => {
136
+ if (nodeStore.node_id === props.nodeId) {
137
+ return;
138
+ }
139
+ nodeStore.closeDrawer();
140
+ drawer.value = true;
141
+ const drawerOpen = nodeStore.isDrawerOpen;
142
+ nodeStore.isDrawerOpen = true;
143
+ await nextTick();
144
+ if (nodeStore.node_id === props.nodeId && drawerOpen) {
145
+ return;
146
+ }
147
+ if (childComp.value) {
148
+ childComp.value.loadNodeData(props.nodeId);
149
+ nodeStore.openDrawer(closeOnDrawer);
150
+ }
151
+ };
152
+ onMounted(async () => {
153
+ await nextTick();
154
+ });
155
+ return (_ctx, _cache) => {
156
+ return openBlock(), createElementBlock("div", _hoisted_1, [
157
+ createVNode(NodeButton, {
158
+ ref: "nodeButton",
159
+ "node-id": __props.nodeId,
160
+ "image-src": "sample.png",
161
+ title: `${__props.nodeId}: Sample`,
162
+ onClick: openDrawer
163
+ }, null, 8, ["node-id", "title"]),
164
+ drawer.value ? (openBlock(), createBlock(Teleport, {
165
+ key: 0,
166
+ to: "#nodesettings"
167
+ }, [
168
+ createVNode(NodeTitle, {
169
+ title: "Sample",
170
+ intro: "When taking a sample, the most crucial factor to consider is the size of the sample. The size refers to the number of items or observations included in the sample from a larger population. This number is pivotal because it influences the accuracy and reliability of the results obtained from the sample. By carefully determining the sample size, we ensure that our findings are representative of the larger group, allowing us to make informed decisions or predictions based on the sample data"
171
+ }),
172
+ createVNode(_sfc_main$1, {
173
+ ref_key: "childComp",
174
+ ref: childComp,
175
+ "node-id": __props.nodeId
176
+ }, null, 8, ["node-id"])
177
+ ])) : createCommentVNode("", true)
178
+ ], 512);
179
+ };
180
+ }
181
+ });
182
+ export {
183
+ _sfc_main as default
184
+ };
@@ -0,0 +1,382 @@
1
+ import { r as ref, l as computed, d as defineComponent, n as onMounted, e as createElementBlock, p as createBaseVNode, v as withModifiers, a4 as withDirectives, a5 as vModelText, af as vModelDynamic, s as normalizeClass, g as createTextVNode, t as toDisplayString, u as unref, O as isRef, i as createCommentVNode, F as Fragment, q as renderList, c as openBlock } from "./index-552863fd.js";
2
+ import { f as fetchSecretsApi, a as addSecretApi, g as getSecretValueApi, d as deleteSecretApi } from "./secretApi-3ad510e1.js";
3
+ function useSecretManager() {
4
+ const secrets = ref([]);
5
+ const isLoading = ref(true);
6
+ const searchTerm = ref("");
7
+ const visibleSecrets = ref([]);
8
+ const copyMessage = ref("");
9
+ const filteredSecrets = computed(() => {
10
+ const sortedSecrets = [...secrets.value].sort((a, b) => a.name.localeCompare(b.name));
11
+ if (!searchTerm.value) {
12
+ return sortedSecrets;
13
+ }
14
+ const term = searchTerm.value.toLowerCase();
15
+ return sortedSecrets.filter((secret) => secret.name.toLowerCase().includes(term));
16
+ });
17
+ const loadSecrets = async () => {
18
+ isLoading.value = true;
19
+ visibleSecrets.value = [];
20
+ try {
21
+ secrets.value = await fetchSecretsApi();
22
+ } catch (error) {
23
+ console.error("Failed to load secrets:", error);
24
+ secrets.value = [];
25
+ throw error;
26
+ } finally {
27
+ isLoading.value = false;
28
+ }
29
+ };
30
+ const addSecret = async (secretInput) => {
31
+ if (secrets.value.some((s) => s.name === secretInput.name)) {
32
+ throw new Error(`Secret with name "${secretInput.name}" already exists.`);
33
+ }
34
+ try {
35
+ await addSecretApi({ ...secretInput });
36
+ await loadSecrets();
37
+ return secretInput.name;
38
+ } catch (error) {
39
+ console.error("Failed to add secret:", error);
40
+ throw error;
41
+ }
42
+ };
43
+ const toggleSecretVisibility = (secretName) => {
44
+ const index = visibleSecrets.value.indexOf(secretName);
45
+ if (index === -1) {
46
+ visibleSecrets.value.push(secretName);
47
+ } else {
48
+ visibleSecrets.value.splice(index, 1);
49
+ }
50
+ };
51
+ const copySecretToClipboard = async (secretName) => {
52
+ copyMessage.value = "";
53
+ try {
54
+ const secretValue = await getSecretValueApi(secretName);
55
+ await navigator.clipboard.writeText(secretValue);
56
+ copyMessage.value = `Value for '${secretName}' copied!`;
57
+ setTimeout(() => {
58
+ copyMessage.value = "";
59
+ }, 2500);
60
+ return true;
61
+ } catch (error) {
62
+ console.error("Failed to copy secret:", error);
63
+ copyMessage.value = `Failed to copy ${secretName}.`;
64
+ setTimeout(() => {
65
+ copyMessage.value = "";
66
+ }, 3e3);
67
+ throw error;
68
+ }
69
+ };
70
+ const deleteSecret = async (secretName) => {
71
+ try {
72
+ await deleteSecretApi(secretName);
73
+ await loadSecrets();
74
+ return secretName;
75
+ } catch (error) {
76
+ console.error("Failed to delete secret:", error);
77
+ throw error;
78
+ }
79
+ };
80
+ return {
81
+ secrets,
82
+ filteredSecrets,
83
+ isLoading,
84
+ searchTerm,
85
+ visibleSecrets,
86
+ copyMessage,
87
+ loadSecrets,
88
+ addSecret,
89
+ toggleSecretVisibility,
90
+ copySecretToClipboard,
91
+ deleteSecret
92
+ };
93
+ }
94
+ const _hoisted_1 = { class: "secret-manager-container" };
95
+ const _hoisted_2 = { class: "card mb-3" };
96
+ const _hoisted_3 = { class: "card-content" };
97
+ const _hoisted_4 = { class: "form-grid" };
98
+ const _hoisted_5 = { class: "form-field" };
99
+ const _hoisted_6 = { class: "form-field" };
100
+ const _hoisted_7 = { class: "password-field" };
101
+ const _hoisted_8 = ["type"];
102
+ const _hoisted_9 = { class: "form-actions" };
103
+ const _hoisted_10 = ["disabled"];
104
+ const _hoisted_11 = { class: "card mb-3" };
105
+ const _hoisted_12 = { class: "card-header" };
106
+ const _hoisted_13 = { class: "card-title" };
107
+ const _hoisted_14 = {
108
+ key: 0,
109
+ class: "search-container"
110
+ };
111
+ const _hoisted_15 = { class: "card-content" };
112
+ const _hoisted_16 = {
113
+ key: 0,
114
+ class: "loading-state"
115
+ };
116
+ const _hoisted_17 = {
117
+ key: 1,
118
+ class: "empty-state"
119
+ };
120
+ const _hoisted_18 = {
121
+ key: 2,
122
+ class: "flex-col gap-2"
123
+ };
124
+ const _hoisted_19 = { class: "secret-info" };
125
+ const _hoisted_20 = { class: "secret-name" };
126
+ const _hoisted_21 = { class: "secret-actions" };
127
+ const _hoisted_22 = ["aria-label", "onClick"];
128
+ const _hoisted_23 = {
129
+ key: 3,
130
+ class: "empty-state"
131
+ };
132
+ const _hoisted_24 = { class: "modal-content" };
133
+ const _hoisted_25 = { class: "modal-actions" };
134
+ const _hoisted_26 = ["disabled"];
135
+ const _hoisted_27 = {
136
+ key: 0,
137
+ class: "fas fa-spinner fa-spin"
138
+ };
139
+ const _sfc_main = /* @__PURE__ */ defineComponent({
140
+ __name: "SecretManager",
141
+ setup(__props) {
142
+ const { secrets, filteredSecrets, isLoading, searchTerm, loadSecrets, addSecret, deleteSecret } = useSecretManager();
143
+ const newSecret = ref({ name: "", value: "" });
144
+ const showNewSecret = ref(false);
145
+ const isSubmitting = ref(false);
146
+ const isDeleting = ref(false);
147
+ const showDeleteModal = ref(false);
148
+ const secretToDelete = ref("");
149
+ const handleAddSecret = async () => {
150
+ if (!newSecret.value.name || !newSecret.value.value)
151
+ return;
152
+ isSubmitting.value = true;
153
+ try {
154
+ const secretName = await addSecret(newSecret.value);
155
+ newSecret.value = { name: "", value: "" };
156
+ showNewSecret.value = false;
157
+ alert(`Secret "${secretName}" added successfully.`);
158
+ } catch (error) {
159
+ const errorMsg = error.message || "An unknown error occurred while adding the secret.";
160
+ alert(`Error adding secret: ${errorMsg}`);
161
+ } finally {
162
+ isSubmitting.value = false;
163
+ }
164
+ };
165
+ const handleConfirmDelete = (secretName) => {
166
+ secretToDelete.value = secretName;
167
+ showDeleteModal.value = true;
168
+ };
169
+ const cancelDelete = () => {
170
+ showDeleteModal.value = false;
171
+ secretToDelete.value = "";
172
+ };
173
+ const handleDeleteSecret = async () => {
174
+ if (!secretToDelete.value)
175
+ return;
176
+ isDeleting.value = true;
177
+ try {
178
+ const nameToDelete = secretToDelete.value;
179
+ await deleteSecret(nameToDelete);
180
+ cancelDelete();
181
+ alert(`Secret "${nameToDelete}" deleted successfully.`);
182
+ } catch (error) {
183
+ alert("Failed to delete secret. Please try again.");
184
+ cancelDelete();
185
+ } finally {
186
+ isDeleting.value = false;
187
+ }
188
+ };
189
+ onMounted(() => {
190
+ loadSecrets().catch((error) => {
191
+ alert("Failed to load secrets. Please try again.");
192
+ });
193
+ });
194
+ return (_ctx, _cache) => {
195
+ return openBlock(), createElementBlock("div", _hoisted_1, [
196
+ _cache[21] || (_cache[21] = createBaseVNode("div", { class: "mb-3" }, [
197
+ createBaseVNode("h2", { class: "page-title" }, "Secret Manager"),
198
+ createBaseVNode("p", { class: "page-description" }, "Securely store and manage credentials for your integrations")
199
+ ], -1)),
200
+ createBaseVNode("div", _hoisted_2, [
201
+ _cache[8] || (_cache[8] = createBaseVNode("div", { class: "card-header" }, [
202
+ createBaseVNode("h3", { class: "card-title" }, "Add New Secret")
203
+ ], -1)),
204
+ createBaseVNode("div", _hoisted_3, [
205
+ createBaseVNode("form", {
206
+ class: "form",
207
+ onSubmit: withModifiers(handleAddSecret, ["prevent"])
208
+ }, [
209
+ createBaseVNode("div", _hoisted_4, [
210
+ createBaseVNode("div", _hoisted_5, [
211
+ _cache[5] || (_cache[5] = createBaseVNode("label", {
212
+ for: "secret-name",
213
+ class: "form-label"
214
+ }, "Secret Name", -1)),
215
+ withDirectives(createBaseVNode("input", {
216
+ id: "secret-name",
217
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => newSecret.value.name = $event),
218
+ type: "text",
219
+ class: "form-input",
220
+ placeholder: "api_key, database_password, etc.",
221
+ required: ""
222
+ }, null, 512), [
223
+ [vModelText, newSecret.value.name]
224
+ ])
225
+ ]),
226
+ createBaseVNode("div", _hoisted_6, [
227
+ _cache[6] || (_cache[6] = createBaseVNode("label", {
228
+ for: "secret-value",
229
+ class: "form-label"
230
+ }, "Secret Value", -1)),
231
+ createBaseVNode("div", _hoisted_7, [
232
+ withDirectives(createBaseVNode("input", {
233
+ id: "secret-value",
234
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => newSecret.value.value = $event),
235
+ type: showNewSecret.value ? "text" : "password",
236
+ class: "form-input",
237
+ placeholder: "Enter secret value",
238
+ required: ""
239
+ }, null, 8, _hoisted_8), [
240
+ [vModelDynamic, newSecret.value.value]
241
+ ]),
242
+ createBaseVNode("button", {
243
+ type: "button",
244
+ class: "toggle-visibility",
245
+ "aria-label": "Toggle new secret visibility",
246
+ onClick: _cache[2] || (_cache[2] = ($event) => showNewSecret.value = !showNewSecret.value)
247
+ }, [
248
+ createBaseVNode("i", {
249
+ class: normalizeClass(showNewSecret.value ? "fa-solid fa-eye-slash" : "fa-solid fa-eye")
250
+ }, null, 2)
251
+ ])
252
+ ])
253
+ ])
254
+ ]),
255
+ createBaseVNode("div", _hoisted_9, [
256
+ createBaseVNode("button", {
257
+ type: "submit",
258
+ class: "btn btn-primary",
259
+ disabled: !newSecret.value.name || !newSecret.value.value || isSubmitting.value
260
+ }, [
261
+ _cache[7] || (_cache[7] = createBaseVNode("i", { class: "fa-solid fa-plus" }, null, -1)),
262
+ createTextVNode(" " + toDisplayString(isSubmitting.value ? "Adding..." : "Add Secret"), 1)
263
+ ], 8, _hoisted_10)
264
+ ])
265
+ ], 32)
266
+ ])
267
+ ]),
268
+ createBaseVNode("div", _hoisted_11, [
269
+ createBaseVNode("div", _hoisted_12, [
270
+ createBaseVNode("h3", _hoisted_13, "Your Secrets (" + toDisplayString(unref(filteredSecrets).length) + ")", 1),
271
+ unref(secrets).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_14, [
272
+ withDirectives(createBaseVNode("input", {
273
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isRef(searchTerm) ? searchTerm.value = $event : null),
274
+ type: "text",
275
+ placeholder: "Search secrets...",
276
+ class: "search-input",
277
+ "aria-label": "Search secrets"
278
+ }, null, 512), [
279
+ [vModelText, unref(searchTerm)]
280
+ ]),
281
+ _cache[9] || (_cache[9] = createBaseVNode("i", { class: "fa-solid fa-search search-icon" }, null, -1))
282
+ ])) : createCommentVNode("", true)
283
+ ]),
284
+ createBaseVNode("div", _hoisted_15, [
285
+ unref(isLoading) ? (openBlock(), createElementBlock("div", _hoisted_16, _cache[10] || (_cache[10] = [
286
+ createBaseVNode("div", { class: "loading-spinner" }, null, -1),
287
+ createBaseVNode("p", null, "Loading secrets...", -1)
288
+ ]))) : !unref(isLoading) && unref(secrets).length === 0 ? (openBlock(), createElementBlock("div", _hoisted_17, _cache[11] || (_cache[11] = [
289
+ createBaseVNode("i", { class: "fa-solid fa-lock" }, null, -1),
290
+ createBaseVNode("p", null, "You haven't added any secrets yet", -1),
291
+ createBaseVNode("p", null, "Secrets are securely stored and can be used in your flows", -1)
292
+ ]))) : unref(filteredSecrets).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_18, [
293
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredSecrets), (secret) => {
294
+ return openBlock(), createElementBlock("div", {
295
+ key: secret.name,
296
+ class: "secret-item"
297
+ }, [
298
+ createBaseVNode("div", _hoisted_19, [
299
+ createBaseVNode("div", _hoisted_20, [
300
+ _cache[12] || (_cache[12] = createBaseVNode("i", { class: "fa-solid fa-key" }, null, -1)),
301
+ createBaseVNode("span", null, toDisplayString(secret.name), 1)
302
+ ]),
303
+ _cache[13] || (_cache[13] = createBaseVNode("div", { class: "secret-value" }, [
304
+ createBaseVNode("input", {
305
+ type: "password",
306
+ value: "••••••••••••••••",
307
+ readonly: "",
308
+ class: "form-input",
309
+ "aria-label": "Masked secret value"
310
+ })
311
+ ], -1))
312
+ ]),
313
+ createBaseVNode("div", _hoisted_21, [
314
+ createBaseVNode("button", {
315
+ type: "button",
316
+ class: "btn btn-danger",
317
+ "aria-label": `Delete secret ${secret.name}`,
318
+ onClick: ($event) => handleConfirmDelete(secret.name)
319
+ }, _cache[14] || (_cache[14] = [
320
+ createBaseVNode("i", { class: "fa-solid fa-trash-alt" }, null, -1),
321
+ createBaseVNode("span", null, "Delete", -1)
322
+ ]), 8, _hoisted_22)
323
+ ])
324
+ ]);
325
+ }), 128))
326
+ ])) : (openBlock(), createElementBlock("div", _hoisted_23, [
327
+ _cache[15] || (_cache[15] = createBaseVNode("i", { class: "fa-solid fa-search" }, null, -1)),
328
+ createBaseVNode("p", null, 'No secrets found matching "' + toDisplayString(unref(searchTerm)) + '"', 1)
329
+ ]))
330
+ ])
331
+ ]),
332
+ showDeleteModal.value ? (openBlock(), createElementBlock("div", {
333
+ key: 0,
334
+ class: "modal-overlay",
335
+ onClick: cancelDelete
336
+ }, [
337
+ createBaseVNode("div", {
338
+ class: "modal-container",
339
+ onClick: _cache[4] || (_cache[4] = withModifiers(() => {
340
+ }, ["stop"]))
341
+ }, [
342
+ createBaseVNode("div", { class: "modal-header" }, [
343
+ _cache[17] || (_cache[17] = createBaseVNode("h3", { class: "modal-title" }, "Delete Secret", -1)),
344
+ createBaseVNode("button", {
345
+ class: "modal-close",
346
+ "aria-label": "Close delete confirmation",
347
+ onClick: cancelDelete
348
+ }, _cache[16] || (_cache[16] = [
349
+ createBaseVNode("i", { class: "fa-solid fa-times" }, null, -1)
350
+ ]))
351
+ ]),
352
+ createBaseVNode("div", _hoisted_24, [
353
+ createBaseVNode("p", null, [
354
+ _cache[18] || (_cache[18] = createTextVNode(" Are you sure you want to delete the secret ")),
355
+ createBaseVNode("strong", null, toDisplayString(secretToDelete.value), 1),
356
+ _cache[19] || (_cache[19] = createTextVNode("? "))
357
+ ]),
358
+ _cache[20] || (_cache[20] = createBaseVNode("p", { class: "warning-text" }, " This action cannot be undone and may break any flows that use this secret. ", -1))
359
+ ]),
360
+ createBaseVNode("div", _hoisted_25, [
361
+ createBaseVNode("button", {
362
+ class: "btn btn-secondary",
363
+ onClick: cancelDelete
364
+ }, "Cancel"),
365
+ createBaseVNode("button", {
366
+ class: "btn btn-danger-filled",
367
+ disabled: isDeleting.value,
368
+ onClick: handleDeleteSecret
369
+ }, [
370
+ isDeleting.value ? (openBlock(), createElementBlock("i", _hoisted_27)) : createCommentVNode("", true),
371
+ createTextVNode(" " + toDisplayString(isDeleting.value ? "Deleting..." : "Delete Secret"), 1)
372
+ ], 8, _hoisted_26)
373
+ ])
374
+ ])
375
+ ])) : createCommentVNode("", true)
376
+ ]);
377
+ };
378
+ }
379
+ });
380
+ export {
381
+ _sfc_main as default
382
+ };