@burdenoff/microfe-bigconsole 2026.1124.4 → 2026.1124.6

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.
@@ -0,0 +1,11 @@
1
+ // src/bigconsole/utils/fleetPlural.ts
2
+ function e(e, t, n, r, i, a = {}) {
3
+ return t === 1 ? e(`${n}One`, i, {
4
+ ...a,
5
+ count: t
6
+ }) : e(n, r, {
7
+ ...a,
8
+ count: t
9
+ });
10
+ }
11
+ export { e as trCount };
@@ -1,14 +1,15 @@
1
- import { isHeatmapShape as e, validateWidgetShape as t } from "./widgetSampleShapes.js";
2
- import { isShapedRetentionData as n, retentionFieldsFromConfig as r, retentionRows as i, tryNormalizeRetention as a } from "../components/widgets/retention/normalizeRetention.js";
1
+ import { resolveWidgetDataPath as e } from "./widgetDisplayData.js";
2
+ import { isHeatmapShape as t, validateWidgetShape as n } from "./widgetSampleShapes.js";
3
+ import { isShapedRetentionData as r, retentionFieldsFromConfig as i, retentionRows as a, tryNormalizeRetention as o } from "../components/widgets/retention/normalizeRetention.js";
3
4
  // src/bigconsole/utils/widgetBinding.ts
