@burdenoff/microfe-bigconsole 2026.1012.3 → 2026.1012.5

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 (158) hide show
  1. package/dist/bigconsole/BigConsoleRoutes.js +149 -140
  2. package/dist/bigconsole/assistant/assistantApi.js +5 -5
  3. package/dist/bigconsole/assistant/assistantProduct.js +4 -1
  4. package/dist/bigconsole/assistant/displayCopy.d.ts +32 -0
  5. package/dist/bigconsole/assistant/pageContext.d.ts +14 -0
  6. package/dist/bigconsole/assistant/pageContext.js +6 -1
  7. package/dist/bigconsole/assistant/pageControls.d.ts +81 -0
  8. package/dist/bigconsole/assistant/pageControls.js +169 -0
  9. package/dist/bigconsole/assistant/previewControl.d.ts +16 -0
  10. package/dist/bigconsole/assistant/previewControl.js +10 -0
  11. package/dist/bigconsole/assistant/recordAdapters.js +27 -26
  12. package/dist/bigconsole/assistant/usePreviewControl.d.ts +2 -0
  13. package/dist/bigconsole/assistant/usePreviewControl.js +20 -0
  14. package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +33 -18
  15. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +31 -31
  16. package/dist/bigconsole/components/common/SortBySelect.d.ts +11 -0
  17. package/dist/bigconsole/components/common/SortBySelect.js +29 -0
  18. package/dist/bigconsole/components/common/index.d.ts +1 -0
  19. package/dist/bigconsole/components/common/index.js +1 -0
  20. package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +44 -44
  21. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +36 -36
  22. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +59 -59
  23. package/dist/bigconsole/components/dashboard/DrilldownBreadcrumb.js +15 -15
  24. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +30 -30
  25. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterEditor.js +41 -41
  26. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterPresetSelector.js +34 -34
  27. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +34 -34
  28. package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +153 -153
  29. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +21 -21
  30. package/dist/bigconsole/components/dashboard/SavedViewsDropdown/SavedViewsDropdown.js +46 -46
  31. package/dist/bigconsole/components/dashboard/ShareDialog/EmbedTab.js +134 -134
  32. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +101 -101
  33. package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +31 -31
  34. package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js +15 -15
  35. package/dist/bigconsole/components/dashboard/TemplatePicker/TemplatePicker.js +1 -1
  36. package/dist/bigconsole/components/dashboard/WidgetPalette.js +154 -150
  37. package/dist/bigconsole/components/datasink/AlertExecutionHistory.js +37 -37
  38. package/dist/bigconsole/components/datasink/AlertRuleEditor.js +66 -66
  39. package/dist/bigconsole/components/datasink/CacheTTLSelector.js +35 -35
  40. package/dist/bigconsole/components/datasink/DataSinkCard.js +51 -50
  41. package/dist/bigconsole/components/datasink/DataSinkDeleteDialog.js +18 -18
  42. package/dist/bigconsole/components/datasink/DataSinkRefreshDialog.js +20 -20
  43. package/dist/bigconsole/components/datasink/ImportDataGuideDialog.js +47 -47
  44. package/dist/bigconsole/components/datasink/ImportDataSinkDialog.js +91 -91
  45. package/dist/bigconsole/components/datasink/RefreshTypeSelector.js +35 -35
  46. package/dist/bigconsole/components/embed/renderer-manifest.js +12 -0
  47. package/dist/bigconsole/components/parser/DataSinkSelector.js +40 -40
  48. package/dist/bigconsole/components/parser/ImportParserDialog.js +120 -120
  49. package/dist/bigconsole/components/parser/ParserSelector.js +51 -51
  50. package/dist/bigconsole/components/pipeline/PipelineScopePicker.js +10 -10
  51. package/dist/bigconsole/components/preview/AiPreviewMiniPanel.js +77 -76
  52. package/dist/bigconsole/components/preview/AiPreviewPanel.js +96 -95
  53. package/dist/bigconsole/components/widgets/ActionConfigDialog.js +4 -4
  54. package/dist/bigconsole/components/widgets/DrilldownConfigPanel.js +93 -93
  55. package/dist/bigconsole/components/widgets/PropertiesPanel.js +507 -499
  56. package/dist/bigconsole/components/widgets/WidgetRegistry.js +122 -1
  57. package/dist/bigconsole/components/widgets/WidgetWrapper.js +227 -224
  58. package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.d.ts +10 -0
  59. package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.js +113 -0
  60. package/dist/bigconsole/components/widgets/advanced/AdvancedWidgets.d.ts +10 -0
  61. package/dist/bigconsole/components/widgets/advanced/AdvancedWidgets.js +187 -0
  62. package/dist/bigconsole/components/widgets/advanced/boxPlotDescription.d.ts +7 -0
  63. package/dist/bigconsole/components/widgets/advanced/boxPlotDescription.js +12 -0
  64. package/dist/bigconsole/components/widgets/advanced/data.d.ts +36 -0
  65. package/dist/bigconsole/components/widgets/advanced/data.js +113 -0
  66. package/dist/bigconsole/components/widgets/advanced/mapData.d.ts +10 -0
  67. package/dist/bigconsole/components/widgets/advanced/mapData.js +22 -0
  68. package/dist/bigconsole/components/widgets/advanced/waterfallData.d.ts +15 -0
  69. package/dist/bigconsole/components/widgets/advanced/waterfallData.js +28 -0
  70. package/dist/bigconsole/components/widgets/calendar/CalendarWidget.js +4 -4
  71. package/dist/bigconsole/components/widgets/chart/ChartConfig.js +48 -48
  72. package/dist/bigconsole/components/widgets/chart/charts/WaterfallChart.js +34 -37
  73. package/dist/bigconsole/components/widgets/comments/WidgetComments.js +46 -46
  74. package/dist/bigconsole/components/widgets/event-logs/EventLogViewer.js +61 -61
  75. package/dist/bigconsole/components/widgets/form/FormWidget.js +36 -36
  76. package/dist/bigconsole/components/widgets/gauge/GaugeConfig.js +42 -42
  77. package/dist/bigconsole/components/widgets/heatmap/HeatmapConfig.js +25 -25
  78. package/dist/bigconsole/components/widgets/index.js +1 -1
  79. package/dist/bigconsole/components/widgets/kanban/KanbanWidget.js +4 -4
  80. package/dist/bigconsole/components/widgets/list/ListConfig.js +30 -30
  81. package/dist/bigconsole/components/widgets/map-widget/MapWidget.d.ts +2 -0
  82. package/dist/bigconsole/components/widgets/map-widget/MapWidget.js +64 -63
  83. package/dist/bigconsole/components/widgets/metric-card/MetricCardConfig.js +38 -38
  84. package/dist/bigconsole/components/widgets/metric-card/SparklineChart.js +9 -9
  85. package/dist/bigconsole/components/widgets/metric-card/TrendIndicator.js +9 -9
  86. package/dist/bigconsole/components/widgets/pivot-table/PivotTableWidget.js +49 -49
  87. package/dist/bigconsole/components/widgets/progress/ProgressConfig.js +39 -39
  88. package/dist/bigconsole/components/widgets/table/TableConfig.js +73 -73
  89. package/dist/bigconsole/components/widgets/webhook-config/WebhookConfigPanel.js +64 -64
  90. package/dist/bigconsole/components/workflow/WorkflowOpenGuard.js +15 -15
  91. package/dist/bigconsole/components/workflow/WorkflowSinkLinkForm.js +15 -15
  92. package/dist/bigconsole/constants/backendErrors.js +94 -0
  93. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +10 -10
  94. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +67 -67
  95. package/dist/bigconsole/graphql/widgetCapabilities.d.ts +7 -0
  96. package/dist/bigconsole/graphql/widgetCapabilities.js +37 -0
  97. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.d.ts +14 -0
  98. package/dist/bigconsole/hooks/useDashboardLayoutBaseline.js +32 -0
  99. package/dist/bigconsole/hooks/useDataSinkAlerts.d.ts +23 -0
  100. package/dist/bigconsole/hooks/useDataSinkAlerts.js +138 -113
  101. package/dist/bigconsole/hooks/useDrilldown.js +3 -3
  102. package/dist/bigconsole/hooks/useGlobalFilters.js +3 -3
  103. package/dist/bigconsole/hooks/useWidgetCatalog.js +46 -41
  104. package/dist/bigconsole/hooks/useWidgetOperations.js +113 -88
  105. package/dist/bigconsole/pages/AdminPage.js +130 -130
  106. package/dist/bigconsole/pages/DashboardBuilderPage.js +72 -60
  107. package/dist/bigconsole/pages/DashboardViewPage.js +244 -221
  108. package/dist/bigconsole/pages/DashboardsPage.js +269 -221
  109. package/dist/bigconsole/pages/DataParsersPage.js +180 -157
  110. package/dist/bigconsole/pages/DataSinkAlertsPage.js +62 -55
  111. package/dist/bigconsole/pages/DataSinkBuilderPage.js +252 -234
  112. package/dist/bigconsole/pages/DataSinkViewPage.js +1 -1
  113. package/dist/bigconsole/pages/DataSinksPage.js +335 -299
  114. package/dist/bigconsole/pages/DataSourcesPage.js +5 -5
  115. package/dist/bigconsole/pages/InsightsPage.js +279 -265
  116. package/dist/bigconsole/pages/OverviewPage.js +47 -47
  117. package/dist/bigconsole/pages/ParserBuilderPage.js +229 -213
  118. package/dist/bigconsole/pages/ParserViewPage.js +97 -97
  119. package/dist/bigconsole/pages/PipelineBuilderPage.js +256 -214
  120. package/dist/bigconsole/pages/PipelineViewPage.js +146 -146
  121. package/dist/bigconsole/pages/PipelinesPage.js +107 -88
  122. package/dist/bigconsole/pages/SettingsPage.js +179 -173
  123. package/dist/bigconsole/pages/WidgetDemoPage.js +42 -42
  124. package/dist/bigconsole/pages/WorkflowViewPage.js +1 -1
  125. package/dist/bigconsole/pages/WorkflowsPage.js +141 -141
  126. package/dist/bigconsole/providers/BigConsoleQuotaProvider.js +12 -12
  127. package/dist/bigconsole/renderers/adapters/AdaptiveCardRenderer.js +34 -34
  128. package/dist/bigconsole/renderers/adapters/BigConsoleRenderer.js +8 -5
  129. package/dist/bigconsole/renderers/adapters/BlockKitRenderer.js +69 -69
  130. package/dist/bigconsole/renderers/adapters/CustomRenderer.js +46 -46
  131. package/dist/bigconsole/store/widgetStore.d.ts +12 -0
  132. package/dist/bigconsole/store/widgetStore.js +3 -1
  133. package/dist/bigconsole/types/index.d.ts +1 -1
  134. package/dist/bigconsole/utils/advancedWidgetCapabilities.d.ts +14 -0
  135. package/dist/bigconsole/utils/advancedWidgetCapabilities.js +36 -0
  136. package/dist/bigconsole/utils/backendError.d.ts +18 -0
  137. package/dist/bigconsole/utils/backendError.js +42 -0
  138. package/dist/bigconsole/utils/dashboardList.d.ts +28 -0
  139. package/dist/bigconsole/utils/dashboardList.js +15 -0
  140. package/dist/bigconsole/utils/dataSinkList.d.ts +15 -0
  141. package/dist/bigconsole/utils/dataSinkList.js +15 -0
  142. package/dist/bigconsole/utils/formDirty.d.ts +82 -0
  143. package/dist/bigconsole/utils/formDirty.js +21 -0
  144. package/dist/bigconsole/utils/insightsDraft.d.ts +29 -0
  145. package/dist/bigconsole/utils/insightsDraft.js +8 -0
  146. package/dist/bigconsole/utils/layoutBaseline.d.ts +130 -0
  147. package/dist/bigconsole/utils/layoutBaseline.js +96 -0
  148. package/dist/bigconsole/utils/listSort.d.ts +80 -0
  149. package/dist/bigconsole/utils/listSort.js +85 -0
  150. package/dist/bigconsole/utils/widgetFormDirty.d.ts +16 -0
  151. package/dist/bigconsole/utils/widgetFormDirty.js +13 -0
  152. package/dist/bigconsole/utils/widgetTypeMapping.d.ts +1 -1
  153. package/dist/bigconsole/utils/widgetTypeMapping.js +13 -2
  154. package/dist/bigconsole/workflowOpen.js +15 -14
  155. package/dist/generated/wspace-operations.d.ts +61 -2
  156. package/dist/generated/wspace-operations.js +44 -18
  157. package/dist/generated/wspace-types.d.ts +34 -3
  158. package/package.json +3 -3
