@burdenoff/microfe-bigconsole 2026.804.2 → 2026.805.2

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 (53) hide show
  1. package/dist/bigconsole/AdminRoot.js +21 -16
  2. package/dist/bigconsole/AdminRoot.js.map +1 -1
  3. package/dist/bigconsole/BigConsoleRoot.js +44 -39
  4. package/dist/bigconsole/BigConsoleRoot.js.map +1 -1
  5. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +115 -100
  6. package/dist/bigconsole/components/dashboard/DashboardToolbar.js.map +1 -1
  7. package/dist/bigconsole/components/dashboard/PageTabsManager/PageTabsManager.js +100 -98
  8. package/dist/bigconsole/components/dashboard/PageTabsManager/PageTabsManager.js.map +1 -1
  9. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +164 -161
  10. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js.map +1 -1
  11. package/dist/bigconsole/components/datasink/DataSinkCard.js +20 -20
  12. package/dist/bigconsole/components/datasink/DataSinkCard.js.map +1 -1
  13. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +216 -49
  14. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js.map +1 -1
  15. package/dist/bigconsole/components/widgets/ActionConfigDialog.js +96 -90
  16. package/dist/bigconsole/components/widgets/ActionConfigDialog.js.map +1 -1
  17. package/dist/bigconsole/components/widgets/WidgetMenu.js +87 -76
  18. package/dist/bigconsole/components/widgets/WidgetMenu.js.map +1 -1
  19. package/dist/bigconsole/components/widgets/widget-actions/WidgetActions.js +120 -118
  20. package/dist/bigconsole/components/widgets/widget-actions/WidgetActions.js.map +1 -1
  21. package/dist/bigconsole/pages/DashboardBuilderPage.js +113 -104
  22. package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
  23. package/dist/bigconsole/pages/DashboardViewPage.js +208 -199
  24. package/dist/bigconsole/pages/DashboardViewPage.js.map +1 -1
  25. package/dist/bigconsole/pages/DashboardsPage.js +376 -325
  26. package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
  27. package/dist/bigconsole/pages/DataParsersPage.js +135 -125
  28. package/dist/bigconsole/pages/DataParsersPage.js.map +1 -1
  29. package/dist/bigconsole/pages/DataSinkBuilderPage.js +182 -172
  30. package/dist/bigconsole/pages/DataSinkBuilderPage.js.map +1 -1
  31. package/dist/bigconsole/pages/DataSinkViewPage.js +233 -198
  32. package/dist/bigconsole/pages/DataSinkViewPage.js.map +1 -1
  33. package/dist/bigconsole/pages/DataSinksPage.js +281 -268
  34. package/dist/bigconsole/pages/DataSinksPage.js.map +1 -1
  35. package/dist/bigconsole/pages/ParserBuilderPage.js +238 -223
  36. package/dist/bigconsole/pages/ParserBuilderPage.js.map +1 -1
  37. package/dist/bigconsole/pages/ParserViewPage.js +162 -144
  38. package/dist/bigconsole/pages/ParserViewPage.js.map +1 -1
  39. package/dist/bigconsole/pages/PipelineBuilderPage.js +212 -204
  40. package/dist/bigconsole/pages/PipelineBuilderPage.js.map +1 -1
  41. package/dist/bigconsole/pages/PipelineViewPage.js +191 -183
  42. package/dist/bigconsole/pages/PipelineViewPage.js.map +1 -1
  43. package/dist/bigconsole/pages/PipelinesPage.js +128 -103
  44. package/dist/bigconsole/pages/PipelinesPage.js.map +1 -1
  45. package/dist/bigconsole/pages/WorkflowViewPage.js +238 -217
  46. package/dist/bigconsole/pages/WorkflowViewPage.js.map +1 -1
  47. package/dist/bigconsole/pages/WorkflowsPage.js +116 -102
  48. package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
  49. package/dist/bigconsole/utils/csv.js +91 -0
  50. package/dist/bigconsole/utils/csv.js.map +1 -0
  51. package/dist/constants/permissions.js +83 -0
  52. package/dist/constants/permissions.js.map +1 -0
  53. package/package.json +2 -2
@@ -4,44 +4,47 @@ import "../contexts/index.js";
4
4
  import { newWorkflowPath as n } from "../BigConsoleRoutes.js";
5
5
  import ee from "../components/datasink/DataSinkTableViewer.js";
6
6
  import te from "../hooks/useDataSinkOperations.js";
