react-semaphor 0.1.340 → 0.1.342

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 (45) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +1 -1
  3. package/dist/chunks/{calendar-preferences-dialog-8-KE5sVX.js → calendar-preferences-dialog-_u4Xm011.js} +1 -1
  4. package/dist/chunks/{calendar-preferences-dialog-2IbYrrP1.js → calendar-preferences-dialog-hS6POgEs.js} +1 -1
  5. package/dist/chunks/{dashboard-briefing-launcher-CcqDPVke.js → dashboard-briefing-launcher-D18qNhwa.js} +1 -1
  6. package/dist/chunks/{dashboard-briefing-launcher-DtxDRAiu.js → dashboard-briefing-launcher-DHzIiaKF.js} +3 -3
  7. package/dist/chunks/{dashboard-controls-By7aKmDj.js → dashboard-controls-CilLVS_Q.js} +1 -1
  8. package/dist/chunks/{dashboard-controls-Bi98DhYD.js → dashboard-controls-g1OcteYf.js} +3 -3
  9. package/dist/chunks/{dashboard-json-CGxIsTEP.js → dashboard-json-BjnGSaxC.js} +1 -1
  10. package/dist/chunks/{dashboard-json-BOyLuhS6.js → dashboard-json-ClH0kTga.js} +1 -1
  11. package/dist/chunks/{edit-dashboard-visual-BuXlHmJH.js → edit-dashboard-visual-C_3NYnPz.js} +1 -1
  12. package/dist/chunks/{edit-dashboard-visual-Ba8LenNc.js → edit-dashboard-visual-DbVMVMKM.js} +3 -3
  13. package/dist/chunks/{index-DT9osgRT.js → index-BNZjkxPH.js} +3 -3
  14. package/dist/chunks/{index-DVPvpd8u.js → index-CuSvSh86.js} +7 -6
  15. package/dist/chunks/{resource-management-panel-98Hy6SYB.js → resource-management-panel-DxjN2uw4.js} +2 -2
  16. package/dist/chunks/{resource-management-panel-ByR-FD3h.js → resource-management-panel-N5iUOE89.js} +1 -1
  17. package/dist/chunks/{use-create-flow-overlay-state-uNxArZdj.js → use-create-flow-overlay-state-CSjc7cXZ.js} +1 -1
  18. package/dist/chunks/{use-create-flow-overlay-state-D5uvjbwY.js → use-create-flow-overlay-state-CXPnnXh1.js} +2 -2
  19. package/dist/chunks/{use-visual-utils-CpaqIHoc.js → use-visual-utils-C3MRLrHu.js} +1 -1
  20. package/dist/chunks/{use-visual-utils-BLh9mKic.js → use-visual-utils-DsoGoqPF.js} +1 -1
  21. package/dist/chunks/{validators-CPEQojnV.js → validators-BqEnmlC6.js} +236 -155
  22. package/dist/chunks/validators-v8WAqhaN.js +1 -0
  23. package/dist/dashboard/index.cjs +1 -1
  24. package/dist/dashboard/index.js +1 -1
  25. package/dist/dashboard-authoring/index.cjs +1 -1
  26. package/dist/dashboard-authoring/index.js +1 -1
  27. package/dist/data-app-builder/index.cjs +1 -1
  28. package/dist/data-app-builder/index.js +1 -1
  29. package/dist/data-app-sdk/index.cjs +1 -1
  30. package/dist/data-app-sdk/index.js +151 -140
  31. package/dist/index.cjs +1 -1
  32. package/dist/index.js +5 -5
  33. package/dist/surfboard/index.cjs +1 -1
  34. package/dist/surfboard/index.js +2 -2
  35. package/dist/types/analytics-protocol.d.ts +18 -2
  36. package/dist/types/dashboard-authoring.d.ts +10 -1
  37. package/dist/types/dashboard.d.ts +2 -0
  38. package/dist/types/data-app-builder.d.ts +9 -1
  39. package/dist/types/data-app-sdk.d.ts +16 -5
  40. package/dist/types/main.d.ts +11 -1
  41. package/dist/types/shared.d.ts +1 -0
  42. package/dist/types/surfboard.d.ts +2 -0
  43. package/dist/types/types.d.ts +2 -0
  44. package/package.json +1 -1
  45. package/dist/chunks/validators-CfP-49k9.js +0 -1
@@ -17,10 +17,10 @@ function y(e) {
17
17
  e.label || ""
18
18
  ].join(":") : "";
19
19
  }
