react-semaphor 0.1.376 → 0.1.377

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 (60) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +47 -43
  3. package/dist/brand-studio/index.cjs +4 -4
  4. package/dist/brand-studio/index.js +10 -8
  5. package/dist/chunks/braces-C2uBgj3t.js +6 -0
  6. package/dist/chunks/braces-CkXyWzRh.js +23 -0
  7. package/dist/chunks/{calendar-preferences-dialog-B6fsethx.js → calendar-preferences-dialog-C55VOTIy.js} +6 -5
  8. package/dist/chunks/calendar-preferences-dialog-DAukJOaP.js +1 -0
  9. package/dist/chunks/catalog-field-grounding-BGW0hnB9.js +1 -0
  10. package/dist/chunks/catalog-field-grounding-DHXEI7cW.js +199 -0
  11. package/dist/chunks/{chevrons-up-down-lahj6tQy.js → chevrons-up-down-BnzChFLU.js} +1 -1
  12. package/dist/chunks/{chevrons-up-down-D2fZD4N_.js → chevrons-up-down-W0nzHzx0.js} +1 -1
  13. package/dist/chunks/{dashboard-briefing-launcher-BKCRO7Qw.js → dashboard-briefing-launcher-CUyeiL_T.js} +3153 -2392
  14. package/dist/chunks/dashboard-briefing-launcher-DMKfG_z3.js +111 -0
  15. package/dist/chunks/dashboard-controls-B4hxFc3Q.js +2279 -0
  16. package/dist/chunks/dashboard-controls-D4vI0wvU.js +52 -0
  17. package/dist/chunks/dashboard-json-DQnm6daE.js +1 -0
  18. package/dist/chunks/{dashboard-json-QT0T2ad_.js → dashboard-json-pl1_mFqJ.js} +14 -13
  19. package/dist/chunks/{edit-dashboard-visual-kNoMQRmH.js → edit-dashboard-visual-CF4aSsav.js} +1489 -1488
  20. package/dist/chunks/{edit-dashboard-visual-DNzPgXMh.js → edit-dashboard-visual-CjTXY51a.js} +1 -1
  21. package/dist/chunks/{index-CPpqPJba.js → index-B2kPleRS.js} +4 -4
  22. package/dist/chunks/{index-DX_0OcRv.js → index-Bn866BBY.js} +67 -67
  23. package/dist/chunks/layout-grid-BFmJ7vmH.js +16 -0
  24. package/dist/chunks/layout-grid-CTOW9oTg.js +6 -0
  25. package/dist/chunks/{palette-BcHHAmOU.js → palette-DrhPeer-.js} +1 -1
  26. package/dist/chunks/{palette-2HWSR5wb.js → palette-OFaniMPn.js} +1 -1
  27. package/dist/chunks/{save-MoF1T13_.js → save-BxWBiQv1.js} +1 -1
  28. package/dist/chunks/{save-B-YfAPhu.js → save-Dh6gSC4x.js} +1 -1
  29. package/dist/chunks/{switch-DmE_MY3L.js → switch-C-fGjxjY.js} +1 -1
  30. package/dist/chunks/{switch-CmHP5dT7.js → switch-D5xopzFD.js} +1 -1
  31. package/dist/chunks/{use-create-flow-overlay-state-BLPQgGuz.js → use-create-flow-overlay-state-Dg2ffpCE.js} +2 -2
  32. package/dist/chunks/{use-create-flow-overlay-state-D_Ntx-_C.js → use-create-flow-overlay-state-DrKP0jWE.js} +113 -112
  33. package/dist/chunks/{validation-1V7bWmYw.js → validation-BHFaWDU-.js} +1 -1
  34. package/dist/chunks/{validation-DlrTIf1N.js → validation-bMedDBOo.js} +1 -1
  35. package/dist/dashboard/index.cjs +1 -1
  36. package/dist/dashboard/index.js +1 -1
  37. package/dist/dashboard-authoring/index.cjs +1 -1
  38. package/dist/dashboard-authoring/index.js +1 -1
  39. package/dist/data-app-builder/index.cjs +1 -1
  40. package/dist/data-app-builder/index.js +3 -3
  41. package/dist/data-app-sdk/index.cjs +1 -1
  42. package/dist/data-app-sdk/index.js +22 -21
  43. package/dist/data-app-sdk-validation/index.cjs +1 -1
  44. package/dist/data-app-sdk-validation/index.js +2 -2
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.js +127 -125
  47. package/dist/surfboard/index.cjs +1 -1
  48. package/dist/surfboard/index.js +2 -2
  49. package/dist/types/analytics-protocol.d.ts +84 -0
  50. package/dist/types/main.d.ts +7 -0
  51. package/package.json +1 -1
  52. package/dist/chunks/calendar-preferences-dialog-Dh1b0ytN.js +0 -1
  53. package/dist/chunks/catalog-field-grounding-DoEBOXQd.js +0 -100
  54. package/dist/chunks/catalog-field-grounding-Du6mKDcF.js +0 -1
  55. package/dist/chunks/dashboard-briefing-launcher-Gv1cwT0I.js +0 -111
  56. package/dist/chunks/dashboard-controls-BDJZarV7.js +0 -52
  57. package/dist/chunks/dashboard-controls-CchLBVDv.js +0 -3037
  58. package/dist/chunks/dashboard-json-ZhIEMXN0.js +0 -1
  59. package/dist/chunks/layout-grid-BOTLt36V.js +0 -36
  60. package/dist/chunks/layout-grid-CS6BSCJF.js +0 -11