7
- import r from "../components/datasink/DataSinkStatusBadge.js";
8
- import { isNative as i, nativeConfirm as ne, nativeImpact as a, nativeNotify as o } from "../../utils/nativeBridge.js";
9
- import re from "../hooks/useDataSinkSubscription.js";
10
- import ie from "../components/datasink/DataSinkDataViewer.js";
11
- import ae from "../components/datasink/LinkedWorkflowsPanel.js";
12
- import oe from "../components/datasink/LinkedParsersPanel.js";
13
- import se from "../components/datasink/WorkflowStatusPanel.js";
14
- import ce from "../components/datasink/ExportDataSinkDialog.js";
15
- import le from "../components/datasink/ImportDataGuideDialog.js";
16
- import { memo as s, useCallback as c, useEffect as l, useState as u } from "react";
17
- import { useParams as ue } from "react-router";
18
- import { AlertCircle as de, ArrowLeft as d, Code as fe, Database as f, Download as pe, Edit as me, Eye as he, EyeOff as ge, Grid3X3 as p, Loader2 as m, RefreshCw as _e, Trash2 as ve, Upload as h } from "lucide-react";
19
- import { Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, GlassCard as ye, IllustratedEmptyState as be, NextSteps as xe, PagePurpose as Se } from "@burdenoff/fe-libs/ui";
20
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
21
- import { formatDistanceToNow as w } from "date-fns";
7
+ import { BIGCONSOLE_PERMISSIONS as r } from "../../constants/permissions.js";
8
+ import i from "../components/datasink/DataSinkStatusBadge.js";
9
+ import { isNative as a, nativeConfirm as ne, nativeImpact as re, nativeNotify as o } from "../../utils/nativeBridge.js";
10
+ import ie from "../hooks/useDataSinkSubscription.js";
11
+ import ae from "../components/datasink/DataSinkDataViewer.js";
12
+ import oe from "../components/datasink/LinkedWorkflowsPanel.js";
13
+ import se from "../components/datasink/LinkedParsersPanel.js";
14
+ import ce from "../components/datasink/WorkflowStatusPanel.js";
15
+ import le from "../components/datasink/ExportDataSinkDialog.js";
16
+ import ue from "../components/datasink/ImportDataGuideDialog.js";
17
+ import { memo as s, useCallback as c, useEffect as de, useState as l } from "react";
18
+ import { useParams as u } from "react-router";
19
+ import { AccessDenied as fe, PermissionButton as d } from "@burdenoff/fe-libs/shared/components";
20
+ import { usePermissions as pe } from "@burdenoff/fe-libs/shared/providers/shell";
21
+ import { AlertCircle as me, ArrowLeft as f, Code as he, Database as p, Download as ge, Edit as _e, Eye as ve, EyeOff as ye, Grid3X3 as be, Loader2 as m, RefreshCw as xe, Trash2 as Se, Upload as h } from "lucide-react";
22
+ import { Button as g, Card as Ce, CardContent as _, CardHeader as v, CardTitle as y, GlassCard as we, IllustratedEmptyState as Te, NextSteps as Ee, PagePurpose as De } from "@burdenoff/fe-libs/ui";
23
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
24
+ import { formatDistanceToNow as C } from "date-fns";
22
25
  //#region src/bigconsole/pages/DataSinkViewPage.tsx