20
- function I(e, i) {
20
+ function M(e, i) {
21
21
  return !e || !i ? e === i : e.kind !== i.kind ? !1 : e.kind === "semantic" && i.kind === "semantic" ? e.domainId !== i.domainId ? !1 : e.datasetId && i.datasetId ? e.datasetId === i.datasetId : e.datasetName === i.datasetName : y(e) === y(i);
22
22
  }
23
- function $(e, i) {
23
+ function S(e, i) {
24
24
  return e.kind !== "semantic" || i.kind !== "semantic" ? e : {
25
25
  ...e,
26
26
  datasetId: e.datasetId || i.datasetId,
@@ -28,22 +28,22 @@ function $(e, i) {
28
28
  connectionId: e.connectionId || i.connectionId
29
29
  };
30
30
  }
31
- function S(e, i) {
32
- return e.name === i.name && I(e.source, i.source);
31
+ function $(e, i) {
32
+ return e.name === i.name && M(e.source, i.source);
33
33
  }
34
- function D(e, i) {
34
+ function P(e, i) {
35
35
  return {
36
36
  ...e,
37
37
  label: e.label || i.label,
38
38
  role: e.role || i.role,
39
39
  dataType: e.dataType || i.dataType,
40
- source: e.source && i.source ? $(e.source, i.source) : e.source || i.source
40
+ source: e.source && i.source ? S(e.source, i.source) : e.source || i.source
41
41
  };
42
42
  }
43
- function n(e, i, s) {
43
+ function a(e, i, s) {
44
44
  return s ? { code: e, message: i, path: s } : { code: e, message: i };
45
45
  }
46
- function M(e) {
46
+ function N(e) {
47
47
  for (let i = 0; i < e.length; i += 1) {
48
48
  const s = e[i];
49
49
  if (e.some(
@@ -54,19 +54,33 @@ function M(e) {
54
54
  return !0;
55
55
  }
56
56
  function _(e, i) {
57
- return S(e, i);
57
+ return $(e, i);
58
58
  }
59
- function N(e, i) {
59
+ function B(e, i) {
60
60
  const s = i.filter((r) => r.name === e.name);
61
+ return e.source ? s.some(
62
+ (r) => _(r, e) && h(e, r)
63
+ ) : s.length === 1 && h(e, s[0]);
64
+ }
65
+ function h(e, i) {
66
+ return i ? e.aggregate ? i.aggregate === e.aggregate : !0 : !1;
67
+ }
68
+ function R(e, i) {
69
+ const s = i.filter(
70
+ (r) => F(e, r)
71
+ );
61
72
  return e.source ? s.some((r) => _(r, e)) : s.length === 1;
62
73
  }
74
+ function F(e, i) {
75
+ return !(i.name !== e.name || e.role !== void 0 && i.role !== void 0 && i.role !== e.role || e.aggregate !== void 0 && i.aggregate !== e.aggregate);
76
+ }
63
77
  function d(e) {
64
78
  return typeof e == "string" && e.trim().length > 0;
65
79
  }
66
- function u(e) {
80
+ function c(e) {
67
81
  return !!(e && typeof e == "object" && !Array.isArray(e));
68
82
  }
69
- function h(e) {
83
+ function v(e) {
70
84
  const i = /* @__PURE__ */ new Set();
71
85
  for (const s of e) {
72
86
  if (i.has(s))
@@ -75,20 +89,29 @@ function h(e) {
75
89
  }
76
90
  return null;
77
91
  }
78
- function v(e, i, s) {
92
+ const j = /* @__PURE__ */ new Set([
93
+ "SUM",
94
+ "COUNT",
95
+ "AVG",
96
+ "MIN",
97
+ "MAX",
98
+ "MEDIAN",
99
+ "DISTINCT"
100
+ ]);
101
+ function g(e, i, s) {
79
102
  if (!e || typeof e != "object") {
80
- s.push(n("missing_source", "Analytics intent needs a source.", i));
103
+ s.push(a("missing_source", "Analytics intent needs a source.", i));
81
104
  return;
82
105
  }
83
106
  if (e.kind === "semantic") {
84
107
  d(e.domainId) || s.push(
85
- n(
108
+ a(
86
109
  "missing_semantic_domain",
87
110
  "Semantic source needs a domainId.",
88
111
  `${i}.domainId`
89
112
  )
90
113
  ), d(e.datasetName) || s.push(
91
- n(
114
+ a(
92
115
  "missing_dataset_name",
93
116
  "Semantic source needs a datasetName.",
94
117
  `${i}.datasetName`
@@ -98,13 +121,13 @@ function v(e, i, s) {
98
121
  }
99
122
  if (e.kind === "physical") {
100
123
  d(e.connectionId) || s.push(
101
- n(
124
+ a(
102
125
  "missing_connection_id",
103
126
  "Physical source needs a connectionId.",
104
127
  `${i}.connectionId`
105
128
  )
106
129
  ), d(e.tableName) || s.push(
107
- n(
130
+ a(
108
131
  "missing_table_name",
109
132
  "Physical source needs a tableName.",
110
133
  `${i}.tableName`
@@ -114,7 +137,7 @@ function v(e, i, s) {
114
137
  }
115
138
  if (e.kind === "sql") {
116
139
  d(e.connectionId) || s.push(
117
- n(
140
+ a(
118
141
  "missing_connection_id",
119
142
  "SQL source needs a connectionId.",
120
143
  `${i}.connectionId`
@@ -122,25 +145,34 @@ function v(e, i, s) {
122
145
  );
123
146
  return;
124
147
  }
125
- s.push(n("invalid_source_kind", "Source kind is not supported.", i));
148
+ s.push(a("invalid_source_kind", "Source kind is not supported.", i));
126
149
  }
127
150
  function f(e, i, s, r = {}) {
128
- if (!e || !u(e)) {
151
+ if (!e || !c(e)) {
129
152
  r.required && s.push(
130
- n("missing_field_ref", "Field reference needs a name.", i)
153
+ a("missing_field_ref", "Field reference needs a name.", i)
131
154
  );
132
155
  return;
133
156
  }
134
157
  d(e.name) || s.push(
135
- n("missing_field_ref", "Field reference needs a name.", `${i}.name`)
136
- ), e.source !== void 0 && v(e.source, `${i}.source`, s);
158
+ a("missing_field_ref", "Field reference needs a name.", `${i}.name`)
159
+ ), e.source !== void 0 && g(e.source, `${i}.source`, s), T(e.aggregate, `${i}.aggregate`, s);
137
160
  }
138
- function R(e, i) {
161
+ function T(e, i, s) {
162
+ e !== void 0 && (typeof e != "string" || !j.has(e)) && s.push(
163
+ a(
164
+ "invalid_aggregate",
165
+ "Field aggregate must be SUM, COUNT, AVG, MIN, MAX, MEDIAN, or DISTINCT.",
166
+ i
167
+ )
168
+ );
169
+ }
170
+ function x(e, i) {
139
171
  if (e.analysis === void 0)
140
172
  return;
141
- if (!u(e.analysis)) {
173
+ if (!c(e.analysis)) {
142
174
  i.push(
143
- n(
175
+ a(
144
176
  "invalid_metric_analysis",
145
177
  "Metric analysis must be a structured object.",
146
178
  "analysis"
@@ -150,7 +182,7 @@ function R(e, i) {
150
182
  }
151
183
  if (e.analysis.kind !== "period_change") {
152
184
  i.push(
153
- n(
185
+ a(
154
186
  "invalid_metric_analysis",
155
187
  "Metric analysis kind is not supported.",
156
188
  "analysis.kind"
@@ -159,25 +191,31 @@ function R(e, i) {
159
191
  return;
160
192
  }
161
193
  e.dateField || i.push(
162
- n(
194
+ a(
163
195
  "missing_analysis_date_field",
164
196
  "Period-change analysis needs a dateField.",
165
197
  "dateField"
166
198
  )
167
199
  ), e.timeGrain || i.push(
168
- n(
200
+ a(
169
201
  "missing_analysis_time_grain",
170
202
  "Period-change analysis needs a timeGrain.",
171
203
  "timeGrain"
172
204
  )
205
+ ), e.analysis.orderBy !== void 0 && e.analysis.orderBy !== "absolute_change" && e.analysis.orderBy !== "positive_change" && e.analysis.orderBy !== "negative_change" && e.analysis.orderBy !== "period" && i.push(
206
+ a(
207
+ "invalid_metric_analysis",
208
+ "Period-change analysis orderBy must be absolute_change, positive_change, negative_change, or period.",
209
+ "analysis.orderBy"
210
+ )
173
211
  );
174
212
  const { timeWindow: s } = e.analysis;
175
213
  s !== void 0 && b(s, "analysis.timeWindow", i);
176
214
  }
177
215
  function b(e, i, s) {
178
- if (!u(e)) {
216
+ if (!c(e)) {
179
217
  s.push(
180
- n(
218
+ a(
181
219
  "invalid_time_window",
182
220
  "Time window must be a structured object.",
183
221
  i
@@ -186,30 +224,36 @@ function b(e, i, s) {
186
224
  return;
187
225
  }
188
226
  e.unit !== "second" && e.unit !== "minute" && e.unit !== "hour" && e.unit !== "day" && e.unit !== "week" && e.unit !== "month" && e.unit !== "quarter" && e.unit !== "year" && s.push(
189
- n(
227
+ a(
190
228
  "invalid_time_window",
191
229
  "Time window unit must be second, minute, hour, day, week, month, quarter, or year.",
192
230
  `${i}.unit`
193
231
  )
194
232
  ), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && s.push(
195
- n(
233
+ a(
196
234
  "invalid_time_window",
197
235
  "Time window value must be a positive number.",
198
236
  `${i}.value`
199
237
  )
200
238
  ), e.anchor !== void 0 && e.anchor !== "now" && e.anchor !== "latest_available" && s.push(
201
- n(
239
+ a(
202
240
  "invalid_time_window",
203
241
  "Time window anchor must be now or latest_available.",
204
242
  `${i}.anchor`
205
243
  )
244
+ ), e.completeness !== void 0 && e.completeness !== "include_partial" && e.completeness !== "complete_periods" && s.push(
245
+ a(
246
+ "invalid_time_window",
247
+ "Time window completeness must be include_partial or complete_periods.",
248
+ `${i}.completeness`
249
+ )
206
250
  );
207
251
  }
208
- function j(e, i, s) {
252
+ function D(e, i, s) {
209
253
  if (e !== void 0) {
210
254
  if (!Array.isArray(e)) {
211
255
  s.push(
212
- n(
256
+ a(
213
257
  "invalid_analytics_filters",
214
258
  "Analytics filters must be an array.",
215
259
  i
@@ -218,62 +262,62 @@ function j(e, i, s) {
218
262
  return;
219
263
  }
220
264
  e.forEach((r, o) => {
221
- const a = `${i}.${o}`;
222
- if (!u(r)) {
265
+ const n = `${i}.${o}`;
266
+ if (!c(r)) {
223
267
  s.push(
224
- n(
268
+ a(
225
269
  "invalid_analytics_filter",
226
270
  "Analytics filter must be a structured object.",
227
- a
271
+ n
228
272
  )
229
273
  );
230
274
  return;
231
275
  }
232
276
  const t = r;
233
- f(t.field, `${a}.field`, s, {
277
+ f(t.field, `${n}.field`, s, {
234
278
  required: !0
235
279
  });
236
280
  const p = t.operator === "is_null" || t.operator === "is_not_null";
237
281
  if (t.operator !== void 0 && t.operator !== "=" && t.operator !== "!=" && t.operator !== "in" && t.operator !== "not_in" && t.operator !== "contains" && t.operator !== "not_contains" && t.operator !== "between" && t.operator !== "not_between" && t.operator !== ">" && t.operator !== ">=" && t.operator !== "<" && t.operator !== "<=" && t.operator !== "is_null" && t.operator !== "is_not_null" && s.push(
238
- n(
282
+ a(
239
283
  "invalid_analytics_filter_operator",
240
284
  "Analytics filter operator is not supported.",
241
- `${a}.operator`
285
+ `${n}.operator`
242
286
  )
243
287
  ), t.values === void 0 && !p && s.push(
244
- n(
288
+ a(
245
289
  "missing_analytics_filter_value",
246
290
  "Analytics filter needs values unless it is a null check.",
247
- a
291
+ n
248
292
  )
249
293
  ), p && t.values !== void 0) {
250
294
  s.push(
251
- n(
295
+ a(
252
296
  "invalid_analytics_filter_values",
253
297
  "Null-check analytics filters must not include values.",
254
- `${a}.values`
298
+ `${n}.values`
255
299
  )
256
300
  );
257
301
  return;
258
302
  }
259
303
  t.values !== void 0 && !Array.isArray(t.values) && s.push(
260
- n(
304
+ a(
261
305
  "invalid_analytics_filter_values",
262
306
  "Analytics filter values must be an array when provided.",
263
- `${a}.values`
307
+ `${n}.values`
264
308
  )
265
309
  );
266
310
  });
267
311
  }
268
312
  }
269
- function g(e) {
313
+ function A(e) {
270
314
  var r;
271
315
  const i = [], s = [];
272
316
  if (!e || typeof e != "object")
273
317
  return {
274
318
  ok: !1,
275
319
  errors: [
276
- n(
320
+ a(
277
321
  "invalid_analytics_intent",
278
322
  "Analytics intent must be a structured object."
279
323
  )
@@ -287,134 +331,171 @@ function g(e) {
287
331
  ]
288
332
  };
289
333
  if (e.version !== void 0 && e.version !== 1 && i.push(
290
- n("invalid_version", "Analytics intent version must be 1.", "version")
291
- ), v(e.source, "source", i), e.kind === "metric") {
334
+ a("invalid_version", "Analytics intent version must be 1.", "version")
335
+ ), g(e.source, "source", i), e.kind === "metric") {
292
336
  const o = Array.isArray(e.metrics) ? e.metrics.filter(
293
- (a) => u(a) && d(a.name)
337
+ (n) => c(n) && d(n.name)
294
338
  ) : [];
295
339
  if (!Array.isArray(e.metrics) || e.metrics.length === 0 ? i.push(
296
- n("missing_metric", "Metric intent needs at least one metric.", "metrics")
340
+ a("missing_metric", "Metric intent needs at least one metric.", "metrics")
297
341
  ) : e.metrics.some(
298
- (a) => !u(a) || !d(a.name)
342
+ (n) => !c(n) || !d(n.name)
299
343
  ) && i.push(
300
- n(
344
+ a(
301
345
  "invalid_metric_list",
302
346
  "Metric intent metrics must be an array of field references with names.",
303
347
  "metrics"
304
348
  )
305
- ), o.forEach((a, t) => {
306
- f(a, `metrics.${t}`, i, {
349
+ ), o.forEach((n, t) => {
350
+ f(n, `metrics.${t}`, i, {
307
351
  required: !0
308
352
  });
309
- }), o.length > 0 && !M(o)) {
310
- const a = o.find(
353
+ }), o.length > 0 && !N(o)) {
354
+ const n = o.find(
311
355
  (t, p) => o.some(
312
- (c, l) => l !== p && _(c, t)
356
+ (u, l) => l !== p && _(u, t)
313
357
  )
314
358
  );
315
- a && i.push(
316
- n(
359
+ n && i.push(
360
+ a(
317
361
  "duplicate_metric",
318
- `Metric intent has duplicate metric "${a.name}".`,
362
+ `Metric intent has duplicate metric "${n.name}".`,
319
363
  "metrics"
320
364
  )
321
365
  );
322
366
  }
323
- u(e.primaryMetric) && d(e.primaryMetric.name) && e.primaryMetric.source === void 0 && o.filter((a) => {
367
+ if (c(e.primaryMetric) && d(e.primaryMetric.name) && e.primaryMetric.source === void 0 && o.filter((n) => {
324
368
  var t;
325
- return a.name === ((t = e.primaryMetric) == null ? void 0 : t.name);
369
+ return n.name === ((t = e.primaryMetric) == null ? void 0 : t.name);
326
370
  }).length > 1 && i.push(
327
- n(
371
+ a(
328
372
  "ambiguous_primary_metric",
329
373
  "Metric intent primaryMetric needs a source when it names a duplicated metric.",
330
374
  "primaryMetric"
331
375
  )
332
376
  ), e.primaryMetric !== void 0 && (f(e.primaryMetric, "primaryMetric", i, {
333
377
  required: !0
334
- }), u(e.primaryMetric) && d(e.primaryMetric.name) && o.length > 0 && !N(
378
+ }), c(e.primaryMetric) && d(e.primaryMetric.name) && o.length > 0 && !B(
335
379
  e.primaryMetric,
336
380
  o
337
381
  ) && i.push(
338
- n(
382
+ a(
339
383
  "invalid_primary_metric",
340
384
  "Metric intent primaryMetric must match one metric field reference.",
341
385
  "primaryMetric"
342
386
  )
343
387
  )), e.dimensions !== void 0 && !Array.isArray(e.dimensions) ? i.push(
344
- n(
388
+ a(
345
389
  "invalid_metric_dimensions",
346
390
  "Metric intent dimensions must be an array of field references.",
347
391
  "dimensions"
348
392
  )
349
393
  ) : Array.isArray(e.dimensions) && e.dimensions.some(
350
- (a) => !u(a) || !d(a.name)
394
+ (n) => !c(n) || !d(n.name)
351
395
  ) && i.push(
352
- n(
396
+ a(
353
397
  "invalid_metric_dimensions",
354
398
  "Metric intent dimensions must be an array of field references with names.",
355
399
  "dimensions"
356
400
  )
357
401
  ), e.dateField !== void 0 && f(e.dateField, "dateField", i), e.timeWindow !== void 0 && (b(e.timeWindow, "timeWindow", i), e.dateField || i.push(
358
- n(
402
+ a(
359
403
  "missing_time_window_date_field",
360
404
  "Metric timeWindow needs a dateField.",
361
405
  "dateField"
362
406
  )
363
- )), j(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((a, t) => {
364
- f(a, `dimensions.${t}`, i);
365
- }), R(e, i);
407
+ )), D(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((n, t) => {
408
+ f(n, `dimensions.${t}`, i);
409
+ }), e.orderBy !== void 0) {
410
+ if (!c(e.orderBy))
411
+ i.push(
412
+ a(
413
+ "invalid_metric_order_by",
414
+ "Metric intent orderBy must be a structured object.",
415
+ "orderBy"
416
+ )
417
+ );
418
+ else if (f(e.orderBy.field, "orderBy.field", i, {
419
+ required: !0
420
+ }), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
421
+ a(
422
+ "invalid_metric_order_direction",
423
+ "Metric intent orderBy direction must be asc or desc.",
424
+ "orderBy.direction"
425
+ )
426
+ ), c(e.orderBy.field) && d(e.orderBy.field.name)) {
427
+ const n = [
428
+ ...o,
429
+ ...e.timeGrain && e.dateField && c(e.dateField) ? [e.dateField] : [],
430
+ ...Array.isArray(e.dimensions) ? e.dimensions.filter(
431
+ (t) => c(t) && d(t.name)
432
+ ) : []
433
+ ];
434
+ n.length > 0 && !R(
435
+ e.orderBy.field,
436
+ n
437
+ ) && i.push(
438
+ a(
439
+ "invalid_metric_order_by",
440
+ "Metric intent orderBy.field must match one selected metric, grouped dateField, or dimension.",
441
+ "orderBy.field"
442
+ )
443
+ );
444
+ }
445
+ }
446
+ x(e, i);
366
447
  } else e.kind === "records" ? (!Array.isArray(e.fields) || e.fields.length === 0 ? i.push(
367
- n(
448
+ a(
368
449
  "missing_record_fields",
369
450
  "Records intent needs at least one field.",
370
451
  "fields"
371
452
  )
372
453
  ) : e.fields.some(
373
- (o) => !u(o) || !d(o.name)
454
+ (o) => !c(o) || !d(o.name)
374
455
  ) && i.push(
375
- n(
456
+ a(
376
457
  "invalid_record_fields",
377
458
  "Records intent fields must be field references with names.",
378
459
  "fields"
379
460
  )
380
- ), Array.isArray(e.fields) && e.fields.forEach((o, a) => {
381
- f(o, `fields.${a}`, i);
382
- }), e.dateField !== void 0 && f(e.dateField, "dateField", i), e.orderBy !== void 0 && (u(e.orderBy) ? (f(e.orderBy.field, "orderBy.field", i, {
461
+ ), Array.isArray(e.fields) && e.fields.forEach((o, n) => {
462
+ f(o, `fields.${n}`, i);
463
+ }), e.dateField !== void 0 && f(e.dateField, "dateField", i), e.orderBy !== void 0 && (c(e.orderBy) ? (f(e.orderBy.field, "orderBy.field", i, {
383
464
  required: !0
384
465
  }), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
385
- n(
466
+ a(
386
467
  "invalid_record_order_direction",
387
468
  "Records intent orderBy direction must be asc or desc.",
388
469
  "orderBy.direction"
389
470
  )
390
471
  )) : i.push(
391
- n(
472
+ a(
392
473
  "invalid_record_order_by",
393
474
  "Records intent orderBy must be a structured object.",
394
475
  "orderBy"
395
476
  )
396
477
  ))) : e.kind === "inputOptions" ? ((!e.field || !d(e.field.name)) && i.push(
397
- n(
478
+ a(
398
479
  "missing_input_options_field",
399
480
  "Input options intent needs a field.",
400
481
  "field"
401
482
  )
402
483
  ), f(e.field, "field", i, { required: !0 })) : e.kind === "sql" ? (((r = e.source) == null ? void 0 : r.kind) !== "sql" && i.push(
403
- n(
484
+ a(
404
485
  "invalid_sql_source",
405
486
  "SQL analytics intent must use a SQL execution source.",
406
487
  "source"
407
488
  )
408
- ), d(e.sql) || i.push(n("missing_sql", "SQL analytics intent needs SQL text.", "sql")), Array.isArray(e.fields) && e.fields.forEach((o, a) => {
409
- f(o, `fields.${a}`, i);
489
+ ), d(e.sql) || i.push(a("missing_sql", "SQL analytics intent needs SQL text.", "sql")), Array.isArray(e.fields) && e.fields.forEach((o, n) => {
490
+ f(o, `fields.${n}`, i);
410
491
  })) : i.push(
411
- n("invalid_analytics_kind", "Analytics kind is not supported.", "kind")
492
+ a("invalid_analytics_kind", "Analytics kind is not supported.", "kind")
412
493
  );
413
494
  return {
414
495
  ok: i.length === 0,
415
496
  errors: i,
416
497
  warnings: s,
417
- repairHints: x(i)
498
+ repairHints: E(i)
418
499
  };
419
500
  }
420
501
  function q(e) {
@@ -423,7 +504,7 @@ function q(e) {
423
504
  return {
424
505
  ok: !1,
425
506
  errors: [
426
- n(
507
+ a(
427
508
  "invalid_operation_intent",
428
509
  "Operation intent must be a structured object."
429
510
  )
@@ -437,23 +518,23 @@ function q(e) {
437
518
  ]
438
519
  };
439
520
  if (e.version !== 1 && i.push(
440
- n("invalid_version", "Operation intent version must be 1.", "version")
521
+ a("invalid_version", "Operation intent version must be 1.", "version")
441
522
  ), e.kind === "answer_obligations")
442
523
  !Array.isArray(e.obligations) || e.obligations.length === 0 ? i.push(
443
- n(
524
+ a(
444
525
  "missing_obligations",
445
526
  "Answer-obligations operation intent needs at least one obligation.",
446
527
  "obligations"
447
528
  )
448
529
  ) : e.obligations.forEach((r, o) => {
449
530
  d(r.id) || i.push(
450
- n(
531
+ a(
451
532
  "missing_obligation_id",
452
533
  "Each analytics obligation needs an id.",
453
534
  `obligations.${o}.id`
454
535
  )
455
536
  ), d(r.prompt) || i.push(
456
- n(
537
+ a(
457
538
  "missing_obligation_prompt",
458
539
  "Each analytics obligation needs a prompt.",
459
540
  `obligations.${o}.prompt`
@@ -462,20 +543,20 @@ function q(e) {
462
543
  });
463
544
  else if (e.kind === "dashboard_change" || e.kind === "data_app_change") {
464
545
  if (d(e.instruction) || i.push(
465
- n(
546
+ a(
466
547
  "missing_instruction",
467
548
  "Change operation intent needs an instruction.",
468
549
  "instruction"
469
550
  )
470
551
  ), e.analyticsIntent) {
471
- const r = g(
552
+ const r = A(
472
553
  e.analyticsIntent
473
554
  );
474
555
  i.push(...r.errors), s.push(...r.warnings);
475
556
  }
476
557
  } else
477
558
  i.push(
478
- n(
559
+ a(
479
560
  "invalid_operation_kind",
480
561
  "Operation intent kind is not supported.",
481
562
  "kind"
@@ -488,13 +569,13 @@ function q(e) {
488
569
  repairHints: k(i)
489
570
  };
490
571
  }
491
- function T(e) {
572
+ function O(e) {
492
573
  const i = [], s = [];
493
574
  if (!e || typeof e != "object")
494
575
  return {
495
576
  ok: !1,
496
577
  errors: [
497
- n(
578
+ a(
498
579
  "invalid_recovery_plan",
499
580
  "Analytics recovery plan must be a structured object."
500
581
  )
@@ -508,9 +589,9 @@ function T(e) {
508
589
  ]
509
590
  };
510
591
  e.version !== 1 && i.push(
511
- n("invalid_version", "Recovery plan version must be 1.", "version")
592
+ a("invalid_version", "Recovery plan version must be 1.", "version")
512
593
  ), e.kind !== "analytics_recovery_plan" && i.push(
513
- n(
594
+ a(
514
595
  "invalid_recovery_plan_kind",
515
596
  "Recovery plan kind must be analytics_recovery_plan.",
516
597
  "kind"
@@ -518,7 +599,7 @@ function T(e) {
518
599
  );
519
600
  const r = q(e.operationIntent);
520
601
  return i.push(...r.errors), s.push(...r.warnings), Array.isArray(e.plannedToolCalls) || i.push(
521
- n(
602
+ a(
522
603
  "invalid_planned_tool_calls",
523
604
  "Recovery plan plannedToolCalls must be an array.",
524
605
  "plannedToolCalls"
@@ -536,7 +617,7 @@ function k(e) {
536
617
  recommendedNextStep: i.code === "missing_obligations" ? "Normalize the user request into one or more typed analytics obligations before recovery planning." : "Correct the operation/recovery contract shape before planning execution."
537
618
  }));
538
619
  }
539
- function x(e) {
620
+ function E(e) {
540
621
  return e.map((i) => {
541
622
  switch (i.code) {
542
623
  case "missing_source":
@@ -589,14 +670,14 @@ function x(e) {
589
670
  }
590
671
  }).filter((i) => !!i);
591
672
  }
592
- function F(e, i, s, r) {
673
+ function C(e, i, s, r) {
593
674
  if (!e || typeof e != "object") {
594
- s.push(n("invalid_view", "Dashboard view must be an object.", i));
675
+ s.push(a("invalid_view", "Dashboard view must be an object.", i));
595
676
  return;
596
677
  }
597
- if (d(e.title) || s.push(n("missing_view_title", "Dashboard view needs a title.", i)), !e.presentation || typeof e.presentation != "object") {
678
+ if (d(e.title) || s.push(a("missing_view_title", "Dashboard view needs a title.", i)), !e.presentation || typeof e.presentation != "object") {
598
679
  s.push(
599
- n(
680
+ a(
600
681
  "missing_presentation",
601
682
  "Dashboard view needs a presentation.",
602
683
  `${i}.presentation`
@@ -606,7 +687,7 @@ function F(e, i, s, r) {
606
687
  }
607
688
  if (e.presentation.kind === "text") {
608
689
  d(e.text) || r.push(
609
- n(
690
+ a(
610
691
  "missing_text_content",
611
692
  "Text views should include text content.",
612
693
  `${i}.text`
@@ -616,7 +697,7 @@ function F(e, i, s, r) {
616
697
  }
617
698
  if (!e.analytics) {
618
699
  s.push(
619
- n(
700
+ a(
620
701
  "missing_view_analytics",
621
702
  "Non-text dashboard views need analytics intent.",
622
703
  `${i}.analytics`
@@ -624,87 +705,87 @@ function F(e, i, s, r) {
624
705
  );
625
706
  return;
626
707
  }
627
- const o = g(e.analytics);
628
- for (const a of o.errors)
708
+ const o = A(e.analytics);
709
+ for (const n of o.errors)
629
710
  s.push(
630
- n(a.code, a.message, `${i}.analytics${a.path ? `.${a.path}` : ""}`)
711
+ a(n.code, n.message, `${i}.analytics${n.path ? `.${n.path}` : ""}`)
631
712
  );
632
- for (const a of o.warnings)
713
+ for (const n of o.warnings)
633
714
  r.push(
634
- n(
635
- a.code,
636
- a.message,
637
- `${i}.analytics${a.path ? `.${a.path}` : ""}`
715
+ a(
716
+ n.code,
717
+ n.message,
718
+ `${i}.analytics${n.path ? `.${n.path}` : ""}`
638
719
  )
639
720
  );
640
721
  }
641
- function B(e) {
722
+ function H(e) {
642
723
  const i = [], s = [];
643
724
  if (!e || typeof e != "object")
644
725
  return {
645
726
  ok: !1,
646
727
  errors: [
647
- n(
728
+ a(
648
729
  "invalid_dashboard_intent",
649
730
  "Dashboard intent must be a structured object."
650
731
  )
651
732
  ],
652
733
  warnings: s
653
734
  };
654
- e.version !== 1 && i.push(n("invalid_version", "Dashboard intent version must be 1.")), e.kind !== "dashboard" && i.push(n("invalid_kind", "Experience intent kind must be dashboard.")), d(e.title) || i.push(n("missing_title", "Dashboard intent needs a title.", "title"));
655
- const r = Array.isArray(e.inputs) ? e.inputs : [], o = h(
656
- r.filter(u).map((c) => c.id).filter((c) => typeof c == "string")
735
+ e.version !== 1 && i.push(a("invalid_version", "Dashboard intent version must be 1.")), e.kind !== "dashboard" && i.push(a("invalid_kind", "Experience intent kind must be dashboard.")), d(e.title) || i.push(a("missing_title", "Dashboard intent needs a title.", "title"));
736
+ const r = Array.isArray(e.inputs) ? e.inputs : [], o = v(
737
+ r.filter(c).map((u) => u.id).filter((u) => typeof u == "string")
657
738
  );
658
739
  o && i.push(
659
- n(
740
+ a(
660
741
  "duplicate_input_id",
661
742
  `Duplicate input id: ${o}.`,
662
743
  "inputs"
663
744
  )
664
745
  );
665
- for (const [c, l] of r.entries()) {
666
- const m = `inputs.${c}`;
667
- if (!u(l)) {
668
- i.push(n("invalid_input", "Dashboard input must be an object.", m));
746
+ for (const [u, l] of r.entries()) {
747
+ const m = `inputs.${u}`;
748
+ if (!c(l)) {
749
+ i.push(a("invalid_input", "Dashboard input must be an object.", m));
669
750
  continue;
670
751
  }
671
- d(l.id) || i.push(n("missing_input_id", "Input needs an id.", `${m}.id`)), d(l.label) || i.push(
672
- n("missing_input_label", "Input needs a label.", `${m}.label`)
752
+ d(l.id) || i.push(a("missing_input_id", "Input needs an id.", `${m}.id`)), d(l.label) || i.push(
753
+ a("missing_input_label", "Input needs a label.", `${m}.label`)
673
754
  ), !l.field || !d(l.field.name) ? i.push(
674
- n("missing_input_field", "Input needs a field.", `${m}.field`)
755
+ a("missing_input_field", "Input needs a field.", `${m}.field`)
675
756
  ) : f(l.field, `${m}.field`, i);
676
757
  }
677
- const a = Array.isArray(e.sections) ? e.sections : [];
678
- a.length === 0 && i.push(
679
- n(
758
+ const n = Array.isArray(e.sections) ? e.sections : [];
759
+ n.length === 0 && i.push(
760
+ a(
680
761
  "missing_sections",
681
762
  "Dashboard intent needs at least one section.",
682
763
  "sections"
683
764
  )
684
765
  );
685
- const t = a.flatMap(
686
- (c) => c && typeof c == "object" && Array.isArray(c.views) ? c.views.filter(u).map((l) => l.id).filter((l) => !!l) : []
687
- ), p = h(t);
766
+ const t = n.flatMap(
767
+ (u) => u && typeof u == "object" && Array.isArray(u.views) ? u.views.filter(c).map((l) => l.id).filter((l) => !!l) : []
768
+ ), p = v(t);
688
769
  p && i.push(
689
- n(
770
+ a(
690
771
  "duplicate_view_id",
691
772
  `Duplicate dashboard view id: ${p}.`,
692
773
  "sections"
693
774
  )
694
775
  );
695
- for (const [c, l] of a.entries()) {
696
- const m = `sections.${c}`;
776
+ for (const [u, l] of n.entries()) {
777
+ const m = `sections.${u}`;
697
778
  if (!l || typeof l != "object") {
698
779
  i.push(
699
- n("invalid_section", "Dashboard section must be an object.", m)
780
+ a("invalid_section", "Dashboard section must be an object.", m)
700
781
  );
701
782
  continue;
702
783
  }
703
784
  if (d(l.title) || i.push(
704
- n("missing_section_title", "Dashboard section needs a title.", m)
785
+ a("missing_section_title", "Dashboard section needs a title.", m)
705
786
  ), !Array.isArray(l.views) || l.views.length === 0) {
706
787
  i.push(
707
- n(
788
+ a(
708
789
  "missing_section_views",
709
790
  "Dashboard section needs at least one view.",
710
791
  `${m}.views`
@@ -712,9 +793,9 @@ function B(e) {
712
793
  );
713
794
  continue;
714
795
  }
715
- for (const [w, A] of l.views.entries())
716
- F(
717
- A,
796
+ for (const [w, I] of l.views.entries())
797
+ C(
798
+ I,
718
799
  `${m}.views.${w}`,
719
800
  i,
720
801
  s
@@ -724,12 +805,12 @@ function B(e) {
724
805
  }
725
806
  export {
726
807
  q as a,
727
- T as b,
728
- B as c,
729
- I as d,
730
- S as e,
731
- D as f,
732
- $ as p,
808
+ O as b,
809
+ H as c,
810
+ M as d,
811
+ $ as e,
812
+ P as f,
813
+ S as p,
733
814
  y as s,
734
- g as v
815
+ A as v
735
816
  };