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