@burdenoff/microfe-bigconsole 2026.1011.10 → 2026.1012.1
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.
- package/README.md +19 -0
- package/dist/bigconsole/BigConsoleRoot.js +88 -82
- package/dist/bigconsole/BigConsoleRoutes.js +163 -136
- package/dist/bigconsole/assistant/assistantProduct.js +1 -4
- package/dist/bigconsole/assistant/pageContext.d.ts +0 -14
- package/dist/bigconsole/assistant/pageContext.js +1 -6
- package/dist/bigconsole/assistant/recordAdapters.js +26 -27
- package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +31 -31
- package/dist/bigconsole/components/common/index.d.ts +0 -1
- package/dist/bigconsole/components/common/index.js +0 -1
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +44 -44
- package/dist/bigconsole/components/dashboard/DashboardCanvas.js +36 -36
- package/dist/bigconsole/components/dashboard/DashboardToolbar.js +59 -59
- package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +58 -57
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +30 -30
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +41 -41
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +34 -34
- package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +34 -34
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +110 -110
- package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +21 -21
- package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +46 -46
- package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +164 -173
- package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +101 -101
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +31 -31
- package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js +15 -15
- package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -1
- package/dist/bigconsole/components/dashboard/WidgetPalette.js +165 -163
- package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +37 -37
- package/dist/bigconsole/components/datasink/AlertRuleEditor.js +66 -66
- package/dist/bigconsole/components/datasink/CacheTTLSelector.js +35 -35
- package/dist/bigconsole/components/datasink/DataSinkCard.js +50 -51
- package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +18 -18
- package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +20 -20
- package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +47 -47
- package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +91 -91
- package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +35 -35
- package/dist/bigconsole/components/parser/DataSinkSelector.js +40 -40
- package/dist/bigconsole/components/parser/ImportParserDialog.js +120 -120
- package/dist/bigconsole/components/parser/ParserSelector.js +51 -51
- package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +10 -10
- package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +76 -77
- package/dist/bigconsole/components/preview/AiPreviewPanel.js +95 -96
- package/dist/bigconsole/components/widgets/ActionConfigDialog.js +4 -4
- package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +93 -93
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +499 -507
- package/dist/bigconsole/components/widgets/WidgetRegistry.js +0 -1
- package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +4 -4
- package/dist/bigconsole/components/widgets/chart/ChartConfig.js +48 -48
- package/dist/bigconsole/components/widgets/comments/WidgetComments.js +46 -46
- package/dist/bigconsole/components/widgets/custom/CustomWidget.js +73 -131
- package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +61 -61
- package/dist/bigconsole/components/widgets/form/FormWidget.js +36 -36
- package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +42 -42
- package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +25 -25
- package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.d.ts +28 -9
- package/dist/bigconsole/components/widgets/iframe-widget/IframeWidget.js +115 -42
- package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.d.ts +20 -0
- package/dist/bigconsole/components/widgets/iframe-widget/framePolicy.js +10 -0
- package/dist/bigconsole/components/widgets/iframe-widget/index.d.ts +2 -1
- package/dist/bigconsole/components/widgets/iframe-widget/index.js +3 -2
- package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +4 -4
- package/dist/bigconsole/components/widgets/list/ListConfig.js +30 -30
- package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +38 -38
- package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +9 -9
- package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +9 -9
- package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +49 -49
- package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +39 -39
- package/dist/bigconsole/components/widgets/table/TableConfig.js +73 -73
- package/dist/bigconsole/components/widgets/text-widget/TextWidget.js +110 -27
- package/dist/bigconsole/components/widgets/text-widget/textData.d.ts +6 -0
- package/dist/bigconsole/components/widgets/text-widget/textData.js +17 -14
- package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +64 -64
- package/dist/bigconsole/components/workflow/WorkflowOpenGuard.js +15 -15
- package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +15 -15
- package/dist/bigconsole/context/BigConsoleContext.d.ts +10 -0
- package/dist/bigconsole/context/BigConsoleContext.js +47 -30
- package/dist/bigconsole/context/index.d.ts +1 -1
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +58 -49
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +74 -72
- package/dist/bigconsole/customWidget/proposalPreview.d.ts +5 -0
- package/dist/bigconsole/customWidget/proposalPreview.js +31 -0
- package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts +0 -23
- package/dist/bigconsole/hooks/useDataSinkAlerts.js +113 -138
- package/dist/bigconsole/hooks/useDataSinkOperations.d.ts +7 -0
- package/dist/bigconsole/hooks/useDataSinkOperations.js +109 -98
- package/dist/bigconsole/hooks/useDataSinkSubscription.js +0 -1
- package/dist/bigconsole/hooks/useDrilldown.js +68 -67
- package/dist/bigconsole/hooks/useExportDataSink.js +1 -1
- package/dist/bigconsole/hooks/useGlobalFilters.js +3 -3
- package/dist/bigconsole/hooks/useImportDataSink.js +102 -90
- package/dist/bigconsole/pages/AdminPage.js +130 -130
- package/dist/bigconsole/pages/DashboardBuilderPage.js +60 -72
- package/dist/bigconsole/pages/DashboardViewPage.js +235 -258
- package/dist/bigconsole/pages/DashboardsPage.js +221 -269
- package/dist/bigconsole/pages/DataParsersPage.js +157 -180
- package/dist/bigconsole/pages/DataSinkAlertsPage.js +55 -62
- package/dist/bigconsole/pages/DataSinkBuilderPage.js +318 -295
- package/dist/bigconsole/pages/DataSinkViewPage.js +256 -255
- package/dist/bigconsole/pages/DataSinksPage.js +216 -251
- package/dist/bigconsole/pages/DataSourcesPage.js +5 -5
- package/dist/bigconsole/pages/InsightsPage.js +265 -279
- package/dist/bigconsole/pages/OverviewPage.js +47 -47
- package/dist/bigconsole/pages/ParserBuilderPage.js +213 -229
- package/dist/bigconsole/pages/ParserViewPage.js +97 -97
- package/dist/bigconsole/pages/PipelineBuilderPage.js +214 -256
- package/dist/bigconsole/pages/PipelineViewPage.js +146 -146
- package/dist/bigconsole/pages/PipelinesPage.js +88 -107
- package/dist/bigconsole/pages/SettingsPage.js +173 -179
- package/dist/bigconsole/pages/WidgetDemoPage.js +42 -42
- package/dist/bigconsole/pages/WorkflowViewPage.js +1 -1
- package/dist/bigconsole/pages/WorkflowsPage.js +141 -141
- package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +12 -12
- package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +235 -122
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.d.ts +6 -1
- package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +151 -151
- package/dist/bigconsole/renderers/adapters/CustomRenderer.js +46 -46
- package/dist/bigconsole/renderers/adapters/adaptiveCardContent.d.ts +29 -0
- package/dist/bigconsole/renderers/adapters/adaptiveCardContent.js +51 -0
- package/dist/bigconsole/store/widgetStore.d.ts +0 -12
- package/dist/bigconsole/store/widgetStore.js +1 -3
- package/dist/bigconsole/types/index.d.ts +17 -2
- package/dist/bigconsole/utils/backendError.d.ts +0 -18
- package/dist/bigconsole/utils/dataSinkPayload.d.ts +48 -0
- package/dist/bigconsole/utils/dataSinkPayload.js +38 -0
- package/dist/bigconsole/utils/index.d.ts +2 -0
- package/dist/bigconsole/utils/safeUrl.d.ts +79 -0
- package/dist/bigconsole/utils/safeUrl.js +93 -0
- package/dist/bigconsole/utils/sanitizeHtml.d.ts +16 -0
- package/dist/bigconsole/utils/sanitizeHtml.js +67 -0
- package/dist/bigconsole/workflowOpen.js +14 -15
- package/dist/generated/wspace-operations.d.ts +138 -8
- package/dist/generated/wspace-operations.js +281 -240
- package/dist/node_modules/dompurify/dist/purify.es.js +800 -0
- package/package.json +9 -5
- package/dist/bigconsole/assistant/displayCopy.d.ts +0 -32
- package/dist/bigconsole/assistant/pageControls.d.ts +0 -81
- package/dist/bigconsole/assistant/pageControls.js +0 -169
- package/dist/bigconsole/assistant/previewControl.d.ts +0 -16
- package/dist/bigconsole/assistant/previewControl.js +0 -10
- package/dist/bigconsole/assistant/usePreviewControl.d.ts +0 -2
- package/dist/bigconsole/assistant/usePreviewControl.js +0 -20
- package/dist/bigconsole/components/common/SortBySelect.d.ts +0 -11
- package/dist/bigconsole/components/common/SortBySelect.js +0 -29
- package/dist/bigconsole/constants/backendErrors.js +0 -94
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts +0 -14
- package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js +0 -32
- package/dist/bigconsole/utils/backendError.js +0 -42
- package/dist/bigconsole/utils/dashboardList.d.ts +0 -28
- package/dist/bigconsole/utils/dashboardList.js +0 -15
- package/dist/bigconsole/utils/dataSinkList.d.ts +0 -15
- package/dist/bigconsole/utils/dataSinkList.js +0 -15
- package/dist/bigconsole/utils/formDirty.d.ts +0 -82
- package/dist/bigconsole/utils/formDirty.js +0 -21
- package/dist/bigconsole/utils/insightsDraft.d.ts +0 -29
- package/dist/bigconsole/utils/insightsDraft.js +0 -8
- package/dist/bigconsole/utils/layoutBaseline.d.ts +0 -130
- package/dist/bigconsole/utils/layoutBaseline.js +0 -96
- package/dist/bigconsole/utils/listSort.d.ts +0 -80
- package/dist/bigconsole/utils/listSort.js +0 -85
- package/dist/bigconsole/utils/widgetFormDirty.d.ts +0 -16
- package/dist/bigconsole/utils/widgetFormDirty.js +0 -13
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CreateDataSinkDocument as e, GetDataSinkDocument as t,
|
|
2
|
-
import { createBigConsoleQuotaError as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { useApolloClient as
|
|
1
|
+
import { CreateDataSinkDocument as e, GetDataSinkDocument as t, GetDataSinkPayloadDocument as n, UpdateDataSinkDocument as r } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { createBigConsoleQuotaError as i, isBigConsoleQuotaError as a } from "../utils/quota.js";
|
|
3
|
+
import { useCallback as o, useState as s } from "react";
|
|
4
|
+
import { useApolloClient as c } from "@apollo/client/react";
|
|
5
5
|
//#region src/bigconsole/hooks/useImportDataSink.ts
|
|
6
|
-
function
|
|
6
|
+
function l(e) {
|
|
7
7
|
return new Promise((t, n) => {
|
|
8
8
|
let r = new FileReader();
|
|
9
9
|
r.onload = (e) => {
|
|
@@ -12,30 +12,42 @@ function c(e) {
|
|
|
12
12
|
}, r.onerror = () => n(/* @__PURE__ */ Error("Failed to read file")), r.readAsText(e);
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function u(e) {
|
|
16
16
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
async function d(e, t, r) {
|
|
19
|
+
try {
|
|
20
|
+
let i = (await e.query({
|
|
21
|
+
query: n,
|
|
22
|
+
variables: { id: t },
|
|
23
|
+
fetchPolicy: "network-only"
|
|
24
|
+
})).data?.getDataSink;
|
|
25
|
+
return !i || JSON.stringify(i.data) !== JSON.stringify(r);
|
|
26
|
+
} catch {
|
|
27
|
+
return !0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function f(e) {
|
|
19
31
|
let t = e;
|
|
20
|
-
return
|
|
32
|
+
return u(t.dataSink) ? t.dataSink : typeof e.key == "string" ? e : null;
|
|
21
33
|
}
|
|
22
|
-
function
|
|
34
|
+
function p(e) {
|
|
23
35
|
if (e) return {
|
|
24
36
|
type: e.type,
|
|
25
|
-
...e.schedule ? { schedule:
|
|
37
|
+
...e.schedule ? { schedule: m(e.schedule) } : {}
|
|
26
38
|
};
|
|
27
39
|
}
|
|
28
|
-
function
|
|
40
|
+
function m(e) {
|
|
29
41
|
if (e == null) return e;
|
|
30
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
42
|
+
if (Array.isArray(e)) return e.map((e) => m(e));
|
|
31
43
|
if (typeof e == "object") {
|
|
32
44
|
let t = {};
|
|
33
|
-
for (let [n, r] of Object.entries(e)) n !== "__typename" && (t[n] =
|
|
45
|
+
for (let [n, r] of Object.entries(e)) n !== "__typename" && (t[n] = m(r));
|
|
34
46
|
return t;
|
|
35
47
|
}
|
|
36
48
|
return e;
|
|
37
49
|
}
|
|
38
|
-
function
|
|
50
|
+
function h(e) {
|
|
39
51
|
try {
|
|
40
52
|
let t = JSON.parse(e), n = t;
|
|
41
53
|
return n.exportedFrom?.dataSinkId || n.dataSink?.id || t.id || null;
|
|
@@ -43,10 +55,10 @@ function p(e) {
|
|
|
43
55
|
return null;
|
|
44
56
|
}
|
|
45
57
|
}
|
|
46
|
-
function
|
|
58
|
+
function g(e) {
|
|
47
59
|
let t = [];
|
|
48
60
|
try {
|
|
49
|
-
let n = JSON.parse(e), r = n, i =
|
|
61
|
+
let n = JSON.parse(e), r = n, i = f(n);
|
|
50
62
|
if (!r.schemaVersion && !i && t.push({
|
|
51
63
|
code: "MISSING_SCHEMA_VERSION",
|
|
52
64
|
message: "Missing schema version"
|
|
@@ -89,150 +101,150 @@ function m(e) {
|
|
|
89
101
|
};
|
|
90
102
|
}
|
|
91
103
|
}
|
|
92
|
-
function
|
|
93
|
-
let [
|
|
94
|
-
let t =
|
|
95
|
-
return
|
|
96
|
-
}, []),
|
|
104
|
+
function _() {
|
|
105
|
+
let [n, u] = s(!1), [_, v] = s(null), [y, b] = s(null), [x, S] = s(null), C = c(), w = o((e) => {
|
|
106
|
+
let t = g(e);
|
|
107
|
+
return b(t), t;
|
|
108
|
+
}, []), T = o((e) => h(e), []), E = o(async (n, o = {}) => {
|
|
97
109
|
try {
|
|
98
|
-
|
|
99
|
-
let s =
|
|
110
|
+
u(!0), v(null);
|
|
111
|
+
let s = g(n);
|
|
100
112
|
if (!s.isValid || !s.dataSinkInfo) throw Error(s.errors[0]?.message || "Invalid import content");
|
|
101
|
-
let c =
|
|
113
|
+
let c = f(JSON.parse(n));
|
|
102
114
|
if (!c) throw Error("Missing DataSink payload in import content");
|
|
103
|
-
let l = Object.prototype.hasOwnProperty.call(c, "data"),
|
|
104
|
-
if (
|
|
105
|
-
let e = (await
|
|
115
|
+
let l = Object.prototype.hasOwnProperty.call(c, "data"), _ = h(n), y = !1, b;
|
|
116
|
+
if (_) try {
|
|
117
|
+
let e = (await C.query({
|
|
106
118
|
query: t,
|
|
107
|
-
variables: { id:
|
|
119
|
+
variables: { id: _ },
|
|
108
120
|
fetchPolicy: "network-only"
|
|
109
121
|
})).data?.getDataSink;
|
|
110
122
|
if (e) {
|
|
111
|
-
if (l &&
|
|
123
|
+
if (l && await d(C, _, c.data) || (e.description || "") !== (c.description || "") || e.ttl !== c.ttl || e.fieldMaskingEnabled !== (c.fieldMaskingEnabled ?? !1) || JSON.stringify(e.fieldMaskingRules) !== JSON.stringify(c.fieldMaskingRules) || JSON.stringify(e.refresh) !== JSON.stringify(c.refresh) || JSON.stringify(e.exports) !== JSON.stringify(c.exports) || JSON.stringify(e.alerts) !== JSON.stringify(c.alerts) || JSON.stringify(e.quota) !== JSON.stringify(c.quota) || JSON.stringify(e.metadata) !== JSON.stringify(c.metadata)) {
|
|
112
124
|
let t = {
|
|
113
|
-
id:
|
|
125
|
+
id: _,
|
|
114
126
|
version: e.version,
|
|
115
127
|
name: e.name,
|
|
116
128
|
description: c.description || void 0,
|
|
117
|
-
...l && { data:
|
|
129
|
+
...l && { data: m(c.data) },
|
|
118
130
|
ttl: c.ttl ?? void 0,
|
|
119
131
|
fieldMaskingEnabled: c.fieldMaskingEnabled ?? !1,
|
|
120
|
-
fieldMaskingRules:
|
|
121
|
-
refresh:
|
|
122
|
-
exports:
|
|
123
|
-
alerts:
|
|
124
|
-
quota:
|
|
125
|
-
metadata:
|
|
126
|
-
},
|
|
127
|
-
mutation:
|
|
132
|
+
fieldMaskingRules: m(c.fieldMaskingRules) || void 0,
|
|
133
|
+
refresh: p(c.refresh),
|
|
134
|
+
exports: m(c.exports) || void 0,
|
|
135
|
+
alerts: m(c.alerts) || void 0,
|
|
136
|
+
quota: m(c.quota) || void 0,
|
|
137
|
+
metadata: m(c.metadata) || void 0
|
|
138
|
+
}, n = (await C.mutate({
|
|
139
|
+
mutation: r,
|
|
128
140
|
variables: { input: t }
|
|
129
141
|
})).data?.updateDataSink;
|
|
130
|
-
|
|
131
|
-
id:
|
|
132
|
-
name:
|
|
133
|
-
key:
|
|
142
|
+
n && (y = !0, b = {
|
|
143
|
+
id: n.id,
|
|
144
|
+
name: n.name,
|
|
145
|
+
key: n.key
|
|
134
146
|
});
|
|
135
147
|
} else {
|
|
136
|
-
|
|
148
|
+
b = {
|
|
137
149
|
id: e.id,
|
|
138
150
|
name: e.name,
|
|
139
151
|
key: e.key
|
|
140
152
|
};
|
|
141
153
|
let t = {
|
|
142
154
|
success: !0,
|
|
143
|
-
dataSink:
|
|
155
|
+
dataSink: b,
|
|
144
156
|
originalUpdated: !1,
|
|
145
|
-
originalDataSink:
|
|
157
|
+
originalDataSink: b,
|
|
146
158
|
alreadyExists: !0
|
|
147
159
|
};
|
|
148
|
-
return
|
|
160
|
+
return S(t), t;
|
|
149
161
|
}
|
|
150
162
|
let t = {
|
|
151
163
|
success: !0,
|
|
152
|
-
dataSink:
|
|
153
|
-
originalUpdated:
|
|
154
|
-
originalDataSink:
|
|
164
|
+
dataSink: b,
|
|
165
|
+
originalUpdated: y,
|
|
166
|
+
originalDataSink: b,
|
|
155
167
|
alreadyExists: !1
|
|
156
168
|
};
|
|
157
|
-
return
|
|
169
|
+
return S(t), t;
|
|
158
170
|
}
|
|
159
171
|
} catch (e) {
|
|
160
172
|
console.warn("Could not fetch original DataSink:", e);
|
|
161
173
|
}
|
|
162
|
-
let
|
|
174
|
+
let x = {
|
|
163
175
|
name: o.name || c.name || "Imported DataSink",
|
|
164
176
|
key: o.key || c.key || "",
|
|
165
177
|
description: c.description || void 0,
|
|
166
|
-
config:
|
|
167
|
-
...l && { data:
|
|
178
|
+
config: m(c.config) || void 0,
|
|
179
|
+
...l && { data: m(c.data) },
|
|
168
180
|
ttl: c.ttl ?? void 0,
|
|
169
181
|
fieldMaskingEnabled: c.fieldMaskingEnabled ?? !1,
|
|
170
|
-
fieldMaskingRules:
|
|
171
|
-
refresh:
|
|
172
|
-
exports:
|
|
173
|
-
alerts:
|
|
174
|
-
quota:
|
|
175
|
-
metadata:
|
|
176
|
-
},
|
|
182
|
+
fieldMaskingRules: m(c.fieldMaskingRules) || void 0,
|
|
183
|
+
refresh: p(c.refresh),
|
|
184
|
+
exports: m(c.exports) || void 0,
|
|
185
|
+
alerts: m(c.alerts) || void 0,
|
|
186
|
+
quota: m(c.quota) || void 0,
|
|
187
|
+
metadata: m(c.metadata) || void 0
|
|
188
|
+
}, w = await C.mutate({
|
|
177
189
|
mutation: e,
|
|
178
|
-
variables: { input:
|
|
190
|
+
variables: { input: x }
|
|
179
191
|
});
|
|
180
|
-
if (
|
|
181
|
-
let
|
|
182
|
-
if (
|
|
192
|
+
if (a(w)) throw i(w);
|
|
193
|
+
let T = w.data?.createDataSink;
|
|
194
|
+
if (T) {
|
|
183
195
|
let e = {
|
|
184
196
|
success: !0,
|
|
185
197
|
dataSink: {
|
|
186
|
-
id:
|
|
187
|
-
name:
|
|
188
|
-
key:
|
|
198
|
+
id: T.id,
|
|
199
|
+
name: T.name,
|
|
200
|
+
key: T.key
|
|
189
201
|
},
|
|
190
202
|
originalUpdated: !1,
|
|
191
203
|
originalDataSink: void 0
|
|
192
204
|
};
|
|
193
|
-
return
|
|
205
|
+
return S(e), e;
|
|
194
206
|
}
|
|
195
207
|
throw Error("Import returned empty result");
|
|
196
208
|
} catch (e) {
|
|
197
|
-
if (
|
|
209
|
+
if (a(e)) throw e;
|
|
198
210
|
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to import DataSink");
|
|
199
|
-
|
|
211
|
+
v(t);
|
|
200
212
|
let n = {
|
|
201
213
|
success: !1,
|
|
202
214
|
errorMessage: t.message
|
|
203
215
|
};
|
|
204
|
-
return
|
|
216
|
+
return S(n), n;
|
|
205
217
|
} finally {
|
|
206
|
-
|
|
218
|
+
u(!1);
|
|
207
219
|
}
|
|
208
|
-
}, [
|
|
220
|
+
}, [C]);
|
|
209
221
|
return {
|
|
210
|
-
loading:
|
|
211
|
-
error:
|
|
212
|
-
validationResult:
|
|
213
|
-
importResult:
|
|
214
|
-
validateImport:
|
|
215
|
-
importDataSink:
|
|
216
|
-
importFromFile:
|
|
222
|
+
loading: n,
|
|
223
|
+
error: _,
|
|
224
|
+
validationResult: y,
|
|
225
|
+
importResult: x,
|
|
226
|
+
validateImport: w,
|
|
227
|
+
importDataSink: E,
|
|
228
|
+
importFromFile: o(async (e, t = {}) => {
|
|
217
229
|
try {
|
|
218
230
|
if (!e.name.endsWith(".json")) throw Error("Invalid file type. Please select a JSON file.");
|
|
219
|
-
let n = await
|
|
231
|
+
let n = await l(e);
|
|
220
232
|
try {
|
|
221
233
|
JSON.parse(n);
|
|
222
234
|
} catch {
|
|
223
235
|
throw Error("Invalid JSON format. Please select a valid export file.");
|
|
224
236
|
}
|
|
225
|
-
return await
|
|
237
|
+
return await E(n, t);
|
|
226
238
|
} catch (e) {
|
|
227
|
-
if (
|
|
228
|
-
return
|
|
239
|
+
if (a(e)) throw e;
|
|
240
|
+
return v(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to import from file")), null;
|
|
229
241
|
}
|
|
230
|
-
}, [
|
|
231
|
-
extractDataSinkId:
|
|
232
|
-
clearState:
|
|
233
|
-
|
|
242
|
+
}, [E]),
|
|
243
|
+
extractDataSinkId: T,
|
|
244
|
+
clearState: o(() => {
|
|
245
|
+
v(null), b(null), S(null);
|
|
234
246
|
}, [])
|
|
235
247
|
};
|
|
236
248
|
}
|
|
237
249
|
//#endregion
|
|
238
|
-
export {
|
|
250
|
+
export { _ as default };
|