package/dist/index.js CHANGED
@@ -1,20 +1,21 @@
1
- import { E as T, F as N, S, p as P, U as _, q as w, r as F, s as x, t as R, v as I, C as M, h as L, I as k, w as U, i as O, j as V, k as z, l as q } from "./chunks/index-DX_0OcRv.js";
2
- import { W as ca, D as fa, T as ma, Q as pa, N as ha, a9 as ga, M as Ca, z as Da, G as Ea, G as xa, H as Ta, V as ba, a as ya, a8 as va, a4 as Aa, P as Ba, O as Na, ac as Sa, a7 as Pa, a6 as _a, a5 as wa, ab as Fa, aa as Ra, a1 as Ia, _ as Ma, L as La, Y as ka, K as Ua, y as Oa, X as Va, Z as za, A as qa, a3 as Ha, a0 as Wa, $ as ja, a2 as Ga, x as Qa, J as Ka, B as Xa } from "./chunks/index-DX_0OcRv.js";
3
- import { a as $a, C as Ja, D as Za, E as ae, P as ee, g as se, d as re, h as oe, b as te, c as ne, i as ie } from "./chunks/common-types-4bjoIgvm.js";
4
- import { C as de } from "./chunks/calendar-preferences-dialog-B6fsethx.js";
1
+ import { E as T, F as N, S, p as P, U as _, q as w, r as F, s as x, t as R, v as I, C as M, h as L, I as k, w as U, i as O, j as V, k as z, l as q } from "./chunks/index-Bn866BBY.js";
2
+ import { W as fa, D as ma, T as pa, Q as ha, N as ga, a9 as Ca, M as Da, z as Ea, G as xa, G as Ta, H as ba, V as ya, a as va, a8 as Aa, a4 as Ba, P as Na, O as Sa, ac as Pa, a7 as _a, a6 as wa, a5 as Fa, ab as Ra, aa as Ia, a1 as Ma, _ as La, L as ka, Y as Ua, K as Oa, y as Va, X as za, Z as qa, A as Ha, a3 as Wa, a0 as ja, $ as Ga, a2 as Qa, x as Ka, J as Xa, B as Ya } from "./chunks/index-Bn866BBY.js";
3
+ import { a as Ja, C as Za, D as ae, E as ee, P as se, g as re, d as oe, h as te, b as ie, c as ne, i as le } from "./chunks/common-types-4bjoIgvm.js";
4
+ import { C as ue } from "./chunks/calendar-preferences-dialog-C55VOTIy.js";
5
5
  import { jsx as a, jsxs as d } from "react/jsx-runtime";
6
- import { u as H, P as W, b as j, B as G, a as C, g as Q, d as K, e as X } from "./chunks/switch-DmE_MY3L.js";
7
- import { F as ce, q as fe, h as me, i as pe, k as he, s as ge, r as Ce, w as De, x as Ee, p as xe, j as Te, o as be, t as ye, n as ve, m as Ae, l as Be, y as Ne, v as Se, z as Pe, D as _e, A as we, E as Fe, H as Re, G as Ie } from "./chunks/switch-DmE_MY3L.js";
6
+ import { u as H, P as W, b as j, B as G, a as C, g as Q, d as K, e as X } from "./chunks/switch-C-fGjxjY.js";
7
+ import { F as fe, q as me, h as pe, i as he, k as ge, s as Ce, r as De, w as Ee, x as xe, p as Te, j as be, o as ye, t as ve, n as Ae, m as Be, l as Ne, y as Se, v as Pe, z as _e, D as we, A as Fe, E as Re, H as Ie, G as Me } from "./chunks/switch-C-fGjxjY.js";
8
8
  import * as m from "react";
9
9
  import { useMemo as Y, useEffect as b } from "react";
10
- import { DEFAULT_CALENDAR_CONTEXT as Le, DEFAULT_SEMANTIC_DOMAIN_ACCESS as ke } from "./types/index.js";
11
- import { u as Oe } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
10
+ import { DEFAULT_CALENDAR_CONTEXT as ke, DEFAULT_SEMANTIC_DOMAIN_ACCESS as Ue } from "./types/index.js";
11
+ import { A as Ve, K as ze, B as qe, L as He, D as We, e as je, f as Ge, d as Qe, b as Ke, E as Xe, N as Ye, U as $e, a as Je, V as Ze, W as as, F as es, H as ss, I as rs, G as os, v as ts, i as is, C as ns, k as ls, w as ds, h as us, x as cs, y as fs, q as ms, t as ps, s as hs, g as gs, l as Cs, p as Ds, z as Es, n as xs, r as Ts, m as bs, o as ys, j as vs, u as As, c as Bs, J as Ns } from "./chunks/dashboard-briefing-launcher-CUyeiL_T.js";
12
+ import { u as Ps } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
13
+ import "./chunks/catalog-field-grounding-DHXEI7cW.js";
12
14
  import "react-dom";
13
15
  import "./chunks/index-CJdxSyQq.js";
14
- import { A as ze, J as qe, B as He, K as We, D as je, d as Ge, e as Qe, c as Ke, a as Xe, E as Ye, N as $e, U as Je, V as Ze, W as as, C as es, G as ss, H as rs, F as os, t as ts, h as ns, z as is, j as ls, v as ds, g as us, w as cs, x as fs, o as ms, s as ps, q as hs, f as gs, l as Cs, p as Ds, y as Es, m as xs, r as Ts, k as bs, n as ys, i as vs, u as As, b as Bs, I as Ns } from "./chunks/dashboard-briefing-launcher-BKCRO7Qw.js";
15
- import { n as Ps, s as _s } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
16
+ import { n as ws, s as Fs } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
16
17
  import "./chunks/index-CuHybtft.js";