23
- var T = s(function() {
24
- let { dataSinkId: s } = ue(), T = t(), [E, D] = u(!1), [O, k] = u(!1), [A, j] = u(!1), [Ce, M] = u(!1), [we, N] = u(!1), [P, Te] = u(null), [F, I] = u(!1), [L, R] = u("table"), [z, Ee] = u(100), [B, De] = u(0), [V, Oe] = u(null), [ke, Ae] = u(!1), H = e((e) => s ? e.dataSinks.get(s) : void 0), { loading: je, error: U, fetchDataSink: W, getDataSinkData: G, refreshDataSink: K, deleteDataSink: q } = te({ skipFetch: !0 });
25
- re({
26
+ var w = s(function() {
27
+ let { dataSinkId: s } = u(), w = t(), { hasPermission: Oe, isLoading: ke } = pe(), Ae = Oe(r.DATASINK_READ), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(!1), [je, j] = l(!1), [Me, M] = l(!1), [N, Ne] = l(null), [P, F] = l(!1), [I, L] = l("table"), [R, Pe] = l(100), [z, Fe] = l(0), [B, Ie] = l(null), [Le, Re] = l(!1), V = e((e) => s ? e.dataSinks.get(s) : void 0), { loading: ze, error: H, fetchDataSink: U, getDataSinkData: W, refreshDataSink: G, updateDataSink: K, deleteDataSink: q } = te({ skipFetch: !0 });
28
+ ie({
26
29
  dataSinkId: s,
27
30
  enabled: !!s
28
- }), l(() => {
29
- s && W(s);
30
- }, [s, W]);
31
+ }), de(() => {
32
+ s && U(s);
33
+ }, [s, U]);
31
34
  let J = c(() => {
32
- T("/datasinks");
33
- }, [T]), Me = c(() => {
34
- T(`/datasinks/${s}/edit`);
35
- }, [T, s]), Y = c(async () => {
35
+ w("/datasinks");
36
+ }, [w]), Be = c(() => {
37
+ w(`/datasinks/${s}/edit`);
38
+ }, [w, s]), Y = c(async () => {
36
39
  if (s) {
37
- k(!0);
40
+ O(!0);
38
41
  try {
39
- await K({ id: s });
42
+ await G({ id: s });
40
43
  } catch {} finally {
41
- k(!1);
44
+ O(!1);
42
45
  }
43
46
  }
44
- }, [s, K]), Ne = c(async () => {
47
+ }, [s, G]), Ve = c(async () => {
45
48
  if (!s) return;
46
49
  let e = await ne({
47
50
  title: "Delete DataSink?",
@@ -50,154 +53,184 @@ var T = s(function() {
50
53
  cancelButtonTitle: "Cancel"
51
54
  });
52
55
  if (e === null ? window.confirm("Are you sure you want to delete this DataSink?") : e) {
53
- a("medium"), j(!0);
56
+ re("medium"), A(!0);
54
57
  try {
55
- await q(s), i() && o("success"), T("/datasinks");
58
+ await q(s), a() && o("success"), w("/datasinks");
56
59
  } catch {
57
- i() && o("error");
60
+ a() && o("error");
58
61
  } finally {
59
- j(!1);
62
+ A(!1);
60
63
  }
61
64
  }
62
65
  }, [
63
66
  s,
64
67
  q,
65
- T
68
+ w
66
69
  ]), X = c(async (e, t) => {
67
70
  if (s) {
68
- I(!0);
71
+ F(!0);
69
72
  try {
70
- let n = await G({ id: s }, {
73
+ let n = await W({ id: s }, {
71
74
  limit: t,
72
75
  offset: e
73
76
  });
74
- n && (Te(n.raw || {}), Oe(typeof n.totalCount == "number" ? n.totalCount : null), Ae(!!n.hasMore), De(e));
77
+ n && (Ne(n.raw || {}), Ie(typeof n.totalCount == "number" ? n.totalCount : null), Re(!!n.hasMore), Fe(e));
75
78
  } catch {} finally {
76
- I(!1);
79
+ F(!1);
77
80
  }
78
81
  }
79
- }, [s, G]), Z = c(async () => {
82
+ }, [s, W]), Z = c(async () => {
80
83
  if (s) {
81
- if (E) {
82
- D(!1);
84
+ if (T) {
85
+ E(!1);
83
86
  return;
84
87
  }
85
- await X(0, z), D(!0);
88
+ await X(0, R), E(!0);
86
89
  }
87
90
  }, [
88
91
  s,
89
- E,
92
+ T,
90
93
  X,
91
- z
92
- ]), Pe = c((e) => {
93
- Ee(e), X(0, e);
94
+ R
95
+ ]), He = c((e) => {
96
+ Pe(e), X(0, e);
94
97
  }, [X]), Q = c(() => {
98
+ j(!0);
99
+ }, []), Ue = c(() => {
100
+ j(!1);
101
+ }, []), $ = c(() => {
95
102
  M(!0);
96
- }, []), Fe = c(() => {
103
+ }, []), We = c(() => {
97
104
  M(!1);
98
- }, []), $ = c(() => {
99
- N(!0);
100
- }, []), Ie = c(() => {
101
- N(!1);
102
- }, []), Le = c(() => {
103
- N(!1), T(n());
104
- }, [T]);
105
- return je && !H ? /* @__PURE__ */ S("div", {
105
+ }, []), Ge = c(() => {
106
+ M(!1), w(n());
107
+ }, [w]), Ke = c(async (e) => {
108
+ if (!V || !await K({
109
+ id: V.id,
110
+ version: V.version,
111
+ data: e
112
+ })) return !1;
113
+ try {
114
+ await X(0, R), E(!0);
115
+ } catch {}
116
+ return !0;
117
+ }, [
118
+ V,
119
+ K,
120
+ X,
121
+ R
122
+ ]);
123
+ return ze && !V ? /* @__PURE__ */ x("div", {
106
124
  className: "flex items-center justify-center min-h-[400px]",
107
- children: /* @__PURE__ */ S(m, { className: "w-8 h-8 text-text-secondary animate-spin" })
108
- }) : U ? /* @__PURE__ */ S("div", {
125
+ children: /* @__PURE__ */ x(m, { className: "w-8 h-8 text-text-secondary animate-spin" })
126
+ }) : H && !V ? /* @__PURE__ */ x("div", {
109
127
  className: "flex items-center justify-center min-h-[400px] p-card-padding",
110
- children: /* @__PURE__ */ C("div", {
128
+ children: /* @__PURE__ */ S("div", {
111
129
  className: "text-center",
112
130
  children: [
113
- /* @__PURE__ */ S(de, { className: "w-12 h-12 text-status-error-text mx-auto mb-4" }),
114
- /* @__PURE__ */ S("p", {
131
+ /* @__PURE__ */ x(me, { className: "w-12 h-12 text-status-error-text mx-auto mb-4" }),
132
+ /* @__PURE__ */ x("p", {
115
133
  className: "text-status-error-text text-body-sm font-medium mb-2",
116
134
  children: "Failed to load DataSink"
117
135
  }),
118
- /* @__PURE__ */ S("p", {
136
+ /* @__PURE__ */ x("p", {
119
137
  className: "text-text-tertiary text-body-xs mb-6",
120
- children: U.message
138
+ children: H.message
121
139
  }),
122
- /* @__PURE__ */ C(g, {
140
+ /* @__PURE__ */ S(g, {
123
141
  onClick: J,
124
142
  variant: "ghost",
125
143
  size: "sm",
126
- children: [/* @__PURE__ */ S(d, { className: "w-4 h-4 mr-2" }), "Go back"]
144
+ children: [/* @__PURE__ */ x(f, { className: "w-4 h-4 mr-2" }), "Go back"]
127
145
  })
128
146
  ]
129
147
  })
130
- }) : H ? /* @__PURE__ */ C("div", {
148
+ }) : !ke && !Ae ? /* @__PURE__ */ x(fe, {
149
+ title: "Access Denied",
150
+ description: "You don't have permission to view this data sink."
151
+ }) : V ? /* @__PURE__ */ S("div", {
131
152
  className: "p-card-padding space-y-6",
132
153
  children: [
133
- /* @__PURE__ */ C("div", {
154
+ /* @__PURE__ */ S("div", {
134
155
  className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",
135
- children: [/* @__PURE__ */ C("div", {
156
+ children: [/* @__PURE__ */ S("div", {
136
157
  className: "flex-1",
137
158
  children: [
138
- /* @__PURE__ */ C(g, {
159
+ /* @__PURE__ */ S(g, {
139
160
  onClick: J,
140
161
  variant: "ghost",
141
162
  size: "sm",
142
163
  className: "mb-4",
143
- children: [/* @__PURE__ */ S(d, { className: "w-4 h-4 mr-2" }), "Back to DataSinks"]
164
+ children: [/* @__PURE__ */ x(f, { className: "w-4 h-4 mr-2" }), "Back to DataSinks"]
144
165
  }),
145
- /* @__PURE__ */ C("div", {
166
+ /* @__PURE__ */ S("div", {
146
167
  className: "flex items-center gap-2 flex-wrap",
147
- children: [/* @__PURE__ */ S("h1", {
168
+ children: [/* @__PURE__ */ x("h1", {
148
169
  className: "text-heading-h1 font-bold text-text-primary",
149
- children: H.name || "Untitled"
150
- }), /* @__PURE__ */ S(r, { status: H.status })]
170
+ children: V.name || "Untitled"
171
+ }), /* @__PURE__ */ x(i, { status: V.status })]
151
172
  }),
152
- /* @__PURE__ */ S("p", {
173
+ /* @__PURE__ */ x("p", {
153
174
  className: "text-body-sm text-text-tertiary font-mono mt-1",
154
- children: H.key
175
+ children: V.key
155
176
  }),
156
- H.description && /* @__PURE__ */ S("p", {
177
+ V.description && /* @__PURE__ */ x("p", {
157
178
  className: "text-body-sm text-text-secondary mt-2",
158
- children: H.description
179
+ children: V.description
159
180
  })
160
181
  ]
161
- }), /* @__PURE__ */ C("div", {
182
+ }), /* @__PURE__ */ S("div", {
162
183
  className: "flex items-center gap-2 flex-wrap",
163
184
  children: [
164
- /* @__PURE__ */ C(g, {
165
- onClick: Y,
166
- disabled: O,
167
- variant: "secondary",
168
- size: "default",
169
- children: [/* @__PURE__ */ S(_e, { className: `w-4 h-4 mr-2 ${O ? "animate-spin" : ""}` }), O ? "Refreshing..." : "Refresh"]
185
+ /* @__PURE__ */ x(d, {
186
+ permission: r.DATASINK_EXECUTE,
187
+ deniedBehavior: "disable",
188
+ children: /* @__PURE__ */ S(g, {
189
+ onClick: Y,
190
+ disabled: D,
191
+ variant: "secondary",
192
+ size: "default",
193
+ children: [/* @__PURE__ */ x(xe, { className: `w-4 h-4 mr-2 ${D ? "animate-spin" : ""}` }), D ? "Refreshing..." : "Refresh"]
194
+ })
170
195
  }),
171
- /* @__PURE__ */ C(g, {
196
+ /* @__PURE__ */ S(g, {
172
197
  onClick: $,
173
198
  variant: "secondary",
174
199
  size: "default",
175
- children: [/* @__PURE__ */ S(h, { className: "w-4 h-4 mr-2" }), "Import Data"]
200
+ children: [/* @__PURE__ */ x(h, { className: "w-4 h-4 mr-2" }), "Import Data"]
176
201
  }),
177
- /* @__PURE__ */ C(g, {
202
+ /* @__PURE__ */ S(g, {
178
203
  onClick: Q,
179
204
  variant: "secondary",
180
205
  size: "default",
181
- children: [/* @__PURE__ */ S(pe, { className: "w-4 h-4 mr-2" }), "Export"]
206
+ children: [/* @__PURE__ */ x(ge, { className: "w-4 h-4 mr-2" }), "Export"]
182
207
  }),
183
- /* @__PURE__ */ C(g, {
184
- onClick: Me,
185
- variant: "secondary",
186
- size: "default",
187
- children: [/* @__PURE__ */ S(me, { className: "w-4 h-4 mr-2" }), "Edit"]
208
+ /* @__PURE__ */ x(d, {
209
+ permission: r.DATASINK_UPDATE,
210
+ deniedBehavior: "disable",
211
+ children: /* @__PURE__ */ S(g, {
212
+ onClick: Be,
213
+ variant: "secondary",
214
+ size: "default",
215
+ children: [/* @__PURE__ */ x(_e, { className: "w-4 h-4 mr-2" }), "Edit"]
216
+ })
188
217
  }),
189
- /* @__PURE__ */ C(g, {
190
- onClick: Ne,
191
- disabled: A,
192
- variant: "destructive",
193
- size: "default",
194
- children: [/* @__PURE__ */ S(ve, { className: "w-4 h-4 mr-2" }), A ? "Deleting..." : "Delete"]
218
+ /* @__PURE__ */ x(d, {
219
+ permission: r.DATASINK_DELETE,
220
+ deniedBehavior: "hide",
221
+ children: /* @__PURE__ */ S(g, {
222
+ onClick: Ve,
223
+ disabled: k,
224
+ variant: "destructive",
225
+ size: "default",
226
+ children: [/* @__PURE__ */ x(Se, { className: "w-4 h-4 mr-2" }), k ? "Deleting..." : "Delete"]
227
+ })
195
228
  })
196
229
  ]
197
230
  })]
198
231
  }),
199
- /* @__PURE__ */ S(Se, { children: "A data sink is a structured store that holds your processed data and serves it to dashboards. From here you can inspect its schema and stats, preview the cached rows, refresh it from its linked workflow, or export it." }),
200
- /* @__PURE__ */ S(xe, {
232
+ /* @__PURE__ */ x(De, { children: "A data sink is a structured store that holds your processed data and serves it to dashboards. From here you can inspect its schema and stats, preview the cached rows, refresh it from its linked workflow, or export it." }),
233
+ /* @__PURE__ */ x(Ee, {
201
234
  storageKey: "bigconsole-datasink-view",
202
235
  steps: [
203
236
  {
@@ -216,7 +249,7 @@ var T = s(function() {
216
249
  id: "build-dashboard",
217
250
  label: "Visualize it on a dashboard",
218
251
  description: "Add widgets that query this sink to see your data live.",
219
- onClick: () => T("/dashboards")
252
+ onClick: () => w("/dashboards")
220
253
  },
221
254
  {
222
255
  id: "export",
@@ -226,225 +259,227 @@ var T = s(function() {
226
259
  }
227
260
  ]
228
261
  }),
229
- /* @__PURE__ */ C("div", {
262
+ /* @__PURE__ */ S("div", {
230
263
  className: "grid gap-6 md:grid-cols-2",
231
264
  children: [
232
- /* @__PURE__ */ C(ye, {
265
+ /* @__PURE__ */ S(we, {
233
266
  treatment: "glass",
234
267
  glow: !0,
235
- children: [/* @__PURE__ */ S(y, { children: /* @__PURE__ */ S(b, { children: "Details" }) }), /* @__PURE__ */ S(v, { children: /* @__PURE__ */ C("dl", {
268
+ children: [/* @__PURE__ */ x(v, { children: /* @__PURE__ */ x(y, { children: "Details" }) }), /* @__PURE__ */ x(_, { children: /* @__PURE__ */ S("dl", {
236
269
  className: "space-y-4 text-body-sm",
237
270
  children: [
238
- /* @__PURE__ */ C("div", {
271
+ /* @__PURE__ */ S("div", {
239
272
  className: "flex justify-between items-center",
240
- children: [/* @__PURE__ */ S("dt", {
273
+ children: [/* @__PURE__ */ x("dt", {
241
274
  className: "text-text-secondary",
242
275
  children: "Status"
243
- }), /* @__PURE__ */ S("dd", { children: /* @__PURE__ */ S(r, { status: H.status }) })]
276
+ }), /* @__PURE__ */ x("dd", { children: /* @__PURE__ */ x(i, { status: V.status }) })]
244
277
  }),
245
- /* @__PURE__ */ C("div", {
278
+ /* @__PURE__ */ S("div", {
246
279
  className: "flex justify-between items-center",
247
- children: [/* @__PURE__ */ S("dt", {
280
+ children: [/* @__PURE__ */ x("dt", {
248
281
  className: "text-text-secondary",
249
282
  children: "Cache TTL"
250
- }), /* @__PURE__ */ S("dd", {
283
+ }), /* @__PURE__ */ x("dd", {
251
284
  className: "text-text-primary font-medium",
252
- children: H.ttl ? `${H.ttl}s` : "None"
285
+ children: V.ttl ? `${V.ttl}s` : "None"
253
286
  })]
254
287
  }),
255
- /* @__PURE__ */ C("div", {
288
+ /* @__PURE__ */ S("div", {
256
289
  className: "flex justify-between items-center",
257
- children: [/* @__PURE__ */ S("dt", {
290
+ children: [/* @__PURE__ */ x("dt", {
258
291
  className: "text-text-secondary",
259
292
  children: "Refresh Type"
260
- }), /* @__PURE__ */ S("dd", {
293
+ }), /* @__PURE__ */ x("dd", {
261
294
  className: "text-text-primary font-medium capitalize",
262
- children: H.refresh?.type || "Manual"
295
+ children: V.refresh?.type || "Manual"
263
296
  })]
264
297
  }),
265
- /* @__PURE__ */ C("div", {
298
+ /* @__PURE__ */ S("div", {
266
299
  className: "flex justify-between items-center",
267
- children: [/* @__PURE__ */ S("dt", {
300
+ children: [/* @__PURE__ */ x("dt", {
268
301
  className: "text-text-secondary",
269
302
  children: "Size"
270
- }), /* @__PURE__ */ S("dd", {
303
+ }), /* @__PURE__ */ x("dd", {
271
304
  className: "text-text-primary font-medium",
272
- children: H.sizeBytes ? `${(H.sizeBytes / 1024).toFixed(2)} KB` : "0 KB"
305
+ children: V.sizeBytes ? `${(V.sizeBytes / 1024).toFixed(2)} KB` : "0 KB"
273
306
  })]
274
307
  }),
275
- /* @__PURE__ */ C("div", {
308
+ /* @__PURE__ */ S("div", {
276
309
  className: "flex justify-between items-center",
277
- children: [/* @__PURE__ */ S("dt", {
310
+ children: [/* @__PURE__ */ x("dt", {
278
311
  className: "text-text-secondary",
279
312
  children: "Version"
280
- }), /* @__PURE__ */ S("dd", {
313
+ }), /* @__PURE__ */ x("dd", {
281
314
  className: "text-text-primary font-medium",
282
- children: H.version || 1
315
+ children: V.version || 1
283
316
  })]
284
317
  }),
285
- /* @__PURE__ */ C("div", {
318
+ /* @__PURE__ */ S("div", {
286
319
  className: "flex justify-between items-center",
287
- children: [/* @__PURE__ */ S("dt", {
320
+ children: [/* @__PURE__ */ x("dt", {
288
321
  className: "text-text-secondary",
289
322
  children: "Last Refreshed"
290
- }), /* @__PURE__ */ S("dd", {
323
+ }), /* @__PURE__ */ x("dd", {
291
324
  className: "text-text-primary font-medium",
292
- children: H.lastRefreshedAt ? w(new Date(H.lastRefreshedAt), { addSuffix: !0 }) : "Never"
325
+ children: V.lastRefreshedAt ? C(new Date(V.lastRefreshedAt), { addSuffix: !0 }) : "Never"
293
326
  })]
294
327
  }),
295
- /* @__PURE__ */ C("div", {
328
+ /* @__PURE__ */ S("div", {
296
329
  className: "flex justify-between items-center",
297
- children: [/* @__PURE__ */ S("dt", {
330
+ children: [/* @__PURE__ */ x("dt", {
298
331
  className: "text-text-secondary",
299
332
  children: "Created"
300
- }), /* @__PURE__ */ S("dd", {
333
+ }), /* @__PURE__ */ x("dd", {
301
334
  className: "text-text-primary font-medium",
302
- children: w(new Date(H.createdAt), { addSuffix: !0 })
335
+ children: C(new Date(V.createdAt), { addSuffix: !0 })
303
336
  })]
304
337
  })
305
338
  ]
306
339
  }) })]
307
340
  }),
308
- H.fluidGridsWorkflowId && /* @__PURE__ */ S(se, {
309
- workflowId: H.fluidGridsWorkflowId,
310
- executionId: H.fluidGridsWorkflowExecutionId || void 0,
311
- lastRefreshedAt: H.lastRefreshedAt || void 0,
312
- setupState: H.setupState,
313
- status: H.status,
341
+ V.fluidGridsWorkflowId && /* @__PURE__ */ x(ce, {
342
+ workflowId: V.fluidGridsWorkflowId,
343
+ executionId: V.fluidGridsWorkflowExecutionId || void 0,
344
+ lastRefreshedAt: V.lastRefreshedAt || void 0,
345
+ setupState: V.setupState,
346
+ status: V.status,
314
347
  onRerunWorkflow: Y,
315
- disabled: O,
316
- isRerunning: O
348
+ disabled: D,
349
+ isRerunning: D
317
350
  }),
318
- /* @__PURE__ */ S(ae, { workflowLinks: H.workflowLinks }),
319
- /* @__PURE__ */ S(oe, { dataSinkKey: H.key })
351
+ /* @__PURE__ */ x(oe, { workflowLinks: V.workflowLinks }),
352
+ /* @__PURE__ */ x(se, { dataSinkKey: V.key })
320
353
  ]
321
354
  }),
322
- /* @__PURE__ */ C(_, { children: [
323
- /* @__PURE__ */ C(y, {
355
+ /* @__PURE__ */ S(Ce, { children: [
356
+ /* @__PURE__ */ S(v, {
324
357
  className: "flex flex-row items-center justify-between space-y-0",
325
- children: [/* @__PURE__ */ C(b, {
358
+ children: [/* @__PURE__ */ S(y, {
326
359
  className: "flex items-center gap-2",
327
- children: [/* @__PURE__ */ S(f, { className: "w-4 h-4 text-text-secondary" }), "Data Preview"]
328
- }), /* @__PURE__ */ C("div", {
360
+ children: [/* @__PURE__ */ x(p, { className: "w-4 h-4 text-text-secondary" }), "Data Preview"]
361
+ }), /* @__PURE__ */ S("div", {
329
362
  className: "flex items-center gap-2",
330
- children: [E && /* @__PURE__ */ C("div", {
363
+ children: [T && /* @__PURE__ */ S("div", {
331
364
  className: "flex items-center border border-border-default rounded-md overflow-hidden",
332
- children: [/* @__PURE__ */ S("button", {
365
+ children: [/* @__PURE__ */ x("button", {
333
366
  type: "button",
334
- onClick: () => R("table"),
335
- className: `p-1.5 ${L === "table" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
367
+ onClick: () => L("table"),
368
+ className: `p-1.5 ${I === "table" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
336
369
  title: "Table view",
337
- children: /* @__PURE__ */ S(p, { className: "w-4 h-4" })
338
- }), /* @__PURE__ */ S("button", {
370
+ children: /* @__PURE__ */ x(be, { className: "w-4 h-4" })
371
+ }), /* @__PURE__ */ x("button", {
339
372
  type: "button",
340
- onClick: () => R("json"),
341
- className: `p-1.5 ${L === "json" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
373
+ onClick: () => L("json"),
374
+ className: `p-1.5 ${I === "json" ? "bg-bg-sunken text-text-primary" : "text-text-secondary hover:text-text-primary"}`,
342
375
  title: "JSON view",
343
- children: /* @__PURE__ */ S(fe, { className: "w-4 h-4" })
376
+ children: /* @__PURE__ */ x(he, { className: "w-4 h-4" })
344
377
  })]
345
- }), /* @__PURE__ */ S(g, {
378
+ }), /* @__PURE__ */ x(g, {
346
379
  onClick: Z,
347
- disabled: F,
348
- variant: E ? "secondary" : "default",
380
+ disabled: P,
381
+ variant: T ? "secondary" : "default",
349
382
  size: "sm",
350
- children: F ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(m, { className: "w-4 h-4 mr-2 animate-spin" }), "Loading..."] }) : E ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(ge, { className: "w-4 h-4 mr-2" }), "Hide Data"] }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(he, { className: "w-4 h-4 mr-2" }), "Show Data"] })
383
+ children: P ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(m, { className: "w-4 h-4 mr-2 animate-spin" }), "Loading..."] }) : T ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(ye, { className: "w-4 h-4 mr-2" }), "Hide Data"] }) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(ve, { className: "w-4 h-4 mr-2" }), "Show Data"] })
351
384
  })]
352
385
  })]
353
386
  }),
354
- E && P && /* @__PURE__ */ C(v, { children: [S(L === "table" ? ee : ie, {
355
- data: P,
387
+ T && N && /* @__PURE__ */ S(_, { children: [x(I === "table" ? ee : ae, {
388
+ data: N,
356
389
  maxHeight: "400px"
357
- }), V !== null && /* @__PURE__ */ C("div", {
390
+ }), B !== null && /* @__PURE__ */ S("div", {
358
391
  className: "flex items-center justify-between gap-4 mt-4 pt-4 border-t border-border-subtle",
359
- children: [/* @__PURE__ */ C("div", {
392
+ children: [/* @__PURE__ */ S("div", {
360
393
  className: "flex items-center gap-2 text-body-sm text-text-secondary",
361
- children: [/* @__PURE__ */ S("span", { children: "Rows per page" }), /* @__PURE__ */ S("select", {
394
+ children: [/* @__PURE__ */ x("span", { children: "Rows per page" }), /* @__PURE__ */ x("select", {
362
395
  "aria-label": "Rows per page",
363
396
  className: "bg-bg-canvas border border-border-default rounded px-2 py-0.5 text-text-primary",
364
- value: z,
365
- onChange: (e) => Pe(Number(e.target.value)),
397
+ value: R,
398
+ onChange: (e) => He(Number(e.target.value)),
366
399
  children: [
367
400
  100,
368
401
  500,
369
402
  1e3
370
- ].map((e) => /* @__PURE__ */ S("option", {
403
+ ].map((e) => /* @__PURE__ */ x("option", {
371
404
  value: e,
372
405
  children: e
373
406
  }, e))
374
407
  })]
375
- }), /* @__PURE__ */ C("div", {
408
+ }), /* @__PURE__ */ S("div", {
376
409
  className: "flex items-center gap-4 text-body-sm text-text-secondary",
377
410
  children: [
378
- /* @__PURE__ */ S("span", { children: V === 0 ? "0 rows" : `${B + 1}–${Math.min(B + z, V)} of ${V}` }),
379
- /* @__PURE__ */ S(g, {
411
+ /* @__PURE__ */ x("span", { children: B === 0 ? "0 rows" : `${z + 1}–${Math.min(z + R, B)} of ${B}` }),
412
+ /* @__PURE__ */ x(g, {
380
413
  variant: "secondary",
381
414
  size: "sm",
382
- disabled: B === 0 || F,
383
- onClick: () => void X(Math.max(0, B - z), z),
415
+ disabled: z === 0 || P,
416
+ onClick: () => void X(Math.max(0, z - R), R),
384
417
  children: "Previous"
385
418
  }),
386
- /* @__PURE__ */ S(g, {
419
+ /* @__PURE__ */ x(g, {
387
420
  variant: "secondary",
388
421
  size: "sm",
389
- disabled: !ke || F,
390
- onClick: () => void X(B + z, z),
422
+ disabled: !Le || P,
423
+ onClick: () => void X(z + R, R),
391
424
  children: "Next"
392
425
  })
393
426
  ]
394
427
  })]
395
428
  })] }),
396
- !E && (H.data && Object.keys(H.data).length > 0 ? /* @__PURE__ */ C(v, {
429
+ !T && (V.data && Object.keys(V.data).length > 0 ? /* @__PURE__ */ S(_, {
397
430
  className: "text-center p-8",
398
- children: [/* @__PURE__ */ S(f, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }), /* @__PURE__ */ S("p", {
431
+ children: [/* @__PURE__ */ x(p, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }), /* @__PURE__ */ x("p", {
399
432
  className: "text-body-sm text-text-secondary",
400
433
  children: "Click \"Show Data\" to preview the cached data."
401
434
  })]
402
- }) : /* @__PURE__ */ C(v, {
435
+ }) : /* @__PURE__ */ S(_, {
403
436
  className: "text-center p-8",
404
437
  children: [
405
- /* @__PURE__ */ S(f, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }),
406
- /* @__PURE__ */ S("p", {
438
+ /* @__PURE__ */ x(p, { className: "w-10 h-10 text-text-tertiary mx-auto mb-4" }),
439
+ /* @__PURE__ */ x("p", {
407
440
  className: "text-body-sm text-text-secondary mb-4",
408
- children: "This data sink has no data yet. Import data by building a workflow."
441
+ children: "This data sink has no data yet. Upload a CSV or build a workflow to import data."
409
442
  }),
410
- /* @__PURE__ */ C(g, {
443
+ /* @__PURE__ */ S(g, {
411
444
  onClick: $,
412
445
  variant: "default",
413
446
  size: "sm",
414
- children: [/* @__PURE__ */ S(h, { className: "w-4 h-4 mr-2" }), "Import Data"]
447
+ children: [/* @__PURE__ */ x(h, { className: "w-4 h-4 mr-2" }), "Import Data"]
415
448
  })
416
449
  ]
417
450
  }))
418
451
  ] }),
419
- /* @__PURE__ */ S(ce, {
420
- isOpen: Ce,
452
+ /* @__PURE__ */ x(le, {
453
+ isOpen: je,
421
454
  dataSinkId: s || null,
422
- dataSinkName: H.name || H.key,
423
- onClose: Fe
455
+ dataSinkName: V.name || V.key,
456
+ onClose: Ue
424
457
  }),
425
- /* @__PURE__ */ S(le, {
426
- isOpen: we,
427
- dataSinkName: H.name || H.key,
428
- onClose: Ie,
429
- onGoToWorkflows: Le
458
+ /* @__PURE__ */ x(ue, {
459
+ isOpen: Me,
460
+ dataSinkName: V.name || V.key,
461
+ hasExistingData: !!(V.data && Object.keys(V.data).length > 0),
462
+ onClose: We,
463
+ onGoToWorkflows: Ge,
464
+ onImportCsv: Ke
430
465
  })
431
466
  ]
432
- }) : /* @__PURE__ */ S("div", {
467
+ }) : /* @__PURE__ */ x("div", {
433
468
  className: "flex items-center justify-center min-h-[400px] p-card-padding",
434
- children: /* @__PURE__ */ S(be, {
469
+ children: /* @__PURE__ */ x(Te, {
435
470
  illustration: "empty-data",
436
471
  title: "DataSink not found",
437
472
  description: "The DataSink you're looking for doesn't exist or has been deleted.",
438
- action: /* @__PURE__ */ C(g, {
473
+ action: /* @__PURE__ */ S(g, {
439
474
  onClick: J,
440
475
  variant: "default",
441
476
  size: "default",
442
- children: [/* @__PURE__ */ S(d, { className: "w-4 h-4 mr-2" }), "Go back to DataSinks"]
477
+ children: [/* @__PURE__ */ x(f, { className: "w-4 h-4 mr-2" }), "Go back to DataSinks"]
443
478
  })
444
479
  })
445
480
  });
446
481
  });
447
482
  //#endregion
448
- export { T as DataSinkViewPage, T as default };
483
+ export { w as DataSinkViewPage, w as default };
449
484
 
450
485
  //# sourceMappingURL=DataSinkViewPage.js.map