@@ -1,219 +1,244 @@
1
1
  import { BigConsoleDataSinkAlertChannelsDocument as e, BigConsoleDataSinkAlertExecutionsDocument as t, BigConsoleDataSinkAlertsDocument as n, BigConsoleDeleteDataSinkAlertDocument as r, BigConsolePreviewDataSinkAlertDocument as i, BigConsoleUpsertDataSinkAlertDocument as a } from "../../generated/wspace-operations.js";
2
- import { useBigConsole as o } from "../context/BigConsoleContext.js";
2
+ import { BACKEND_ERROR_MESSAGES as o } from "../constants/backendErrors.js";
3
+ import { graphQLErrorCodes as s } from "../utils/backendError.js";
4
+ import { useBigConsole as c } from "../context/BigConsoleContext.js";
3
5
  import "../context/index.js";
4
- import { useCallback as s, useEffect as c, useLayoutEffect as l, useRef as u, useState as d } from "react";
5
- import { useApolloClient as f } from "@apollo/client/react";
6
+ import { useCallback as l, useEffect as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
7
+ import { useApolloClient as m } from "@apollo/client/react";
6
8
  //#region src/bigconsole/hooks/useDataSinkAlerts.ts
7
- var p = {
9
+ var h = {
8
10
  owner: "",
9
11
  sink: null,
10
12
  channels: [],
11
13
  loading: !1,
12
14
  error: null,
15
+ errorCode: null,
13
16
  channelError: null
14
- }, m = (e) => e instanceof Error ? e.message : "The alert operation failed. Please try again.";
15
- function h(h, g) {
16
- let _ = f(), { currentUser: v, workspaceId: y } = o(), b = `${v?.id ?? ""}|${y ?? ""}|${h}`, x = u(null);
17
- l(() => (x.current = g ? b : null, () => {
18
- x.current = null;
19
- }), [b, g]);
20
- let [S, C] = d(p), [w, T] = d(!1), E = s(() => ({
17
+ }, g = (e) => e instanceof Error ? e.message : "The alert operation failed. Please try again.", _ = "DATASINK_NOT_FOUND", v = new Set([
18
+ _,
19
+ "E_DATASINK_NOT_FOUND",
20
+ "NOT_FOUND"
21
+ ]), y = class extends Error {
22
+ code = _;
23
+ constructor() {
24
+ super("Data sink not found in this workspace."), this.name = "AlertSinkNotFoundError";
25
+ }
26
+ };
27
+ function b(e) {
28
+ return e instanceof y ? e.code : s(e)[0] ?? null;
29
+ }
30
+ function x(e, t) {
31
+ let { error: n, errorCode: r } = t;
32
+ return n === null || r !== null && v.has(r) ? e("bigconsole.alerts.notFound", "Data sink not found.") : r === null ? n : e(`bigconsole.errors.${r}`, o[r] ?? n);
33
+ }
34
+ function S(o, s) {
35
+ let _ = m(), { currentUser: v, workspaceId: x } = c(), S = `${v?.id ?? ""}|${x ?? ""}|${o}`, C = f(null);
36
+ d(() => (C.current = s ? S : null, () => {
37
+ C.current = null;
38
+ }), [S, s]);
39
+ let [w, T] = p(h), [E, D] = p(!1), O = l(() => ({
21
40
  requiredWorkspaceAuth: !0,
22
- requiredWorkspaceId: y,
41
+ requiredWorkspaceId: x,
23
42
  queryDeduplication: !1
24
- }), [y]), D = s(() => g && !!y && !!v?.id && x.current === b, [
25
- g,
26
- y,
43
+ }), [x]), k = l(() => s && !!x && !!v?.id && C.current === S, [
44
+ s,
45
+ x,
27
46
  v?.id,
28
- b
29
- ]), O = s((e) => {
30
- if (!D()) return null;
31
- if (!e || e.id !== h || e.workspaceId !== y) throw Error("Data sink not found in this workspace.");
32
- return C((t) => ({
33
- ...t.owner === b ? t : p,
34
- owner: b,
35
- sink: t.owner === b && t.sink && t.sink.version > e.version ? t.sink : e,
47
+ S
48
+ ]), A = l((e) => {
49
+ if (!k()) return null;
50
+ if (!e || e.id !== o || e.workspaceId !== x) throw new y();
51
+ return T((t) => ({
52
+ ...t.owner === S ? t : h,
53
+ owner: S,
54
+ sink: t.owner === S && t.sink && t.sink.version > e.version ? t.sink : e,
36
55
  loading: !1,
37
- error: null
56
+ error: null,
57
+ errorCode: null
38
58
  })), e;
39
59
  }, [
40
- D,
41
- h,
42
- y,
43
- b
44
- ]), k = s(async () => {
45
- if (D()) {
46
- T(!0), C((e) => ({
47
- ...e.owner === b ? e : p,
48
- owner: b,
60
+ k,
61
+ o,
62
+ x,
63
+ S
64
+ ]), j = l(async () => {
65
+ if (k()) {
66
+ D(!0), T((e) => ({
67
+ ...e.owner === S ? e : h,
68
+ owner: S,
49
69
  loading: !e.sink,
50
- error: null
70
+ error: null,
71
+ errorCode: null
51
72
  }));
52
73
  try {
53
- return O((await _.query({
74
+ return A((await _.query({
54
75
  query: n,
55
- variables: { dataSinkId: h },
76
+ variables: { dataSinkId: o },
56
77
  fetchPolicy: "no-cache",
57
78
  errorPolicy: "none",
58
- context: E()
79
+ context: O()
59
80
  })).data?.getDataSink);
60
81
  } catch (e) {
61
- D() && C((t) => ({
82
+ k() && T((t) => ({
62
83
  ...t,
63
- owner: b,
84
+ owner: S,
64
85
  loading: !1,
65
- error: m(e)
86
+ error: g(e),
87
+ errorCode: b(e)
66
88
  }));
67
89
  } finally {
68
- D() && T(!1);
90
+ k() && D(!1);
69
91
  }
70
92
  }
71
93
  }, [
72
94
  _,
73
- h,
74
- b,
75
- D,
76
- O,
77
- E
78
- ]), A = s(async () => {
79
- if (D()) try {
95
+ o,
96
+ S,
97
+ k,
98
+ A,
99
+ O
100
+ ]), M = l(async () => {
101
+ if (k()) try {
80
102
  let t = await _.query({
81
103
  query: e,
82
- variables: { dataSinkId: h },
104
+ variables: { dataSinkId: o },
83
105
  fetchPolicy: "no-cache",
84
106
  errorPolicy: "none",
85
- context: E()
107
+ context: O()
86
108
  });
87
109
  if (!t.data) throw Error("Delivery channels did not load.");
88
110
  let n = t.data.dataSinkAlertChannels;
89
- D() && C((e) => ({
90
- ...e.owner === b ? e : p,
91
- owner: b,
111
+ k() && T((e) => ({
112
+ ...e.owner === S ? e : h,
113
+ owner: S,
92
114
  channels: n,
93
115
  channelError: null
94
116
  }));
95
117
  } catch (e) {
96
- D() && C((t) => ({
118
+ k() && T((t) => ({
97
119
  ...t,
98
- owner: b,
120
+ owner: S,
99
121
  channels: [],
100
- channelError: m(e)
122
+ channelError: g(e)
101
123
  }));
102
124
  }
103
125
  }, [
104
126
  _,
105
- h,
106
- b,
107
- D,
108
- E
109
- ]);
110
- c(() => {
127
+ o,
128
+ S,
129
+ k,
130
+ O
131
+ ]), N = l(async () => {
132
+ await j() && await M();
133
+ }, [j, M]);
134
+ u(() => {
111
135
  Promise.resolve().then(() => {
112
- D() && (k(), A());
136
+ k() && N();
113
137
  });
114
138
  let e = window.setInterval(() => {
115
- document.visibilityState === "visible" && k();
139
+ document.visibilityState === "visible" && j();
116
140
  }, 1e4);
117
141
  return () => window.clearInterval(e);
118
142
  }, [
119
- D,
120
143
  k,
121
- A
144
+ j,
145
+ N
122
146
  ]);
123
- let j = s(async (e, t) => {
124
- if (!D()) throw Error("Workspace context changed. Reopen the alert.");
125
- return O((await _.mutate({
147
+ let P = l(async (e, t) => {
148
+ if (!k()) throw Error("Workspace context changed. Reopen the alert.");
149
+ return A((await _.mutate({
126
150
  mutation: a,
127
151
  variables: {
128
- dataSinkId: h,
152
+ dataSinkId: o,
129
153
  alert: e,
130
154
  expectedVersion: t
131
155
  },
132
156
  errorPolicy: "none",
133
- context: E()
157
+ context: O()
134
158
  })).data?.upsertDataSinkAlert);
135
159
  }, [
136
160
  _,
137
- h,
138
- D,
139
- O,
140
- E
141
- ]), M = s(async (e, t) => {
142
- if (!D()) throw Error("Workspace context changed. Reopen the alert.");
143
- return O((await _.mutate({
161
+ o,
162
+ k,
163
+ A,
164
+ O
165
+ ]), F = l(async (e, t) => {
166
+ if (!k()) throw Error("Workspace context changed. Reopen the alert.");
167
+ return A((await _.mutate({
144
168
  mutation: r,
145
169
  variables: {
146
- dataSinkId: h,
170
+ dataSinkId: o,
147
171
  alertId: e,
148
172
  expectedVersion: t
149
173
  },
150
174
  errorPolicy: "none",
151
- context: E()
175
+ context: O()
152
176
  })).data?.deleteDataSinkAlert);
153
177
  }, [
154
178
  _,
155
- h,
156
- D,
157
- O,
158
- E
159
- ]), N = s(async (e, t) => {
160
- if (!D()) throw Error("Workspace context changed. Reopen the alert.");
179
+ o,
180
+ k,
181
+ A,
182
+ O
183
+ ]), I = l(async (e, t) => {
184
+ if (!k()) throw Error("Workspace context changed. Reopen the alert.");
161
185
  let n = await _.query({
162
186
  query: i,
163
187
  variables: {
164
- dataSinkId: h,
188
+ dataSinkId: o,
165
189
  condition: e,
166
190
  conditionType: t
167
191
  },
168
192
  fetchPolicy: "no-cache",
169
193
  errorPolicy: "none",
170
- context: E()
194
+ context: O()
171
195
  });
172
- if (!D()) return null;
196
+ if (!k()) return null;
173
197
  if (!n.data) throw Error("Condition preview returned no result.");
174
198
  return n.data.previewDataSinkAlert;
175
199
  }, [
176
200
  _,
177
- h,
178
- D,
179
- E
180
- ]), P = s(async (e, n) => {
181
- if (!D()) return null;
201
+ o,
202
+ k,
203
+ O
204
+ ]), L = l(async (e, n) => {
205
+ if (!k()) return null;
182
206
  let r = await _.query({
183
207
  query: t,
184
208
  variables: {
185
- dataSinkId: h,
209
+ dataSinkId: o,
186
210
  alertId: e,
187
211
  after: n,
188
212
  first: 21
189
213
  },
190
214
  fetchPolicy: "no-cache",
191
215
  errorPolicy: "none",
192
- context: E()
216
+ context: O()
193
217
  });
194
- if (!D()) return null;
218
+ if (!k()) return null;
195
219
  if (!r.data) throw Error("Execution history returned no result.");
196
- return r.data.dataSinkAlertExecutions.filter((e) => e.dataSinkId === h);
220
+ return r.data.dataSinkAlertExecutions.filter((e) => e.dataSinkId === o);
197
221
  }, [
198
222
  _,
199
- h,
200
- D,
201
- E
223
+ o,
224
+ k,
225
+ O
202
226
  ]);
203
227
  return {
204
- ...S.owner === b ? S : {
205
- ...p,
206
- loading: g
228
+ ...w.owner === S ? w : {
229
+ ...h,
230
+ loading: s
207
231
  },
208
- owner: b,
209
- refreshing: w,
210
- reload: k,
211
- reloadChannels: A,
212
- save: j,
213
- remove: M,
214
- preview: N,
215
- history: P
232
+ owner: S,
233
+ refreshing: E,
234
+ reload: j,
235
+ reloadChannels: M,
236
+ reloadSinkThenChannels: N,
237
+ save: P,
238
+ remove: F,
239
+ preview: I,
240
+ history: L
216
241
  };
217
242
  }
218
243
  //#endregion
219
- export { m as alertErrorMessage, h as useDataSinkAlerts };
244
+ export { g as alertErrorMessage, x as describeAlertLoadFailure, S as useDataSinkAlerts };
@@ -7,8 +7,8 @@ import "../context/index.js";
7
7
  import { appendPathSegment as a } from "../utils/safeUrl.js";
8
8
  import { PAGE_PARAM as o } from "./useActivePage.js";
9
9
  import { useCallback as s } from "react";
10
- import { useApolloClient as c } from "@apollo/client/react";
11
- import { useI18n as l } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
10
+ import { useI18n as c } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
+ import { useApolloClient as l } from "@apollo/client/react";
12
12
  import { toast as u } from "sonner";
13
13
  //#region src/bigconsole/hooks/useDrilldown.ts
14
14
  var d = "ctx_", f = "filter_", p = "drilldown_", m = "__targetPageId", h = [
@@ -91,7 +91,7 @@ function y(e) {
91
91
  }
92
92
  }
93
93
  function b(g = {}) {
94
- let { basePath: b = "/dashboards", onDrilldown: x, onModalOpen: S, onMaxDepthReached: C } = g, w = i(), T = r(), E = c(), { t: D } = l(), O = t((e) => e.openModal), k = t((e) => e.pushDrilldown), A = t((e) => e.isOpen), j = t((e) => e.dashboardId), M = s(() => {
94
+ let { basePath: b = "/dashboards", onDrilldown: x, onModalOpen: S, onMaxDepthReached: C } = g, w = i(), T = r(), E = l(), { t: D } = c(), O = t((e) => e.openModal), k = t((e) => e.pushDrilldown), A = t((e) => e.isOpen), j = t((e) => e.dashboardId), M = s(() => {
95
95
  let e = new URLSearchParams(window.location.search), t = e.get(`${p}depth`), n = e.get(`${p}parent`), r = e.get(`${p}path`);
96
96
  return {
97
97
  depth: t ? parseInt(t, 10) : 0,
@@ -1,7 +1,7 @@
1
1
  import { CreateGlobalFilterDocument as e, DeleteGlobalFilterDocument as t, GetDashboardDocument as n, ReorderGlobalFiltersDocument as r, UpdateGlobalFilterDocument as i } from "../../generated/wspace-operations.js";
2
2
  import { useCallback as a, useRef as o, useState as s } from "react";
3
- import { useApolloClient as c } from "@apollo/client/react";
4
- import { useLocalStorage as l } from "@burdenoff/fe-libs/shared/hooks";
3
+ import { useLocalStorage as c } from "@burdenoff/fe-libs/shared/hooks";
4
+ import { useApolloClient as l } from "@apollo/client/react";
5
5
  //#region src/bigconsole/hooks/useGlobalFilters.ts
6
6
  var u = "bigconsole_local_filters";
7
7
  function d(e) {
@@ -24,7 +24,7 @@ function d(e) {
24
24
  };
25
25
  }
26
26
  function f() {
27
- let [f, p] = s([]), [m, h] = s({}), [g, _] = s(!1), [v, y] = s(null), b = o(""), [x, S] = l(u, {}), C = c();
27
+ let [f, p] = s([]), [m, h] = s({}), [g, _] = s(!1), [v, y] = s(null), b = o(""), [x, S] = c(u, {}), C = l();
28
28
  a((e) => {
29
29
  let t = x[e];
30
30
  return t ? t.map((e) => d(e)) : [];
@@ -1,26 +1,27 @@
1
- import { GetWidgetTypesDocument as e } from "../../generated/wspace-operations.js";
1
+ import { loadNativeWidgetCatalog as e } from "../graphql/widgetCapabilities.js";
2
2
  import t, { WIDGET_CATEGORY_LABELS as n, getAllWidgetDefinitions as r, getWidgetDefinition as i } from "../components/widgets/WidgetRegistry.js";
3
3
  import { isFederationAccessible as a, mapFromFederationWidgetType as o } from "../utils/widgetTypeMapping.js";
4
- import { useEffect as s, useMemo as c } from "react";
5
- import { useQuery as l } from "@tanstack/react-query";
6
- import { print as u } from "graphql";
4
+ import { filterAdvancedWidgetDefinitions as s, nativeFederationTypes as c } from "../utils/advancedWidgetCapabilities.js";
5
+ import { useEffect as l, useLayoutEffect as u, useMemo as d, useRef as f } from "react";
6
+ import { useApolloClient as p } from "@apollo/client/react";
7
+ import { useQuery as m } from "@tanstack/react-query";
7
8
  //#region src/bigconsole/hooks/useWidgetCatalog.ts
8
- var d = new Set(Object.keys(n)), f = "Puzzle", p = "Installed";
9
- function m(e) {
9
+ var h = new Set(Object.keys(n)), g = "Puzzle", _ = "Installed";
10
+ function v(e) {
10
11
  let n = String(e).toLowerCase();
11
12
  return Object.prototype.hasOwnProperty.call(t, n) || a(e);
12
13
  }
13
- function h(e) {
14
+ function y(e) {
14
15
  let n = String(e).toLowerCase();
15
16
  return Object.prototype.hasOwnProperty.call(t, n) ? n : o(e);
16
17
  }
17
- function g(e) {
18
+ function b(e) {
18
19
  return {
19
20
  type: "custom",
20
21
  name: e.label,
21
22
  description: e.description,
22
- icon: e.icon || f,
23
- category: p,
23
+ icon: e.icon || g,
24
+ category: _,
24
25
  component: null,
25
26
  defaultConfig: {
26
27
  ...e.defaultConfig ?? {},
@@ -51,9 +52,9 @@ function g(e) {
51
52
  tags: ["store", "installed"]
52
53
  };
53
54
  }
54
- function _(e) {
55
- if (!m(e.type)) return g(e);
56
- let t = h(e.type), n = i(t), r = d.has(e.category) ? e.category : n.category;
55
+ function x(e) {
56
+ if (!v(e.type)) return b(e);
57
+ let t = y(e.type), n = i(t), r = h.has(e.category) ? e.category : n.category;
57
58
  return {
58
59
  type: t,
59
60
  name: e.label,
@@ -81,42 +82,46 @@ function _(e) {
81
82
  tags: n.tags
82
83
  };
83
84
  }
84
- function v(t = {}) {
85
- let { workspaceId: n, apiGatewayUrl: i, authToken: a, enabled: o = !0 } = t, { data: d, isLoading: f, error: p } = l({
86
- queryKey: ["widgetCatalog", n],
85
+ function S(t = {}) {
86
+ let { workspaceId: n, apiGatewayUrl: i, enabled: a = !0 } = t, o = p(), h = f(n);
87
+ u(() => (h.current = a ? n : void 0, () => {
88
+ h.current = void 0;
89
+ }), [n, a]);
90
+ let { data: g, isLoading: _, error: v } = m({
91
+ queryKey: [
92
+ "widgetCatalog",
93
+ n,
94
+ i
95
+ ],
87
96
  queryFn: async () => {
88
- let t = { "Content-Type": "application/json" };
89
- n && (t["x-workspace-id"] = n), a && (t.Authorization = `Bearer ${a}`);
90
- let r = i ? `${i}/workspaces/graphql` : "/workspaces/graphql", o = await fetch(r, {
91
- method: "POST",
92
- headers: t,
93
- body: JSON.stringify({ query: u(e) })
94
- });
95
- if (!o.ok) throw Error(`Failed to fetch widget catalog: ${o.status}`);
96
- let s = await o.json();
97
- if (s.errors?.length) throw Error(s.errors[0].message);
98
- return s.data?.getWidgetTypes ?? [];
97
+ if (!n || h.current !== n) throw Error("Widget catalog workspace changed.");
98
+ let t = await e(o, n);
99
+ if (h.current !== n) throw Error("Widget catalog workspace changed.");
100
+ return t;
99
101
  },
100
- enabled: o && !!n,
102
+ enabled: a && !!n,
101
103
  staleTime: 600 * 1e3
102
104
  });
103
- return s(() => {
104
- p && console.warn("Falling back to bundled widget registry:", p.message);
105
- }, [p]), c(() => d && d.length > 0 ? {
106
- definitions: d.map(_),
105
+ l(() => {
106
+ v && console.warn("Falling back to bundled widget registry:", v.message);
107
+ }, [v]);
108
+ let y = g?.getWidgetTypes, b = d(() => c(g?.getWidgetTypes ?? []), [g]);
109
+ return d(() => y && y.length > 0 ? {
110
+ definitions: s(y.map(x), b),
107
111
  source: "backend",
108
- loading: f,
109
- error: p ?? void 0
112
+ loading: _,
113
+ error: v ?? void 0
110
114
  } : {
111
- definitions: r(),
115
+ definitions: s(r(), b),
112
116
  source: "static",
113
- loading: f,
114
- error: p ?? void 0
117
+ loading: _,
118
+ error: v ?? void 0
115
119
  }, [
116
- d,
117
- f,
118
- p
120
+ y,
121
+ b,
122
+ _,
123
+ v
119
124
  ]);
120
125
  }
121
126
  //#endregion
122
- export { v as default };
127
+ export { S as default };