4
- var o = /* @__PURE__ */ new Set([
5
+ var s = /* @__PURE__ */ new Set([
5
6
  "DATASINK",
6
7
  "REST_API",
7
8
  "GRAPHQL",
8
9
  "SQL",
9
10
  "WEBSOCKET",
10
11
  "MOCK"
11
- ]), s = [
12
+ ]), c = [
12
13
  "labelField",
13
14
  "valueField",
14
15
  "xAxisField",
@@ -16,15 +17,15 @@ var o = /* @__PURE__ */ new Set([
16
17
  "categoryField",
17
18
  "seriesField"
18
19
  ];
19
- function c(e) {
20
- return typeof e == "object" && !!e && !Array.isArray(e);
21
- }
22
20
  function l(e) {
23
- return typeof e == "string" && o.has(e);
21
+ return typeof e == "object" && !!e && !Array.isArray(e);
24
22
  }
25
23
  function u(e) {
26
- if (!c(e) || !c(e.source) || !l(e.source.kind)) return null;
27
- let t = c(e.fields) ? Object.fromEntries(Object.entries(e.fields).filter((e) => typeof e[1] == "string")) : {};
24
+ return typeof e == "string" && s.has(e);
25
+ }
26
+ function d(e) {
27
+ if (!l(e) || !l(e.source) || !u(e.source.kind)) return null;
28
+ let t = l(e.fields) ? Object.fromEntries(Object.entries(e.fields).filter((e) => typeof e[1] == "string")) : {};
28
29
  return {
29
30
  source: {
30
31
  kind: e.source.kind,
@@ -34,11 +35,11 @@ function u(e) {
34
35
  fields: t
35
36
  };
36
37
  }
37
- function d(e) {
38
- let t = e.config ?? {}, n = u(t.binding);
38
+ function f(e) {
39
+ let t = e.config ?? {}, n = d(t.binding);
39
40
  if (n) return n;
40
- let r = l(t.dataSourceType) ? t.dataSourceType : void 0, i = e.dataSinkId ? "DATASINK" : r ?? "DATASINK", a = {};
41
- for (let e of s) {
41
+ let r = u(t.dataSourceType) ? t.dataSourceType : void 0, i = e.dataSinkId ? "DATASINK" : r ?? "DATASINK", a = {};
42
+ for (let e of c) {
42
43
  let n = t[e];
43
44
  typeof n == "string" && n.length > 0 && (a[e] = n);
44
45
  }
@@ -51,20 +52,20 @@ function d(e) {
51
52
  fields: a
52
53
  };
53
54
  }
54
- function f(e) {
55
- return d({
55
+ function p(e) {
56
+ return f({
56
57
  dataSinkId: e.dataSinkId ?? void 0,
57
58
  parserId: e.parserId ?? void 0,
58
59
  config: e.config ?? {}
59
60
  });
60
61
  }
61
- function p(e, t, n) {
62
+ function m(e, t, n) {
62
63
  let r = { ...e }, i = (e, t) => JSON.stringify(e) === JSON.stringify(t);
63
64
  for (let e of Object.keys(n)) i(n[e], t[e]) || (r[e] = n[e]);
64
65
  for (let e of Object.keys(t)) e in n || delete r[e];
65
66
  return r;
66
67
  }
67
- function m(e, t) {
68
+ function h(e, t) {
68
69
  let n = {
69
70
  source: {
70
71
  kind: e.source.kind,
@@ -84,10 +85,10 @@ function m(e, t) {
84
85
  parserId: n.parserId
85
86
  };
86
87
  }
87
- function h(e, t) {
88
- return t.replace(/^\$?\.?/, "").split(".").filter(Boolean).reduce((e, t) => c(e) ? e[t] : void 0, e);
89
- }
90
88
  function g(e, t) {
89
+ return t.replace(/^\$?\.?/, "").split(".").filter(Boolean).reduce((e, t) => l(e) ? e[t] : void 0, e);
90
+ }
91
+ function _(e, t) {
91
92
  if (e.source.kind === "DATASINK" && !e.source.ref) return {
92
93
  status: "unbound",
93
94
  missingFields: []
@@ -96,28 +97,28 @@ function g(e, t) {
96
97
  status: "bound",
97
98
  missingFields: []
98
99
  };
99
- let n = Object.entries(e.fields).filter(([, e]) => h(t, e) === void 0).map(([e]) => e);
100
+ let n = Object.entries(e.fields).filter(([, e]) => g(t, e) === void 0).map(([e]) => e);
100
101
  return {
101
102
  status: n.length > 0 ? "field_mismatch" : "bound",
102
103
  missingFields: n
103
104
  };
104
105
  }
105
- function _(e, o, s) {
106
- if (n(e)) return {
106
+ function v(e, t, s) {
107
+ if (r(e)) return {
107
108
  status: "bound",
108
109
  missingFields: []
109
110
  };
110
- let c = i(e);
111
+ let c = a(e);
111
112
  if (!c) {
112
- let n = t("retention", e);
113
+ let t = n("retention", e);
113
114
  return {
114
- status: n.length > 0 ? "shape_mismatch" : "bound",
115
- missingFields: n
115
+ status: t.length > 0 ? "shape_mismatch" : "bound",
116
+ missingFields: t
116
117
  };
117
118
  }
118
- let l = r(s), u = a(c, {
119
+ let l = i(s), u = o(c, {
119
120
  ...l,
120
- valueField: o.fields.valueField ?? l.valueField
121
+ valueField: t.fields.valueField ?? l.valueField
121
122
  });
122
123
  return u.error ? u.error.code === "missing_fields" ? {
123
124
  status: "field_mismatch",
@@ -130,14 +131,26 @@ function _(e, o, s) {
130
131
  missingFields: []
131
132
  };
132
133
  }
133
- function v(t, n, r, i) {
134
- return r === "retention" ? _(n, t, i) : r === "heatmap" && e(n) ? {
134
+ function y(n, r, i, a) {
135
+ if (i === "retention") return v(r, n, a);
136
+ if (i === "heatmap" && t(r)) return {
135
137
  status: "bound",
136
138
  missingFields: []
137
- } : g(t, Array.isArray(n) ? n[0] : n);
139
+ };
140
+ if (i === "chart" || i === "funnel_chart") {
141
+ let t = e(r, a);
142
+ if (Array.isArray(t) && t.length > 0) {
143
+ let e = Object.entries(n.fields).filter(([, e]) => !t.some((t) => l(t) && (Object.hasOwn(t, e) || g(t, e) !== void 0))).map(([e]) => e);
144
+ return {
145
+ status: e.length > 0 ? "field_mismatch" : "bound",
146
+ missingFields: e
147
+ };
148
+ }
149
+ }
150
+ return _(n, Array.isArray(r) ? r[0] : r);
138
151
  }
139
- function y({ binding: e, loading: n = !1, error: r, preview: i, previewComplete: a = !1, widgetType: o, mockData: s, hasParser: c, config: l }) {
140
- if (n) return {
152
+ function b({ binding: e, loading: t = !1, error: r, preview: i, previewComplete: a = !1, widgetType: o, mockData: s, hasParser: c, config: l }) {
153
+ if (t) return {
141
154
  status: "loading",
142
155
  missingFields: []
143
156
  };
@@ -145,12 +158,12 @@ function y({ binding: e, loading: n = !1, error: r, preview: i, previewComplete:
145
158
  status: "parser_error",
146
159
  missingFields: []
147
160
  };
148
- let u = g(e);
161
+ let u = _(e);
149
162
  if (u.status === "unbound") return u;
150
163
  if (e.source.kind === "MOCK" && s !== void 0 && s !== "") {
151
- let n = s;
164
+ let t = s;
152
165
  if (typeof s == "string") try {
153
- n = JSON.parse(s);
166
+ t = JSON.parse(s);
154
167
  } catch {
155
168
  return {
156
169
  status: "invalid_sample",
@@ -158,10 +171,10 @@ function y({ binding: e, loading: n = !1, error: r, preview: i, previewComplete:
158
171
  };
159
172
  }
160
173
  if (o === "retention") {
161
- let t = _(n, e, l);
162
- if (t.status !== "bound") return t;
174
+ let n = v(t, e, l);
175
+ if (n.status !== "bound") return n;
163
176
  } else {
164
- let e = t(o, n);
177
+ let e = n(o, t);
165
178
  if (e.length > 0) return {
166
179
  status: "shape_mismatch",
167
180
  missingFields: e
@@ -174,12 +187,12 @@ function y({ binding: e, loading: n = !1, error: r, preview: i, previewComplete:
174
187
  } : a ? i == null || Array.isArray(i) && i.length === 0 ? {
175
188
  status: "no_data",
176
189
  missingFields: []
177
- } : v(e, i, o, l) : u;
190
+ } : y(e, i, o, l) : u;
178
191
  }
179
- function b(e, t) {
192
+ function x(e, t) {
180
193
  return e?.success ? {
181
194
  preview: e.output,
182
195
  error: null
183
196
  } : { error: e?.error || t };
184
197
  }
185
- export { f as getBindingForWidget, d as getWidgetBinding, y as getWidgetBindingStatus, b as parserTestOutcome, p as reconcilePanelConfig, h as resolveBindingPath, m as serializeWidgetBinding, g as validateWidgetBinding };
198
+ export { p as getBindingForWidget, f as getWidgetBinding, b as getWidgetBindingStatus, x as parserTestOutcome, m as reconcilePanelConfig, g as resolveBindingPath, h as serializeWidgetBinding, _ as validateWidgetBinding };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-bigconsole",
3
- "version": "2026.1124.4",
3
+ "version": "2026.1124.6",
4
4
  "description": "BigConsole - AI-powered analytics and dashboard platform",
5
5
  "repository": {
6
6
  "type": "git",