17
- function ta(e) {
18
+ function ia(e) {
18
19
  const { displayPreferences: s, cardId: t, ...l } = e, r = {
19
20
  ...l,
20
21
  id: e.dashboardId
@@ -27,10 +28,10 @@ function ta(e) {
27
28
  }
28
29
  function $({ cardId: e }) {
29
30
  const s = H((r) => {
30
- var n;
31
- return (n = r.dashboard) == null ? void 0 : n.sheets;
31
+ var i;
32
+ return (i = r.dashboard) == null ? void 0 : i.sheets;
32
33
  }), { card: t, frame: l } = Y(() => {
33
- const r = s == null ? void 0 : s.flatMap((o) => o.frames), n = r == null ? void 0 : r.flatMap((o) => o == null ? void 0 : o.cards), p = n == null ? void 0 : n.find((o) => (o == null ? void 0 : o.id) === e), h = r == null ? void 0 : r.find(
34
+ const r = s == null ? void 0 : s.flatMap((o) => o.frames), i = r == null ? void 0 : r.flatMap((o) => o == null ? void 0 : o.cards), p = i == null ? void 0 : i.find((o) => (o == null ? void 0 : o.id) === e), h = r == null ? void 0 : r.find(
34
35
  (o) => {
35
36
  var f;
36
37
  return (f = o == null ? void 0 : o.cards) == null ? void 0 : f.find((u) => (u == null ? void 0 : u.id) === e);
@@ -51,12 +52,12 @@ function $({ cardId: e }) {
51
52
  {
52
53
  FallbackComponent: ({
53
54
  error: r,
54
- resetErrorBoundary: n
55
+ resetErrorBoundary: i
55
56
  }) => /* @__PURE__ */ a(
56
57
  x,
57
58
  {
58
59
  error: r,
59
- resetErrorBoundary: n,
60
+ resetErrorBoundary: i,
60
61
  customerFacingMessage: "Error creating visual. Please try again."
61
62
  }
62
63
  ),
@@ -69,13 +70,13 @@ function na(e, s, t, l) {
69
70
  e && !t && s && l(I(s));
70
71
  }, [e, t, s, l]);
71
72
  }
72
- function ia({
73
+ function la({
73
74
  name: e,
74
75
  items: s,
75
76
  value: t,
76
77
  onChange: l,
77
78
  isLoading: r,
78
- isError: n,
79
+ isError: i,
79
80
  refetch: p,
80
81
  className: h,
81
82
  icon: o,
@@ -86,10 +87,10 @@ function ia({
86
87
  u.current && v(u.current.offsetWidth);
87
88
  }, []);
88
89
  function A() {
89
- var i;
90
- return r ? "Loading..." : n ? "Error" : t ? (i = s == null ? void 0 : s.find((c) => c.id === t)) == null ? void 0 : i.name : `Select ${e}`;
90
+ var n;
91
+ return r ? "Loading..." : i ? "Error" : t ? (n = s == null ? void 0 : s.find((c) => c.id === t)) == null ? void 0 : n.name : `Select ${e}`;
91
92
  }
92
- function B(i, c) {
93
+ function B(n, c) {
93
94
  l(c), E(!1);
94
95
  }
95
96
  return /* @__PURE__ */ d(W, { open: D, onOpenChange: E, children: [
@@ -134,26 +135,26 @@ function ia({
134
135
  e == null ? void 0 : e.toLowerCase(),
135
136
  " found."
136
137
  ] }),
137
- /* @__PURE__ */ a(z, { children: g == null ? void 0 : g.map((i) => /* @__PURE__ */ a(
138
+ /* @__PURE__ */ a(z, { children: g == null ? void 0 : g.map((n) => /* @__PURE__ */ a(
138
139
  q,
139
140
  {
140
141
  className: "overflow-x-auto",
141
- value: i.name,
142
- onSelect: (c) => B(c, i.id),
142
+ value: n.name,
143
+ onSelect: (c) => B(c, n.id),
143
144
  children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
144
145
  /* @__PURE__ */ a(
145
146
  X,
146
147
  {
147
148
  className: C(
148
149
  "size-4",
149
- t === i.id ? "opacity-100" : "opacity-0"
150
+ t === n.id ? "opacity-100" : "opacity-0"
150
151
  )
151
152
  }
152
153
  ),
153
- /* @__PURE__ */ a("div", { title: i.name, children: i.name })
154
+ /* @__PURE__ */ a("div", { title: n.name, children: n.name })
154
155
  ] })
155
156
  },
156
- i.id
157
+ n.id
157
158
  )) })
158
159
  ] })
159
160
  ] })
@@ -161,7 +162,7 @@ function ia({
161
162
  )
162
163
  ] });
163
164
  }
164
- function la(e, s) {
165
+ function da(e, s) {
165
166
  b(() => (e && s && (window.__SEMAPHOR_PRINT_STATE__ = {
166
167
  ...s
167
168
  }), () => {
@@ -169,132 +170,133 @@ function la(e, s) {
169
170
  }), [e, s]);
170
171
  }
171
172
  export {
172
- ze as AdvancedModeToggle,
173
- qe as BriefingAuthor,
174
- He as BriefingsApiError,
175
- $a as CALCULATED_FIELD_ENTITY_MARKER,
176
- Ja as CONTROL_CARD_DEFAULT_VALUE,
177
- de as CalendarPreferencesDialog,
178
- ca as CardSummary,
179
- ia as Combobox,
180
- Za as DATE_FORMAT_VALUES,
181
- Le as DEFAULT_CALENDAR_CONTEXT,
182
- ke as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
183
- fa as Dashboard,
184
- We as DashboardBriefingLauncher,
185
- je as DashboardControlsSettings,
186
- ma as DashboardCreateDialogBase,
187
- pa as DashboardExportDialog,
188
- Ge as DashboardFilterControlsButton,
189
- Qe as DashboardFilterControlsLauncher,
190
- ha as DashboardWC,
191
- Ke as DocumentControlsSettings,
192
- ae as EMPTY_SELECTION,
193
- ga as ExportError,
194
- Xe as ExportNotificationItem,
195
- Ye as ExportNotificationList,
196
- Ca as MatrixTableVisual,
197
- $e as NotificationBell,
198
- ee as PivotMarkerEnum,
199
- Da as ResourceType,
173
+ Ve as AdvancedModeToggle,
174
+ ze as BriefingAuthor,
175
+ qe as BriefingsApiError,
176
+ Ja as CALCULATED_FIELD_ENTITY_MARKER,
177
+ Za as CONTROL_CARD_DEFAULT_VALUE,
178
+ ue as CalendarPreferencesDialog,
179
+ fa as CardSummary,
180
+ la as Combobox,
181
+ ae as DATE_FORMAT_VALUES,
182
+ ke as DEFAULT_CALENDAR_CONTEXT,
183
+ Ue as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
184
+ ma as Dashboard,
185
+ He as DashboardBriefingLauncher,
186
+ We as DashboardControlsSettings,
187
+ pa as DashboardCreateDialogBase,
188
+ ha as DashboardExportDialog,
189
+ je as DashboardFilterControlsButton,
190
+ Ge as DashboardFilterControlsLauncher,
191
+ ga as DashboardWC,
192
+ Qe as DocumentControlsSettings,
193
+ ee as EMPTY_SELECTION,
194
+ Ca as ExportError,
195
+ Ke as ExportNotificationItem,
196
+ Xe as ExportNotificationList,
197
+ Da as MatrixTableVisual,
198
+ Ye as NotificationBell,
199
+ se as PivotMarkerEnum,
200
+ Ea as ResourceType,
200
201
  S as SemaphorContextProvider,
201
- Ea as SemaphorDataProvider,
202
- xa as SemaphorQueryClient,
203
- Ta as ShareDialog,
204
- ba as SummaryCard,
205
- ya as Surfboard,
206
- Je as UnsavedChangesAlert,
207
- ta as Visual,
208
- Ze as VisualEditingControls,
202
+ xa as SemaphorDataProvider,
203
+ Ta as SemaphorQueryClient,
204
+ ba as ShareDialog,
205
+ ya as SummaryCard,
206
+ va as Surfboard,
207
+ $e as UnsavedChangesAlert,
208
+ ia as Visual,
209
+ Je as VisualEditingControls,
210
+ Ze as VisualsLibraryDialog,
209
211
  as as WatchDashboardButton,
210
212
  es as applyBriefingFormPatch,
211
213
  ss as briefingFormDraftToCreateRequest,
212
214
  rs as briefingFormDraftToUpdateRequest,
213
215
  os as briefingToFormDraft,
214
216
  ts as cancelBriefingRun,
215
- va as cancelExport,
217
+ Aa as cancelExport,
216
218
  I as cloneDeep,
217
- ns as createBriefing,
218
- is as createBriefingFormDraft,
219
- ce as createEmptyKpiConfig,
220
- Aa as createExport,
221
- fe as createSqlGenConfig,
219
+ is as createBriefing,
220
+ ns as createBriefingFormDraft,
221
+ fe as createEmptyKpiConfig,
222
+ Ba as createExport,
223
+ me as createSqlGenConfig,
222
224
  ls as deleteBriefing,
223
225
  ds as deleteBriefingRun,
224
- Ba as downloadDocumentPdf,
225
- Na as downloadPdf,
226
- me as emitDashboardLoad,
227
- pe as emitDashboardUnload,
228
- he as fmt,
229
- Sa as formatFileSize,
226
+ Na as downloadDocumentPdf,
227
+ Sa as downloadPdf,
228
+ pe as emitDashboardLoad,
229
+ he as emitDashboardUnload,
230
+ ge as fmt,
231
+ Pa as formatFileSize,
230
232
  us as getBriefing,
231
233
  cs as getBriefingArtifact,
232
234
  fs as getBriefingEvidence,
233
235
  ms as getBriefingPreviewRun,
234
236
  ps as getBriefingRun,
235
- ge as getColumnDataType,
236
- Pa as getDownloadUrl,
237
- _a as getExportStatus,
238
- wa as getExports,
239
- se as getFieldRuntimeColumnName,
240
- Ce as getFilterValueType,
241
- De as getFormattedTableNameForQuery,
242
- Ee as getQualifiedTableName,
243
- xe as getSql,
244
- re as hasCalculatedFieldMarker,
245
- oe as hasCalculatedFormulaInputs,
246
- Te as invalidateToken,
247
- be as isBooleanDataType,
248
- te as isCalculatedDimension,
237
+ Ce as getColumnDataType,
238
+ _a as getDownloadUrl,
239
+ wa as getExportStatus,
240
+ Fa as getExports,
241
+ re as getFieldRuntimeColumnName,
242
+ De as getFilterValueType,
243
+ Ee as getFormattedTableNameForQuery,
244
+ xe as getQualifiedTableName,
245
+ Te as getSql,
246
+ oe as hasCalculatedFieldMarker,
247
+ te as hasCalculatedFormulaInputs,
248
+ be as invalidateToken,
249
+ ye as isBooleanDataType,
250
+ ie as isCalculatedDimension,
249
251
  ne as isCalculatedField,
250
- ie as isCalculatedMetric,
251
- ye as isColumnInSqlGen,
252
- ve as isDateDataType,
253
- Fa as isExportComplete,
254
- Ra as isExportInProgress,
255
- Ae as isNumberDataType,
256
- Be as isTextDataType,
252
+ le as isCalculatedMetric,
253
+ ve as isColumnInSqlGen,
254
+ Ae as isDateDataType,
255
+ Ra as isExportComplete,
256
+ Ia as isExportInProgress,
257
+ Be as isNumberDataType,
258
+ Ne as isTextDataType,
257
259
  hs as listBriefingRuns,
258
260
  gs as listBriefingTenantSummaries,
259
261
  Cs as listBriefings,
260
- Ps as normalizeDashboardForDirtyCheck,
262
+ ws as normalizeDashboardForDirtyCheck,
261
263
  Ds as pauseBriefing,
262
264
  Es as polishBriefingText,
263
265
  xs as previewBriefingPlan,
264
- Ne as resolveDataType,
265
- Se as resolveDatamodelName,
266
+ Se as resolveDataType,
267
+ Pe as resolveDatamodelName,
266
268
  Ts as resumeBriefing,
267
269
  bs as runBriefingNow,
268
270
  ys as runBriefingPreview,
269
- _s as serializeDashboardForDirtyCheck,
271
+ Fs as serializeDashboardForDirtyCheck,
270
272
  vs as updateBriefing,
271
- Ia as useActiveExports,
272
- Ma as useAddNewFrame,
273
- La as useCard,
274
- ka as useCardSummary,
275
- Pe as useCurrentActiveCard,
276
- _e as useCurrentCardConfig,
277
- we as useCurrentSheetActiveCards,
278
- Fe as useDashboardActions,
279
- Ua as useDashboardById,
280
- Oa as useDashboardQuery,
273
+ Ma as useActiveExports,
274
+ La as useAddNewFrame,
275
+ ka as useCard,
276
+ Ua as useCardSummary,
277
+ _e as useCurrentActiveCard,
278
+ we as useCurrentCardConfig,
279
+ Fe as useCurrentSheetActiveCards,
280
+ Re as useDashboardActions,
281
+ Oa as useDashboardById,
282
+ Va as useDashboardQuery,
281
283
  H as useDashboardStore,
282
- Va as useDashboardSummary,
283
- za as useDataColumns,
284
- qa as useDateFilterHook,
285
- Oe as useDebouncedDirtyCheck,
286
- Re as useEditorActions,
287
- Ha as useEditorAside,
288
- Ie as useEditorStore,
289
- Wa as useExportActions,
284
+ za as useDashboardSummary,
285
+ qa as useDataColumns,
286
+ Ha as useDateFilterHook,
287
+ Ps as useDebouncedDirtyCheck,
288
+ Ie as useEditorActions,
289
+ Wa as useEditorAside,
290
+ Me as useEditorStore,
291
+ ja as useExportActions,
290
292
  As as useExportPolling,
291
293
  Bs as useExportRecovery,
292
- ja as useExportStore,
293
- la as useExposePrintState,
294
- Ga as useInProgressExportsCount,
295
- Qa as useManagementStore,
294
+ Ga as useExportStore,
295
+ da as useExposePrintState,
296
+ Qa as useInProgressExportsCount,
297
+ Ka as useManagementStore,
296
298
  na as usePristineSnapshotInitializer,
297
- Ka as useResourceManagement,
298
- Xa as useTextFilterHook,
299
+ Xa as useResourceManagement,
300
+ Ya as useTextFilterHook,
299
301
  Ns as validateBriefingFormDraft
300
302
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-CPpqPJba.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-Dh1b0ytN.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-B2kPleRS.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-DAukJOaP.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
@@ -1,6 +1,6 @@
1
- import { a as e } from "../chunks/index-DX_0OcRv.js";
1
+ import { a as e } from "../chunks/index-Bn866BBY.js";
2
2
  import { C, E } from "../chunks/common-types-4bjoIgvm.js";
3
- import { C as s } from "../chunks/calendar-preferences-dialog-B6fsethx.js";
3
+ import { C as s } from "../chunks/calendar-preferences-dialog-C55VOTIy.js";
4
4
  export {
5
5
  C as CONTROL_CARD_DEFAULT_VALUE,
6
6
  s as CalendarPreferencesDialog,
@@ -58,6 +58,8 @@ export declare function getAnalyticsCatalogFieldCandidates(field: AnalyticsCatal
58
58
 
59
59
  export declare function getAnalyticsCatalogFieldName(field: AnalyticsCatalogField): string;
60
60
 
61
+ export declare function getSemaphorAnalyzeResultFieldNames(): SemaphorAnalyzeResultFieldName[];
62
+
61
63
  export declare function getSemaphorConnectionCapabilities(connectionType: string | undefined, options?: {
62
64
  connectionId?: string;
63
65
  }): SemaphorConnectionCapabilities;
@@ -76,6 +78,8 @@ export declare function isAnalyticsMetricIdentifierField(field: AnalyticsCatalog
76
78
 
77
79
  export declare function isAnalyticsTechnicalIdentifierField(field: AnalyticsCatalogField): boolean;
78
80
 
81
+ export declare function isSemaphorAnalyzeResultFieldName(value: string): value is SemaphorAnalyzeResultFieldName;
82
+
79
83
  export declare type MatrixAxisLevelDescriptor = {
80
84
  instanceId: string;
81
85
  fieldKey: string;
@@ -405,6 +409,8 @@ export declare function normalizeSemaphorDialect(input: string | undefined): Sem
405
409
 
406
410
  export declare function normalizeSemaphorInputOperator(value: SemaphorInputOperatorInput | string | null | undefined): SemaphorInputOperator | undefined;
407
411
 
412
+ export declare function parseSemaphorAnalyzeResult(value: unknown): SemaphorAnalyzeResult;
413
+
408
414
  export declare function parseSemaphorIsoTimeWindowBoundary(value: unknown): Date | null;
409
415
 
410
416
  export declare function preferSemaphorFieldRefMetadata(current: SemaphorFieldRef, next: SemaphorFieldRef): SemaphorFieldRef;
@@ -619,6 +625,42 @@ export declare const SEMAPHOR_ANALYTICS_INTENT_FIXTURES: {
619
625
  };
620
626
  };
621
627
 
628
+ export declare const SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT: {
629
+ readonly answerSummary: "string";
630
+ readonly responseDetail: "responseDetail";
631
+ readonly mode: "string";
632
+ readonly comparisonType: "string";
633
+ readonly executionResult: "unknown";
634
+ readonly compiledQuery: "unknown";
635
+ readonly data: "unknown";
636
+ readonly resultSets: "record";
637
+ readonly columns: "unknownArray";
638
+ readonly records: "recordArray";
639
+ readonly rowCount: "number";
640
+ readonly rowLimitExceeded: "boolean";
641
+ readonly output: "string";
642
+ readonly querySpec: "unknown";
643
+ readonly metadata: "record";
644
+ readonly validation: "unknown";
645
+ readonly coverage: "unknown";
646
+ readonly missingFields: "stringArray";
647
+ readonly warnings: "unknownArray";
648
+ readonly comparison: "unknown";
649
+ readonly population: "unknown";
650
+ readonly comparisons: "recordArray";
651
+ readonly fieldsUsed: "unknown";
652
+ readonly changes: "recordArray";
653
+ readonly largestNegativeChanges: "recordArray";
654
+ readonly largestPositiveChanges: "recordArray";
655
+ readonly drivers: "recordArray";
656
+ readonly absoluteDeltaDrivers: "recordArray";
657
+ readonly largestNegativeDrivers: "recordArray";
658
+ readonly largestPositiveDrivers: "recordArray";
659
+ readonly periodRows: "recordArray";
660
+ readonly sql: "unknown";
661
+ readonly omitted: "stringArray";
662
+ };
663
+
622
664
  export declare type SemaphorAbsoluteTimeWindow = {
623
665
  kind: 'absolute';
624
666
  start: string;
@@ -763,6 +805,48 @@ export declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase &
763
805
 
764
806
  export declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
765
807
 
808
+ export declare type SemaphorAnalyzeResponseDetail = 'compact' | 'standard' | 'debug';
809
+
810
+ export declare type SemaphorAnalyzeResult = Partial<Record<SemaphorAnalyzeResultFieldName, unknown>> & {
811
+ answerSummary?: string;
812
+ responseDetail?: SemaphorAnalyzeResponseDetail;
813
+ mode?: string;
814
+ comparisonType?: string;
815
+ executionResult?: SemaphorAnalyticsExecutionResult;
816
+ compiledQuery?: SemaphorCompiledQuery;
817
+ data?: unknown;
818
+ resultSets?: Record<string, unknown>;
819
+ columns?: unknown[];
820
+ records?: Record<string, unknown>[];
821
+ rowCount?: number;
822
+ rowLimitExceeded?: boolean;
823
+ output?: string;
824
+ querySpec?: unknown;
825
+ metadata?: Record<string, unknown>;
826
+ validation?: unknown;
827
+ coverage?: unknown;
828
+ missingFields?: string[];
829
+ warnings?: unknown[];
830
+ comparison?: unknown;
831
+ population?: unknown;
832
+ comparisons?: Record<string, unknown>[];
833
+ fieldsUsed?: unknown;
834
+ changes?: Record<string, unknown>[];
835
+ largestNegativeChanges?: Record<string, unknown>[];
836
+ largestPositiveChanges?: Record<string, unknown>[];
837
+ drivers?: Record<string, unknown>[];
838
+ absoluteDeltaDrivers?: Record<string, unknown>[];
839
+ largestNegativeDrivers?: Record<string, unknown>[];
840
+ largestPositiveDrivers?: Record<string, unknown>[];
841
+ periodRows?: Record<string, unknown>[];
842
+ sql?: unknown;
843
+ omitted?: string[];
844
+ };
845
+
846
+ export declare type SemaphorAnalyzeResultFieldKind = 'boolean' | 'number' | 'record' | 'recordArray' | 'responseDetail' | 'string' | 'stringArray' | 'unknown' | 'unknownArray';
847
+
848
+ export declare type SemaphorAnalyzeResultFieldName = keyof typeof SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT;
849
+
766
850
  export declare type SemaphorCompiledQuery = {
767
851
  kind: 'config';
768
852
  queryId: string;
@@ -7186,6 +7186,13 @@ declare type VisualProps = DashboardProps & {
7186
7186
  displayPreferences?: VisualDisplayPreferences;
7187
7187
  };
7188
7188
 
7189
+ export declare function VisualsLibraryDialog({ open, onOpenChange, }: VisualsLibraryDialogProps): JSX.Element;
7190
+
7191
+ declare interface VisualsLibraryDialogProps {
7192
+ open: boolean;
7193
+ onOpenChange: (open: boolean) => void;
7194
+ }
7195
+
7189
7196
  export declare function WatchDashboardButton({ disabled, briefingCount, className, onClick, }: WatchDashboardButtonProps): JSX.Element;
7190
7197
 
7191
7198
  export declare type WatchDashboardButtonProps = {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.376",
8
+ "version": "0.1.377",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -1 +0,0 @@
1
- "use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./index-CPpqPJba.js"),i=require("./switch-CmHP5dT7.js");require("./index-BxM99sFL.js");const G=require("./chevrons-up-down-D2fZD4N_.js");function W(n={}){var y,P,z,A;const{authToken:d,tokenProps:a}=t.useSemaphorContext(),x=n.enabled??!0,m=(d==null?void 0:d.accessToken)??null,f=(a==null?void 0:a.apiServiceUrl)??null,[L,C]=l.useState(!1),[j,b]=l.useState(!1),[h,g]=l.useState(!1),[N,c]=l.useState(null),[v,S]=l.useState(null),k=v||{tz:((P=(y=a==null?void 0:a.params)==null?void 0:y.calendarContext)==null?void 0:P.tz)||null,weekStart:((A=(z=a==null?void 0:a.params)==null?void 0:z.calendarContext)==null?void 0:A.weekStart)??null},p=l.useCallback(async()=>{if(!(!x||!m||!f)){C(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to fetch preferences")}const r=await o.json();S({tz:r.tz,weekStart:r.weekStart,source:r.source,isInherited:r.isInherited,userHasPrefs:r.userHasPrefs,inherited:r.inherited})}catch(o){const r=o instanceof Error?o.message:"Unknown error";c(r)}finally{C(!1)}}},[m,f,x]);l.useEffect(()=>{x&&p()},[x,p]);const T=l.useCallback(async o=>{if(!m||!f)return c("Not authenticated"),!1;b(!0),c(null);try{const r=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`},body:JSON.stringify(o)});if(!r.ok){const u=await r.json().catch(()=>({}));throw new Error(u.error||"Failed to update preferences")}return await p(),!0}catch(r){const u=r instanceof Error?r.message:"Unknown error";return c(u),!1}finally{b(!1)}},[m,f,p]),w=l.useCallback(async()=>{if(!m||!f)return c("Not authenticated"),!1;g(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to clear preferences")}const r=await o.text();if(r)try{const u=JSON.parse(r);return S({tz:u.tz,weekStart:u.weekStart,source:u.source,isInherited:u.isInherited??!0,userHasPrefs:!1,inherited:u.inherited}),!0}catch{}return await p(),!0}catch(o){const r=o instanceof Error?o.message:"Unknown error";return c(r),!1}finally{g(!1)}},[m,f,p]);return{preferences:k,isLoading:L,isSaving:j,isClearing:h,error:N,updatePreferences:T,clearPreferences:w,refetch:p}}const E=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],H="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function _(){try{const n=Intl;if(n.supportedValuesOf)return n.supportedValuesOf("timeZone")}catch{}return E.map(n=>n.value)}function q(n){switch(n){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function O(n){const d=E.find(a=>a.value===n);return d?d.label:n}function V(n){const d=M.find(a=>a.value===n);return d?d.label:String(n)}function Z({open:n,onOpenChange:d}){var D,U,F;const{preferences:a,isLoading:x,isSaving:m,isClearing:f,updatePreferences:L,clearPreferences:C}=W({enabled:n}),j=a.tz||((D=a.inherited)==null?void 0:D.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,b=a.weekStart??((U=a.inherited)==null?void 0:U.weekStart)??1,[h,g]=l.useState(!a.userHasPrefs),[N,c]=l.useState(!1),[v,S]=l.useState(j),[k,p]=l.useState(b),[T,w]=l.useState(!1),y=l.useMemo(()=>_(),[]),P=l.useMemo(()=>y.filter(s=>!E.some(R=>R.value===s)),[y]),z=l.useMemo(()=>O(v),[v]),A=a.inherited?O(a.inherited.tz):"UTC",o=a.inherited?V(a.inherited.weekStart):"Monday",r=q((F=a.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!n){c(!1);return}N||(a.userHasPrefs!==void 0&&g(!a.userHasPrefs),S(j),p(b))},[n,N,a.userHasPrefs,j,b]);const u=async()=>{if(x){t.ue.error("Preferences are still loading. Please try again.");return}h?await C()?(t.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again."):await L({tz:v,weekStart:k})?(t.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again.")},$=()=>{d(!1)},I=m||f,B=I||x;return e.jsx(t.Dialog,{open:n,onOpenChange:d,children:e.jsxs(t.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{className:"text-[15px]",children:"Calendar preferences"}),e.jsx(t.DialogDescription,{className:"text-[13px] leading-5",children:"Set your timezone and week-start for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(t.RadioGroup,{value:h?"defaults":"custom",onValueChange:s=>{c(!0),g(s==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",h&&"bg-muted/50"),onClick:()=>{c(!0),g(!0)},children:[e.jsx(t.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",r," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[A,", week starts ",o]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!h&&"bg-muted/50"),onClick:()=>{c(!0),g(!1)},children:[e.jsx(t.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:i.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",h&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Timezone"}),e.jsxs(i.Popover,{open:T,onOpenChange:w,modal:!0,children:[e.jsx(i.PopoverTrigger,{asChild:!0,children:e.jsxs(i.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":T,className:"w-full justify-between text-[12px] font-normal",disabled:h,children:[e.jsx("span",{className:"truncate",children:z}),e.jsx(G.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(i.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(t.Command,{className:"overflow-visible",children:[e.jsx(t.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(t.CommandList,{children:[e.jsx(t.CommandEmpty,{children:"No timezone found."}),e.jsx(t.CommandGroup,{heading:"Common",children:E.map(s=>e.jsxs(t.CommandItem,{value:`${s.value} ${s.label}`,onSelect:()=>{c(!0),S(s.value),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:s.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:s.value})]},s.value))}),e.jsx(t.CommandSeparator,{}),e.jsx(t.CommandGroup,{heading:"All timezones",children:P.map(s=>e.jsxs(t.CommandItem,{value:s,onSelect:()=>{c(!0),S(s),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s?"opacity-100":"opacity-0")}),s]},s))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Week starts on"}),e.jsx(t.RadioGroup,{value:String(k),onValueChange:s=>{c(!0),p(Number(s))},className:"flex gap-4",disabled:h,children:M.map(s=>e.jsxs("label",{htmlFor:`week-start-${s.value}`,className:i.cn("flex cursor-pointer items-center gap-2 text-[13px]",h&&"cursor-not-allowed"),children:[e.jsx(t.RadioGroupItem,{value:String(s.value),id:`week-start-${s.value}`,disabled:h}),s.label]},s.value))})]})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(i.Button,{variant:"outline",size:"xs",onClick:$,disabled:I,children:"Cancel"}),e.jsx(i.Button,{size:"xs",onClick:u,disabled:B,children:I?e.jsxs(e.Fragment,{children:[e.jsx(i.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})})}exports.CalendarPreferencesDialog=Z;
@@ -1,100 +0,0 @@
1
- function c(n) {
2
- return typeof n == "string" ? n.trim().toLowerCase() : "";
3
- }
4
- function g(n) {
5
- return String(n.column_name || n.name || n.qualifiedFieldName || "");
6
- }
7
- function p(n) {
8
- return Array.from(
9
- new Set(
10
- [
11
- n.column_name,
12
- n.name,
13
- n.qualifiedFieldName,
14
- n.alias
15
- ].filter(
16
- (e) => typeof e == "string" && e.trim().length > 0
17
- ).map((e) => e.trim())
18
- )
19
- );
20
- }
21
- function o(n) {
22
- const e = C(n);
23
- return e ? e.includes("int") || e.includes("uint") || e.includes("bigint") || e.includes("smallint") || e.includes("tinyint") || e.includes("numeric") || e.includes("decimal") || e.includes("double") || e.includes("float") || e.includes("number") || e.includes("real") || e.includes("money") || e.includes("currency") || e.includes("percent") ? "number" : e.includes("timestamp") || e.includes("datetime") || e.startsWith("time") ? "datetime" : e.includes("date") ? "date" : e.includes("bool") ? "boolean" : "string" : "unknown";
24
- }
25
- function C(n) {
26
- let e = c(n), t = "";
27
- for (; e && e !== t; )
28
- t = e, e = d(e, "nullable"), e = d(e, "lowcardinality");
29
- return e;
30
- }
31
- function d(n, e) {
32
- const t = `${e}(`;
33
- return !n.startsWith(t) || !n.endsWith(")") ? n : n.slice(t.length, -1).trim();
34
- }
35
- function A(n) {
36
- const e = o(n);
37
- return e === "date" || e === "datetime";
38
- }
39
- function u(n) {
40
- return A(n.dataType || n.data_type);
41
- }
42
- function m(n) {
43
- const e = f(n);
44
- return e === "id" || e === "row_id";
45
- }
46
- function l(n) {
47
- const e = f(n);
48
- return m(n) || e.endsWith("_id") || e.endsWith("_key") || e.endsWith("_number");
49
- }
50
- function f(n) {
51
- return c(
52
- g(n) || n.name || n.alias
53
- ).replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
54
- }
55
- function y(n, e = {}) {
56
- const t = c(n.role);
57
- return t === "metric" || t === "measure" ? !e.excludeIdentifiers || !l(n) : t === "groupby" || t === "dimension" || t === "date" || t === "id" ? !1 : o(
58
- n.dataType || n.data_type
59
- ) === "number" && (!e.excludeIdentifiers || !l(n));
60
- }
61
- function h(n) {
62
- return !y(n) && !u(n);
63
- }
64
- function D(n) {
65
- const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
66
- for (const a of n) {
67
- if (m(a))
68
- continue;
69
- const r = p(a);
70
- if (r.length !== 0) {
71
- if (u(a)) {
72
- r.forEach((i) => t.add(i));
73
- continue;
74
- }
75
- if (y(a, { excludeIdentifiers: !0 })) {
76
- r.forEach((i) => e.add(i));
77
- continue;
78
- }
79
- r.forEach((i) => s.add(i));
80
- }
81
- }
82
- return {
83
- validMetricCandidates: Array.from(e).sort(),
84
- validDateCandidates: Array.from(t).sort(),
85
- validDimensionCandidates: Array.from(s).sort()
86
- };
87
- }
88
- export {
89
- p as a,
90
- o as b,
91
- u as c,
92
- m as d,
93
- l as e,
94
- y as f,
95
- g,
96
- h,
97
- A as i,
98
- D as j,
99
- c as n
100
- };
@@ -1 +0,0 @@
1
- "use strict";function l(t){return typeof t=="string"?t.trim().toLowerCase():""}function f(t){return String(t.column_name||t.name||t.qualifiedFieldName||"")}function g(t){return Array.from(new Set([t.column_name,t.name,t.qualifiedFieldName,t.alias].filter(e=>typeof e=="string"&&e.trim().length>0).map(e=>e.trim())))}function d(t){const e=p(t);return e?e.includes("int")||e.includes("uint")||e.includes("bigint")||e.includes("smallint")||e.includes("tinyint")||e.includes("numeric")||e.includes("decimal")||e.includes("double")||e.includes("float")||e.includes("number")||e.includes("real")||e.includes("money")||e.includes("currency")||e.includes("percent")?"number":e.includes("timestamp")||e.includes("datetime")||e.startsWith("time")?"datetime":e.includes("date")?"date":e.includes("bool")?"boolean":"string":"unknown"}function p(t){let e=l(t),i="";for(;e&&e!==i;)i=e,e=y(e,"nullable"),e=y(e,"lowcardinality");return e}function y(t,e){const i=`${e}(`;return!t.startsWith(i)||!t.endsWith(")")?t:t.slice(i.length,-1).trim()}function A(t){const e=d(t);return e==="date"||e==="datetime"}function o(t){return A(t.dataType||t.data_type)}function u(t){const e=C(t);return e==="id"||e==="row_id"}function c(t){const e=C(t);return u(t)||e.endsWith("_id")||e.endsWith("_key")||e.endsWith("_number")}function C(t){return l(f(t)||t.name||t.alias).replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function m(t,e={}){const i=l(t.role);return i==="metric"||i==="measure"?!e.excludeIdentifiers||!c(t):i==="groupby"||i==="dimension"||i==="date"||i==="id"?!1:d(t.dataType||t.data_type)==="number"&&(!e.excludeIdentifiers||!c(t))}function D(t){return!m(t)&&!o(t)}function F(t){const e=new Set,i=new Set,s=new Set;for(const a of t){if(u(a))continue;const r=g(a);if(r.length!==0){if(o(a)){r.forEach(n=>i.add(n));continue}if(m(a,{excludeIdentifiers:!0})){r.forEach(n=>e.add(n));continue}r.forEach(n=>s.add(n))}}return{validMetricCandidates:Array.from(e).sort(),validDateCandidates:Array.from(i).sort(),validDimensionCandidates:Array.from(s).sort()}}exports.buildAnalyticsCatalogFieldSummary=F;exports.getAnalyticsCatalogFieldCandidates=g;exports.getAnalyticsCatalogFieldName=f;exports.isAnalyticsCatalogDateField=o;exports.isAnalyticsCatalogDimensionField=D;exports.isAnalyticsCatalogMetricField=m;exports.isAnalyticsDateLikeDataType=A;exports.isAnalyticsMetricIdentifierField=c;exports.isAnalyticsTechnicalIdentifierField=u;exports.normalizeAnalyticsCatalogDataType=d;exports.normalizeAnalyticsCatalogName=l;