react-semaphor 0.1.428 → 0.1.429

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 (96) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +72 -71
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +5 -4
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +1031 -622
  7. package/dist/chunks/analyze-result-contract-BswhsmWT.js +1 -0
  8. package/dist/chunks/{analyze-result-contract-DnfF8kBb.js → analyze-result-contract-CfOBEwaC.js} +681 -759
  9. package/dist/chunks/{code-editor-CojfM3qp.js → code-editor-C65eEYyU.js} +2980 -2960
  10. package/dist/chunks/code-editor-DOh3aYEh.js +138 -0
  11. package/dist/chunks/{comparison-document-migration-b6c3xiWh.js → comparison-document-migration-DbU_BTxR.js} +1 -1
  12. package/dist/chunks/{comparison-document-migration-BJH1idOd.js → comparison-document-migration-Dj6xZMCb.js} +2 -2
  13. package/dist/chunks/csv-utils-Co0WxHke.js +4 -0
  14. package/dist/chunks/csv-utils-suxSkJGj.js +376 -0
  15. package/dist/chunks/dashboard-CQfAvRYI.js +1401 -0
  16. package/dist/chunks/{dashboard-509sbC4_.js → dashboard-agBXhvKo.js} +47563 -44929
  17. package/dist/chunks/{dashboard-briefing-launcher-B-ZTWJwo.js → dashboard-briefing-launcher-CkH_pthg.js} +1 -1
  18. package/dist/chunks/{dashboard-briefing-launcher-DIdYHNTq.js → dashboard-briefing-launcher-gBNNKqoH.js} +100 -99
  19. package/dist/chunks/{dashboard-controls-CWprw-Pb.js → dashboard-controls-CAZnIGfT.js} +2 -2
  20. package/dist/chunks/{dashboard-controls-CbRzWo1N.js → dashboard-controls-CoIxUTvH.js} +114 -113
  21. package/dist/chunks/{dashboard-json-jO4GQfZk.js → dashboard-json-BMcPjL8-.js} +18 -17
  22. package/dist/chunks/dashboard-json-D4hFrMkX.js +1 -0
  23. package/dist/chunks/{edit-dashboard-visual-KgQTjqWp.js → edit-dashboard-visual-Bc8qNfSr.js} +8721 -8481
  24. package/dist/chunks/edit-dashboard-visual-onhUUXlw.js +182 -0
  25. package/dist/chunks/{metric-comparison-CWweq9RG.js → metric-comparison-CPoDx56y.js} +1 -1
  26. package/dist/chunks/{metric-comparison-BKgkMy9r.js → metric-comparison-DVy3fll_.js} +1 -1
  27. package/dist/chunks/numeric-presentation-CGTcqocU.js +517 -0
  28. package/dist/chunks/numeric-presentation-Dlb-Dk4c.js +1 -0
  29. package/dist/chunks/report-preferences-dialog-CPptr_V9.js +690 -0
  30. package/dist/chunks/report-preferences-dialog-DV_5aHrS.js +1 -0
  31. package/dist/chunks/source-identity-5OPV4gvg.js +92 -0
  32. package/dist/chunks/source-identity-Cbo2LOHQ.js +1 -0
  33. package/dist/chunks/{update-policy-CY2k-pJP.js → update-policy-De2NswtM.js} +1 -1
  34. package/dist/chunks/{update-policy-BgONreNd.js → update-policy-DnF_74zC.js} +1 -1
  35. package/dist/chunks/{use-create-flow-overlay-state-BiMYdjZP.js → use-create-flow-overlay-state-Bs6gqgjo.js} +1 -1
  36. package/dist/chunks/{use-create-flow-overlay-state-CGsLzp9A.js → use-create-flow-overlay-state-CgQbCrni.js} +97 -96
  37. package/dist/chunks/validators-B2vUAqTf.js +1 -0
  38. package/dist/chunks/{validators-Cz-XuORM.js → validators-Bce_J7Vd.js} +19 -13
  39. package/dist/dashboard/index.cjs +1 -1
  40. package/dist/dashboard/index.js +1 -1
  41. package/dist/dashboard-authoring/index.cjs +3 -3
  42. package/dist/dashboard-authoring/index.js +20 -19
  43. package/dist/data-app-builder/index.cjs +1 -1
  44. package/dist/data-app-builder/index.js +50 -50
  45. package/dist/data-app-codegen/index.cjs +1 -1
  46. package/dist/data-app-codegen/index.js +2 -2
  47. package/dist/data-app-codegen-node/index.cjs +1 -1
  48. package/dist/data-app-codegen-node/index.js +3 -3
  49. package/dist/data-app-sdk/index.cjs +2 -2
  50. package/dist/data-app-sdk/index.js +27 -26
  51. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  52. package/dist/data-app-sdk-adapters/index.js +25 -24
  53. package/dist/data-app-sdk-validation/index.cjs +1 -1
  54. package/dist/data-app-sdk-validation/index.js +57 -55
  55. package/dist/format-utils/index.cjs +2 -5
  56. package/dist/format-utils/index.js +136 -161
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.js +158 -155
  59. package/dist/report-runtime-context/index.cjs +1 -0
  60. package/dist/report-runtime-context/index.js +394 -0
  61. package/dist/style.css +1 -1
  62. package/dist/surfboard/index.cjs +1 -1
  63. package/dist/surfboard/index.js +7 -6
  64. package/dist/types/analytics-protocol.d.ts +0 -4
  65. package/dist/types/briefings.d.ts +216 -19
  66. package/dist/types/dashboard-assistant.d.ts +0 -2
  67. package/dist/types/dashboard-authoring.d.ts +34 -9
  68. package/dist/types/dashboard.d.ts +93 -9
  69. package/dist/types/data-app-builder.d.ts +0 -1
  70. package/dist/types/data-app-codegen-node.d.ts +6 -28
  71. package/dist/types/data-app-codegen.d.ts +6 -28
  72. package/dist/types/data-app-sdk-adapters.d.ts +6 -28
  73. package/dist/types/data-app-sdk-validation.d.ts +6 -29
  74. package/dist/types/data-app-sdk.d.ts +6 -31
  75. package/dist/types/format-utils.d.ts +128 -4
  76. package/dist/types/index.cjs +1 -1
  77. package/dist/types/index.js +10 -13
  78. package/dist/types/main.d.ts +249 -89
  79. package/dist/types/report-runtime-context.d.ts +99 -0
  80. package/dist/types/shared.d.ts +34 -9
  81. package/dist/types/surfboard.d.ts +119 -16
  82. package/dist/types/types.d.ts +156 -73
  83. package/dist/types/value-format-preferences.d.ts +126 -0
  84. package/dist/value-format-preferences/index.cjs +1 -0
  85. package/dist/value-format-preferences/index.js +635 -0
  86. package/package.json +11 -1
  87. package/dist/chunks/analyze-result-contract-ege_u6Nl.js +0 -1
  88. package/dist/chunks/calendar-preferences-dialog-BF9bNAF_.js +0 -457
  89. package/dist/chunks/calendar-preferences-dialog-_L9eBQfj.js +0 -1
  90. package/dist/chunks/code-editor-BoowcKU0.js +0 -138
  91. package/dist/chunks/dashboard-CMDXBLnG.js +0 -1402
  92. package/dist/chunks/dashboard-json-BEZrxx_k.js +0 -1
  93. package/dist/chunks/date-formatter-BTTYdAik.js +0 -1
  94. package/dist/chunks/date-formatter-D-89jTjG.js +0 -514
  95. package/dist/chunks/edit-dashboard-visual-D3uhqgm3.js +0 -182
  96. package/dist/chunks/validators-B4VMLX3_.js +0 -1
@@ -1,86 +1,6 @@
1
1
  import { z as e } from "zod";
2
- const we = "SUM";
3
- function b(s) {
4
- return typeof s == "string" && s.trim().length > 0;
5
- }
6
- function di(s) {
7
- return s ? s.kind === "semantic" ? !!(b(s.domainId) && (b(s.datasetId) || b(s.datasetName))) : s.kind === "physical" ? b(s.connectionId) && b(s.tableName) : b(s.connectionId) : !1;
8
- }
9
- function D(s) {
10
- return s ? s.kind === "semantic" ? [
11
- s.kind,
12
- s.domainId,
13
- s.datasetId ? `datasetId:${s.datasetId}` : `datasetName:${s.datasetName}`
14
- ].join(":") : s.kind === "physical" ? [
15
- s.kind,
16
- s.connectionId,
17
- s.databaseName || "",
18
- s.schemaName || "",
19
- s.tableName
20
- ].join(":") : [
21
- s.kind,
22
- s.connectionId,
23
- s.dialect || "",
24
- s.label || ""
25
- ].join(":") : "";
26
- }
27
- function ee(s, i) {
28
- return !s || !i ? s === i : s.kind !== i.kind ? !1 : s.kind === "semantic" && i.kind === "semantic" ? s.domainId !== i.domainId ? !1 : s.datasetId && i.datasetId ? s.datasetId === i.datasetId : s.datasetName === i.datasetName : D(s) === D(i);
29
- }
30
- function te(s, i) {
31
- return s.kind !== "semantic" || i.kind !== "semantic" ? s : {
32
- ...s,
33
- datasetName: s.datasetName || i.datasetName,
34
- datasetId: s.datasetId || i.datasetId,
35
- label: s.label || i.label,
36
- connectionId: s.connectionId || i.connectionId
37
- };
38
- }
39
- function ci(s) {
40
- const i = [];
41
- for (const t of s) {
42
- const o = i.findIndex(
43
- (n) => ee(n, t)
44
- );
45
- if (o === -1) {
46
- i.push(t);
47
- continue;
48
- }
49
- i[o] = te(
50
- i[o],
51
- t
52
- );
53
- }
54
- return i;
55
- }
56
- function pi(s, i) {
57
- return s.name === i.name && ee(s.source, i.source);
58
- }
59
- function ke(s) {
60
- return [
61
- s.source ? D(s.source) : "unknown",
62
- ie(s),
63
- s.name
64
- ].filter(Boolean).join(":");
65
- }
66
- function ie(s) {
67
- return Ie(
68
- s.aggregate || we
69
- );
70
- }
71
- function Ie(s) {
72
- return s.trim().toUpperCase();
73
- }
74
- function mi(s, i) {
75
- return {
76
- ...s,
77
- label: s.label || i.label,
78
- role: s.role || i.role,
79
- dataType: s.dataType || i.dataType,
80
- source: s.source && i.source ? te(s.source, i.source) : s.source || i.source
81
- };
82
- }
83
- const G = {
2
+ import { a as ye, e as be } from "./source-identity-5OPV4gvg.js";
3
+ const V = {
84
4
  answerSummary: "string",
85
5
  responseDetail: "responseDetail",
86
6
  mode: "string",
@@ -120,19 +40,19 @@ const G = {
120
40
  periodRows: "recordArray",
121
41
  sql: "unknown",
122
42
  omitted: "stringArray"
123
- }, O = "semaphor-data-app-codegen-summary/v1", gi = "semaphor-data-app-codegen-summary-validator/v2", Ae = /* @__PURE__ */ new Set([
43
+ }, D = "semaphor-data-app-codegen-summary/v1", ni = "semaphor-data-app-codegen-summary-validator/v2", ve = /* @__PURE__ */ new Set([
124
44
  "metric",
125
45
  "records",
126
46
  "matrix",
127
47
  "analysis",
128
48
  "sql_fallback"
129
- ]), _e = /* @__PURE__ */ new Set([
49
+ ]), $e = /* @__PURE__ */ new Set([
130
50
  "semaphor.metric",
131
51
  "semaphor.records",
132
52
  "semaphor.matrix",
133
53
  "semaphor.analysis",
134
54
  "semaphor.sql"
135
- ]), je = /* @__PURE__ */ new Set([
55
+ ]), Se = /* @__PURE__ */ new Set([
136
56
  "SUM",
137
57
  "COUNT",
138
58
  "AVG",
@@ -140,13 +60,13 @@ const G = {
140
60
  "MAX",
141
61
  "MEDIAN",
142
62
  "DISTINCT"
143
- ]), Re = /* @__PURE__ */ new Set([
63
+ ]), we = /* @__PURE__ */ new Set([
144
64
  "absolute_delta",
145
65
  "largest_negative",
146
66
  "largest_positive",
147
67
  "positive_and_negative",
148
68
  "all"
149
- ]), se = /* @__PURE__ */ new Set([
69
+ ]), J = /* @__PURE__ */ new Set([
150
70
  "source",
151
71
  "id",
152
72
  "label",
@@ -161,8 +81,8 @@ const G = {
161
81
  "relationshipHint",
162
82
  "limit",
163
83
  "derivedFields"
164
- ]), Ce = /* @__PURE__ */ new Set([
165
- ...se,
84
+ ]), ke = /* @__PURE__ */ new Set([
85
+ ...J,
166
86
  "analysis",
167
87
  "timeWindow",
168
88
  "filters",
@@ -171,7 +91,7 @@ const G = {
171
91
  "calendarContext",
172
92
  "chartTitle",
173
93
  "chartType"
174
- ]), qe = /* @__PURE__ */ new Set([
94
+ ]), Ie = /* @__PURE__ */ new Set([
175
95
  "source",
176
96
  "id",
177
97
  "label",
@@ -186,7 +106,7 @@ const G = {
186
106
  "pagination",
187
107
  "totals",
188
108
  "derivedFields"
189
- ]), xe = /* @__PURE__ */ new Set([
109
+ ]), Ae = /* @__PURE__ */ new Set([
190
110
  "source",
191
111
  "id",
192
112
  "label",
@@ -200,7 +120,7 @@ const G = {
200
120
  "expansion",
201
121
  "layout",
202
122
  "displayLimits"
203
- ]), Ee = /* @__PURE__ */ new Set([
123
+ ]), _e = /* @__PURE__ */ new Set([
204
124
  "source",
205
125
  "id",
206
126
  "label",
@@ -211,7 +131,7 @@ const G = {
211
131
  "limit",
212
132
  "pagination",
213
133
  "rationale"
214
- ]), Fe = /* @__PURE__ */ new Set([
134
+ ]), je = /* @__PURE__ */ new Set([
215
135
  "kpi",
216
136
  "line_chart",
217
137
  "bar_chart",
@@ -224,7 +144,7 @@ const G = {
224
144
  "narrative",
225
145
  "text_block",
226
146
  "custom"
227
- ]), Ne = /* @__PURE__ */ new Set([
147
+ ]), Re = /* @__PURE__ */ new Set([
228
148
  "missing_measure",
229
149
  "missing_dimension",
230
150
  "missing_date",
@@ -241,72 +161,72 @@ const G = {
241
161
  "requires_sql_escape_hatch",
242
162
  "unsupported_sdk_capability"
243
163
  ]);
244
- function fi(s) {
245
- return oe(s).ok;
164
+ function ri(o) {
165
+ return X(o).ok;
246
166
  }
247
- function oe(s) {
167
+ function X(o) {
248
168
  const i = [];
249
- if (!s || typeof s != "object")
169
+ if (!o || typeof o != "object")
250
170
  return { ok: !1, issues: ["Summary must be an object."] };
251
- const t = s;
252
- return t.schemaVersion !== O && i.push(
253
- `schemaVersion must be ${O}.`
171
+ const t = o;
172
+ return t.schemaVersion !== D && i.push(
173
+ `schemaVersion must be ${D}.`
254
174
  ), (typeof t.title != "string" || !t.title.trim()) && i.push("title is required."), Array.isArray(t.sources) || i.push("sources must be an array."), Array.isArray(t.inputs) || i.push("inputs must be an array."), Array.isArray(t.views) || i.push("views must be an array."), Array.isArray(t.filterContracts) || i.push("filterContracts must be an array."), (!t.implementationChecklist || typeof t.implementationChecklist != "object") && i.push("implementationChecklist must be an object."), t.implementationChecklist && typeof t.implementationChecklist == "object" && i.push(
255
- ...Te(t.implementationChecklist)
256
- ), Array.isArray(t.sources) && t.sources.forEach((o, n) => {
257
- i.push(...I(o, `sources.${n}`));
258
- }), Array.isArray(t.inputs) && t.inputs.forEach((o, n) => {
259
- i.push(...Me(o, `inputs.${n}`));
260
- }), Array.isArray(t.views) && t.views.forEach((o, n) => {
261
- i.push(...Be(o, `views.${n}`));
262
- }), Array.isArray(t.filterContracts) && t.filterContracts.forEach((o, n) => {
175
+ ...qe(t.implementationChecklist)
176
+ ), Array.isArray(t.sources) && t.sources.forEach((s, n) => {
177
+ i.push(...k(s, `sources.${n}`));
178
+ }), Array.isArray(t.inputs) && t.inputs.forEach((s, n) => {
179
+ i.push(...xe(s, `inputs.${n}`));
180
+ }), Array.isArray(t.views) && t.views.forEach((s, n) => {
181
+ i.push(...Ee(s, `views.${n}`));
182
+ }), Array.isArray(t.filterContracts) && t.filterContracts.forEach((s, n) => {
263
183
  i.push(
264
- ...Qe(o, `filterContracts.${n}`)
184
+ ...Ve(s, `filterContracts.${n}`)
265
185
  );
266
- }), t.unsupportedInsights !== void 0 && (Array.isArray(t.unsupportedInsights) ? t.unsupportedInsights.forEach((o, n) => {
186
+ }), t.unsupportedInsights !== void 0 && (Array.isArray(t.unsupportedInsights) ? t.unsupportedInsights.forEach((s, n) => {
267
187
  i.push(
268
- ...gt(
269
- o,
188
+ ...lt(
189
+ s,
270
190
  `unsupportedInsights.${n}`
271
191
  )
272
192
  );
273
- }) : i.push("unsupportedInsights must be an array.")), i.push(...Ke(t)), { ok: i.length === 0, issues: i };
193
+ }) : i.push("unsupportedInsights must be an array.")), i.push(...Ce(t)), { ok: i.length === 0, issues: i };
274
194
  }
275
- function Ke(s) {
276
- const i = Array.isArray(s.unsupportedInsights) && s.unsupportedInsights.some(
195
+ function Ce(o) {
196
+ const i = Array.isArray(o.unsupportedInsights) && o.unsupportedInsights.some(
277
197
  (u) => {
278
198
  var l;
279
- return Q.has((l = a(u)) == null ? void 0 : l.reason);
199
+ return z.has((l = a(u)) == null ? void 0 : l.reason);
280
200
  }
281
- ), t = Array.isArray(s.views) && s.views.some((u) => {
201
+ ), t = Array.isArray(o.views) && o.views.some((u) => {
282
202
  var d;
283
203
  const l = a((d = a(u)) == null ? void 0 : d.computation);
284
- return (l == null ? void 0 : l.kind) === "unsupported" && Q.has(l.reason);
204
+ return (l == null ? void 0 : l.kind) === "unsupported" && z.has(l.reason);
285
205
  });
286
206
  if (!i && !t)
287
207
  return [];
288
- const o = [], n = a(s.validation);
289
- (n == null ? void 0 : n.status) !== "blocked" && o.push(
208
+ const s = [], n = a(o.validation);
209
+ (n == null ? void 0 : n.status) !== "blocked" && s.push(
290
210
  "validation.status must be blocked when semantic model repair gaps are present."
291
211
  );
292
- const r = a(s.nextRequiredTool);
293
- return (r == null ? void 0 : r.name) !== "semaphor_propose_semantic_model_change" && o.push(
212
+ const r = a(o.nextRequiredTool);
213
+ return (r == null ? void 0 : r.name) !== "semaphor_propose_semantic_model_change" && s.push(
294
214
  "nextRequiredTool.name must be semaphor_propose_semantic_model_change when semantic model repair gaps are present."
295
- ), o;
215
+ ), s;
296
216
  }
297
- const Q = /* @__PURE__ */ new Set([
217
+ const z = /* @__PURE__ */ new Set([
298
218
  "missing_relationship",
299
219
  "raw_identifier_filter_options"
300
220
  ]);
301
- function I(s, i) {
302
- const t = a(s);
221
+ function k(o, i) {
222
+ const t = a(o);
303
223
  return t ? t.kind === "semantic" ? typeof t.domainId == "string" && t.domainId.trim() && typeof t.datasetName == "string" && t.datasetName.trim() ? [] : [`${i} must include sourceKey or a supported source identity.`] : typeof t.sourceKey == "string" && t.sourceKey.trim() ? [] : t.kind === "physical" && typeof t.tableName == "string" && t.tableName.trim() && typeof t.connectionId == "string" && t.connectionId.trim() ? [] : t.kind === "sql" && typeof t.connectionId == "string" && t.connectionId.trim() ? [] : [`${i} must include sourceKey or a supported source identity.`] : [`${i} must be an object.`];
304
224
  }
305
- function Te(s) {
306
- const i = a(s);
225
+ function qe(o) {
226
+ const i = a(o);
307
227
  if (!i)
308
228
  return ["implementationChecklist must be an object."];
309
- const t = [], o = [
229
+ const t = [], s = [
310
230
  "requiredDevtools",
311
231
  "requiredInputOptions",
312
232
  "filterScopeByInput",
@@ -314,7 +234,7 @@ function Te(s) {
314
234
  "validationCommands",
315
235
  "browserSmokeChecks"
316
236
  ];
317
- for (const r of o)
237
+ for (const r of s)
318
238
  r in i || t.push(`implementationChecklist.${r} is required.`);
319
239
  const n = a(i.requiredDevtools);
320
240
  return n ? typeof n.mountRootDevtools != "boolean" && t.push(
@@ -327,62 +247,62 @@ function Te(s) {
327
247
  "implementationChecklist.browserSmokeChecks must be an array of strings."
328
248
  ), t;
329
249
  }
330
- function Me(s, i) {
331
- const t = a(s);
250
+ function xe(o, i) {
251
+ const t = a(o);
332
252
  if (!t)
333
253
  return [`${i} must be an object.`];
334
- const o = [];
335
- return (typeof t.id != "string" || !t.id.trim()) && o.push(`${i}.id is required.`), t.fieldRef && o.push(...c(t.fieldRef, `${i}.fieldRef`)), o.push(...re(t.optionQuery, `${i}.optionQuery`)), g(t.appliesToViewIds) || o.push(`${i}.appliesToViewIds must be an array of strings.`), t.bindings !== void 0 && !Array.isArray(t.bindings) && o.push(`${i}.bindings must be an array.`), Array.isArray(t.bindings) && t.bindings.forEach((n, r) => {
254
+ const s = [];
255
+ return (typeof t.id != "string" || !t.id.trim()) && s.push(`${i}.id is required.`), t.fieldRef && s.push(...c(t.fieldRef, `${i}.fieldRef`)), s.push(...te(t.optionQuery, `${i}.optionQuery`)), g(t.appliesToViewIds) || s.push(`${i}.appliesToViewIds must be an array of strings.`), t.bindings !== void 0 && !Array.isArray(t.bindings) && s.push(`${i}.bindings must be an array.`), Array.isArray(t.bindings) && t.bindings.forEach((n, r) => {
336
256
  const u = a(n);
337
257
  if (!u) {
338
- o.push(`${i}.bindings.${r} must be an object.`);
258
+ s.push(`${i}.bindings.${r} must be an object.`);
339
259
  return;
340
260
  }
341
- g(u.appliesToViewIds) || o.push(
261
+ g(u.appliesToViewIds) || s.push(
342
262
  `${i}.bindings.${r}.appliesToViewIds must be an array of strings.`
343
- ), o.push(
263
+ ), s.push(
344
264
  ...c(
345
265
  u.fieldRef,
346
266
  `${i}.bindings.${r}.fieldRef`
347
267
  )
348
268
  );
349
- }), o;
269
+ }), s;
350
270
  }
351
- function Be(s, i) {
352
- const t = a(s);
271
+ function Ee(o, i) {
272
+ const t = a(o);
353
273
  if (!t)
354
274
  return [`${i} must be an object.`];
355
- const o = [];
356
- if ((typeof t.id != "string" || !t.id.trim()) && o.push(`${i}.id is required.`), t.visualSpec !== void 0 && o.push(...at(t.visualSpec, `${i}.visualSpec`)), t.computation !== void 0 && o.push(...mt(t.computation, `${i}.computation`)), rt(t))
357
- return o.push(...N(t, `${i}`)), t.fields !== void 0 && (Array.isArray(t.fields) ? t.fields.forEach((d, y) => {
358
- o.push(...c(d, `${i}.fields.${y}`));
359
- }) : o.push(`${i}.fields must be an array.`)), t.queryKind !== void 0 && o.push(`${i}.queryKind is not allowed for non-executable views.`), t.sdkBuilder !== void 0 && o.push(`${i}.sdkBuilder is not allowed for non-executable views.`), t.sdkSpec !== void 0 && o.push(`${i}.sdkSpec is not allowed for non-executable views.`), o;
275
+ const s = [];
276
+ if ((typeof t.id != "string" || !t.id.trim()) && s.push(`${i}.id is required.`), t.visualSpec !== void 0 && s.push(...tt(t.visualSpec, `${i}.visualSpec`)), t.computation !== void 0 && s.push(...at(t.computation, `${i}.computation`)), et(t))
277
+ return s.push(...F(t, `${i}`)), t.fields !== void 0 && (Array.isArray(t.fields) ? t.fields.forEach((d, y) => {
278
+ s.push(...c(d, `${i}.fields.${y}`));
279
+ }) : s.push(`${i}.fields must be an array.`)), t.queryKind !== void 0 && s.push(`${i}.queryKind is not allowed for non-executable views.`), t.sdkBuilder !== void 0 && s.push(`${i}.sdkBuilder is not allowed for non-executable views.`), t.sdkSpec !== void 0 && s.push(`${i}.sdkSpec is not allowed for non-executable views.`), s;
360
280
  if (!Array.isArray(t.fields))
361
- return o.push(`${i}.fields must be an array.`), (t.sdkSpec !== void 0 || t.sdkBuilder !== void 0) && o.push(`${i}.fields must be an array for executable views.`), o.push(...N(t, `${i}`)), o;
281
+ return s.push(`${i}.fields must be an array.`), (t.sdkSpec !== void 0 || t.sdkBuilder !== void 0) && s.push(`${i}.fields must be an array for executable views.`), s.push(...F(t, `${i}`)), s;
362
282
  t.fields.forEach((d, y) => {
363
- o.push(...c(d, `${i}.fields.${y}`));
364
- }), w(t.queryKind) || o.push(`${i}.queryKind must be a supported codegen query kind.`), t.sdkBuilder !== void 0 && !ue(t.sdkBuilder) && o.push(`${i}.sdkBuilder must be a supported SDK builder.`), t.metricBindingKeys !== void 0 && (Array.isArray(t.metricBindingKeys) ? t.metricBindingKeys.some(
283
+ s.push(...c(d, `${i}.fields.${y}`));
284
+ }), S(t.queryKind) || s.push(`${i}.queryKind must be a supported codegen query kind.`), t.sdkBuilder !== void 0 && !oe(t.sdkBuilder) && s.push(`${i}.sdkBuilder must be a supported SDK builder.`), t.metricBindingKeys !== void 0 && (Array.isArray(t.metricBindingKeys) ? t.metricBindingKeys.some(
365
285
  (d) => typeof d != "string" || d.trim().length === 0
366
- ) && o.push(`${i}.metricBindingKeys must be an array of strings.`) : o.push(`${i}.metricBindingKeys must be an array of strings.`));
286
+ ) && s.push(`${i}.metricBindingKeys must be an array of strings.`) : s.push(`${i}.metricBindingKeys must be an array of strings.`));
367
287
  const n = a(t.sdkSpec), r = (n == null ? void 0 : n.builder) === "semaphor.metric";
368
- r && (!Array.isArray(t.metricBindingKeys) || t.metricBindingKeys.length === 0) && o.push(`${i}.metricBindingKeys is required for metric views.`);
369
- const u = De(t);
370
- r && Array.isArray(t.metricBindingKeys) && u && JSON.stringify(t.metricBindingKeys) !== JSON.stringify(u) && o.push(
288
+ r && (!Array.isArray(t.metricBindingKeys) || t.metricBindingKeys.length === 0) && s.push(`${i}.metricBindingKeys is required for metric views.`);
289
+ const u = Fe(t);
290
+ r && Array.isArray(t.metricBindingKeys) && u && JSON.stringify(t.metricBindingKeys) !== JSON.stringify(u) && s.push(
371
291
  `${i}.metricBindingKeys must match the generated metric field binding keys in order.`
372
292
  );
373
293
  const l = a(t.computation);
374
- return (l == null ? void 0 : l.kind) === "server_query" && w(t.queryKind) && w(l.queryKind) && l.queryKind !== t.queryKind && o.push(`${i}.computation.queryKind must match queryKind.`), o.push(
375
- ...Ye({
294
+ return (l == null ? void 0 : l.kind) === "server_query" && S(t.queryKind) && S(l.queryKind) && l.queryKind !== t.queryKind && s.push(`${i}.computation.queryKind must match queryKind.`), s.push(
295
+ ...Le({
376
296
  value: t.sdkSpec,
377
297
  path: `${i}.sdkSpec`,
378
298
  queryKind: typeof t.queryKind == "string" ? t.queryKind : void 0,
379
299
  sdkBuilder: typeof t.sdkBuilder == "string" ? t.sdkBuilder : void 0
380
300
  }),
381
- ...N(t, `${i}`)
382
- ), o;
301
+ ...F(t, `${i}`)
302
+ ), s;
383
303
  }
384
- function De(s) {
385
- const i = a(s.sdkSpec);
304
+ function Fe(o) {
305
+ const i = a(o.sdkSpec);
386
306
  if ((i == null ? void 0 : i.builder) !== "semaphor.metric")
387
307
  return;
388
308
  const t = a(i.spec);
@@ -391,31 +311,31 @@ function De(s) {
391
311
  const n = [
392
312
  t.primaryMeasure,
393
313
  ...Array.isArray(t.measures) ? t.measures : []
394
- ].map(Oe).filter(
314
+ ].map(Ke).filter(
395
315
  (r) => !!r
396
316
  );
397
317
  return Array.from(
398
318
  new Map(n.map((r) => [r.identity, r.bindingKey])).values()
399
319
  );
400
320
  }
401
- function Oe(s) {
402
- const i = a(s);
321
+ function Ke(o) {
322
+ const i = a(o);
403
323
  if (!i || typeof i.name != "string" || !i.name.trim())
404
324
  return;
405
- const t = Pe(i);
325
+ const t = Ne(i);
406
326
  return t ? {
407
327
  identity: JSON.stringify({
408
328
  source: t,
409
329
  name: i.name,
410
- aggregate: ne(i)
330
+ aggregate: ee(i)
411
331
  }),
412
- bindingKey: Ve(i)
332
+ bindingKey: Te(i)
413
333
  } : void 0;
414
334
  }
415
- function Pe(s) {
416
- if (typeof s.sourceKey == "string" && s.sourceKey.trim())
417
- return { sourceKey: s.sourceKey };
418
- const i = a(s.source);
335
+ function Ne(o) {
336
+ if (typeof o.sourceKey == "string" && o.sourceKey.trim())
337
+ return { sourceKey: o.sourceKey };
338
+ const i = a(o.source);
419
339
  if (i)
420
340
  return {
421
341
  kind: i.kind,
@@ -425,21 +345,21 @@ function Pe(s) {
425
345
  name: i.name
426
346
  };
427
347
  }
428
- function Ve(s) {
429
- return typeof s.sourceKey == "string" && s.sourceKey.trim() ? [
430
- s.sourceKey,
431
- ne(s),
432
- s.name
433
- ].filter(Boolean).join(":") : ke(s);
348
+ function Te(o) {
349
+ return typeof o.sourceKey == "string" && o.sourceKey.trim() ? [
350
+ o.sourceKey,
351
+ ee(o),
352
+ o.name
353
+ ].filter(Boolean).join(":") : be(o);
434
354
  }
435
- function ne(s) {
436
- return ie(
437
- s
355
+ function ee(o) {
356
+ return ye(
357
+ o
438
358
  );
439
359
  }
440
- function N(s, i) {
360
+ function F(o, i) {
441
361
  var y;
442
- const t = a((y = a(s.visualSpec)) == null ? void 0 : y.tableBehavior), o = a(s.sdkSpec), n = a(o == null ? void 0 : o.spec), r = typeof (o == null ? void 0 : o.builder) == "string" ? o.builder : void 0, u = r === "semaphor.records" ? a(n == null ? void 0 : n.totals) : void 0, l = [];
362
+ const t = a((y = a(o.visualSpec)) == null ? void 0 : y.tableBehavior), s = a(o.sdkSpec), n = a(s == null ? void 0 : s.spec), r = typeof (s == null ? void 0 : s.builder) == "string" ? s.builder : void 0, u = r === "semaphor.records" ? a(n == null ? void 0 : n.totals) : void 0, l = [];
443
363
  if (!t)
444
364
  return u && l.push(
445
365
  `${i}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`
@@ -450,7 +370,7 @@ function N(s, i) {
450
370
  ), !u || u.mode !== "server" ? l.push(
451
371
  `${i}.sdkSpec.spec.totals.mode must be server when tableBehavior.totals.mode is server.`
452
372
  ) : l.push(
453
- ...Le({
373
+ ...Oe({
454
374
  left: d.measures,
455
375
  right: u.measures,
456
376
  leftPath: `${i}.visualSpec.tableBehavior.totals.measures`,
@@ -464,83 +384,83 @@ function N(s, i) {
464
384
  `${i}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`
465
385
  ), l);
466
386
  }
467
- function Le({
468
- left: s,
387
+ function Oe({
388
+ left: o,
469
389
  right: i,
470
390
  leftPath: t,
471
- rightPath: o
391
+ rightPath: s
472
392
  }) {
473
- if (!Array.isArray(s) || !Array.isArray(i))
474
- return [`${o} must match ${t}.`];
393
+ if (!Array.isArray(o) || !Array.isArray(i))
394
+ return [`${s} must match ${t}.`];
475
395
  const n = [];
476
- return s.length !== i.length ? (n.push(`${o} must match ${t}.`), n) : (s.forEach((r, u) => {
477
- Ge(
396
+ return o.length !== i.length ? (n.push(`${s} must match ${t}.`), n) : (o.forEach((r, u) => {
397
+ De(
478
398
  a(r),
479
399
  a(i[u])
480
- ) || n.push(`${o}.${u} must match ${t}.${u}.`);
400
+ ) || n.push(`${s}.${u} must match ${t}.${u}.`);
481
401
  }), n);
482
402
  }
483
- function Ge(s, i) {
484
- return !s || !i ? !1 : s.name === i.name && (s.role || "measure") === (i.role || "measure") && Y(s) === Y(i) && Ue(s, i);
403
+ function De(o, i) {
404
+ return !o || !i ? !1 : o.name === i.name && (o.role || "measure") === (i.role || "measure") && H(o) === H(i) && Me(o, i);
485
405
  }
486
- function Y(s) {
487
- return typeof s.aggregate == "string" ? s.aggregate.toUpperCase() : "SUM";
406
+ function H(o) {
407
+ return typeof o.aggregate == "string" ? o.aggregate.toUpperCase() : "SUM";
488
408
  }
489
- function Ue(s, i) {
490
- const t = a(s.source), o = a(i.source);
491
- if (ze(t, o))
409
+ function Me(o, i) {
410
+ const t = a(o.source), s = a(i.source);
411
+ if (Be(t, s))
492
412
  return !1;
493
- const n = J(s), r = J(i);
413
+ const n = Q(o), r = Q(i);
494
414
  if (n.size > 0 || r.size > 0) {
495
415
  for (const u of n)
496
416
  if (r.has(u))
497
417
  return !0;
498
418
  return !1;
499
419
  }
500
- return !t || !o || t.kind !== o.kind ? !1 : t.kind === "semantic" ? t.domainId === o.domainId && t.datasetName === o.datasetName && (t.datasetId === void 0 || o.datasetId === void 0 || t.datasetId === o.datasetId) : t.kind === "physical" ? t.connectionId === o.connectionId && t.tableName === o.tableName : t.kind === "sql" ? t.connectionId === o.connectionId : !1;
420
+ return !t || !s || t.kind !== s.kind ? !1 : t.kind === "semantic" ? t.domainId === s.domainId && t.datasetName === s.datasetName && (t.datasetId === void 0 || s.datasetId === void 0 || t.datasetId === s.datasetId) : t.kind === "physical" ? t.connectionId === s.connectionId && t.tableName === s.tableName : t.kind === "sql" ? t.connectionId === s.connectionId : !1;
501
421
  }
502
- function ze(s, i) {
503
- if (!s || !i || s.kind !== "semantic" || i.kind !== "semantic")
422
+ function Be(o, i) {
423
+ if (!o || !i || o.kind !== "semantic" || i.kind !== "semantic")
504
424
  return !1;
505
- const t = typeof s.datasetId == "string" ? s.datasetId.trim() : "", o = typeof i.datasetId == "string" ? i.datasetId.trim() : "";
506
- return !!(t && o && t !== o);
425
+ const t = typeof o.datasetId == "string" ? o.datasetId.trim() : "", s = typeof i.datasetId == "string" ? i.datasetId.trim() : "";
426
+ return !!(t && s && t !== s);
507
427
  }
508
- function J(s) {
509
- const i = typeof s.sourceKey == "string" ? s.sourceKey.trim() : "";
510
- return i ? /* @__PURE__ */ new Set([i]) : He(a(s.source));
428
+ function Q(o) {
429
+ const i = typeof o.sourceKey == "string" ? o.sourceKey.trim() : "";
430
+ return i ? /* @__PURE__ */ new Set([i]) : Pe(a(o.source));
511
431
  }
512
- function He(s) {
432
+ function Pe(o) {
513
433
  const i = /* @__PURE__ */ new Set();
514
- if (!s)
434
+ if (!o)
515
435
  return i;
516
- const t = typeof s.sourceKey == "string" ? s.sourceKey.trim() : "";
517
- if (t && i.add(t), s.kind === "semantic") {
518
- const o = typeof s.domainId == "string" ? s.domainId : "", n = typeof s.datasetName == "string" ? s.datasetName : "", r = typeof s.datasetId == "string" ? s.datasetId : "";
519
- o && r && i.add(`semantic:${o}:datasetId:${r}`), o && n && i.add(`semantic:${o}:datasetName:${n}`);
436
+ const t = typeof o.sourceKey == "string" ? o.sourceKey.trim() : "";
437
+ if (t && i.add(t), o.kind === "semantic") {
438
+ const s = typeof o.domainId == "string" ? o.domainId : "", n = typeof o.datasetName == "string" ? o.datasetName : "", r = typeof o.datasetId == "string" ? o.datasetId : "";
439
+ s && r && i.add(`semantic:${s}:datasetId:${r}`), s && n && i.add(`semantic:${s}:datasetName:${n}`);
520
440
  }
521
- if (s.kind === "physical") {
522
- const o = typeof s.connectionId == "string" ? s.connectionId : "", n = typeof s.tableName == "string" ? s.tableName : "", r = typeof s.databaseName == "string" ? s.databaseName : "", u = typeof s.schemaName == "string" ? s.schemaName : "";
523
- o && n && (i.add(
524
- ["physical", o, r, u, n].join(":")
525
- ), i.add(`physical:${o}:${n}`));
441
+ if (o.kind === "physical") {
442
+ const s = typeof o.connectionId == "string" ? o.connectionId : "", n = typeof o.tableName == "string" ? o.tableName : "", r = typeof o.databaseName == "string" ? o.databaseName : "", u = typeof o.schemaName == "string" ? o.schemaName : "";
443
+ s && n && (i.add(
444
+ ["physical", s, r, u, n].join(":")
445
+ ), i.add(`physical:${s}:${n}`));
526
446
  }
527
- if (s.kind === "sql") {
528
- const o = typeof s.connectionId == "string" ? s.connectionId : "", n = typeof s.dialect == "string" ? s.dialect : "", r = typeof s.label == "string" ? s.label : "";
529
- o && (i.add(["sql", o, n, r].join(":")), i.add(`sql:${o}`));
447
+ if (o.kind === "sql") {
448
+ const s = typeof o.connectionId == "string" ? o.connectionId : "", n = typeof o.dialect == "string" ? o.dialect : "", r = typeof o.label == "string" ? o.label : "";
449
+ s && (i.add(["sql", s, n, r].join(":")), i.add(`sql:${s}`));
530
450
  }
531
451
  return i;
532
452
  }
533
- function Qe(s, i) {
534
- const t = a(s);
453
+ function Ve(o, i) {
454
+ const t = a(o);
535
455
  if (!t)
536
456
  return [`${i} must be an object.`];
537
- const o = [];
538
- if (t.fieldRef && o.push(
457
+ const s = [];
458
+ if (t.fieldRef && s.push(
539
459
  ...c(t.fieldRef, `${i}.fieldRef`)
540
- ), (typeof t.inputId != "string" || !t.inputId.trim()) && o.push(`${i}.inputId is required.`), o.push(
541
- ...re(t.optionQuery, `${i}.optionQuery`)
542
- ), g(t.appliesToViewIds) || o.push(`${i}.appliesToViewIds must be an array of strings.`), g(t.notAppliedToViewIds) || o.push(`${i}.notAppliedToViewIds must be an array of strings.`), !Array.isArray(t.bindings))
543
- o.push(`${i}.bindings must be an array.`);
460
+ ), (typeof t.inputId != "string" || !t.inputId.trim()) && s.push(`${i}.inputId is required.`), s.push(
461
+ ...te(t.optionQuery, `${i}.optionQuery`)
462
+ ), g(t.appliesToViewIds) || s.push(`${i}.appliesToViewIds must be an array of strings.`), g(t.notAppliedToViewIds) || s.push(`${i}.notAppliedToViewIds must be an array of strings.`), !Array.isArray(t.bindings))
463
+ s.push(`${i}.bindings must be an array.`);
544
464
  else {
545
465
  const n = g(t.appliesToViewIds) ? new Set(t.appliesToViewIds) : void 0, r = g(
546
466
  t.notAppliedToViewIds
@@ -548,14 +468,14 @@ function Qe(s, i) {
548
468
  t.bindings.forEach((u, l) => {
549
469
  const d = a(u);
550
470
  if (!d) {
551
- o.push(`${i}.bindings.${l} must be an object.`);
471
+ s.push(`${i}.bindings.${l} must be an object.`);
552
472
  return;
553
473
  }
554
- typeof d.viewId != "string" || !d.viewId ? o.push(`${i}.bindings.${l}.viewId is required.`) : (n && !n.has(d.viewId) && o.push(
474
+ typeof d.viewId != "string" || !d.viewId ? s.push(`${i}.bindings.${l}.viewId is required.`) : (n && !n.has(d.viewId) && s.push(
555
475
  `${i}.bindings.${l}.viewId must be included in appliesToViewIds.`
556
- ), r != null && r.has(d.viewId) && o.push(
476
+ ), r != null && r.has(d.viewId) && s.push(
557
477
  `${i}.bindings.${l}.viewId must not be listed in notAppliedToViewIds.`
558
- )), o.push(
478
+ )), s.push(
559
479
  ...c(
560
480
  d.fieldRef,
561
481
  `${i}.bindings.${l}.fieldRef`
@@ -563,15 +483,15 @@ function Qe(s, i) {
563
483
  );
564
484
  });
565
485
  }
566
- return o;
486
+ return s;
567
487
  }
568
- function re(s, i) {
569
- if (s === void 0)
488
+ function te(o, i) {
489
+ if (o === void 0)
570
490
  return [];
571
- const t = a(s);
491
+ const t = a(o);
572
492
  if (!t)
573
493
  return [`${i} must be an object.`];
574
- const o = [
494
+ const s = [
575
495
  ...f(
576
496
  t.valueFieldRef,
577
497
  `${i}.valueFieldRef`
@@ -585,156 +505,156 @@ function re(s, i) {
585
505
  `${i}.filterFieldRef`
586
506
  )
587
507
  ];
588
- return t.builder !== "semaphor.inputOptions" && o.push(`${i}.builder must be semaphor.inputOptions.`), typeof t.sourceKey != "string" && t.source === void 0 && o.push(`${i} must include source or sourceKey.`), t.source !== void 0 && o.push(...I(t.source, `${i}.source`)), a(t.valueFieldRef) || o.push(`${i}.valueFieldRef is required.`), a(t.labelFieldRef) || o.push(`${i}.labelFieldRef is required.`), t.limit !== void 0 && (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit <= 0) && o.push(`${i}.limit must be a positive integer.`), o;
508
+ return t.builder !== "semaphor.inputOptions" && s.push(`${i}.builder must be semaphor.inputOptions.`), typeof t.sourceKey != "string" && t.source === void 0 && s.push(`${i} must include source or sourceKey.`), t.source !== void 0 && s.push(...k(t.source, `${i}.source`)), a(t.valueFieldRef) || s.push(`${i}.valueFieldRef is required.`), a(t.labelFieldRef) || s.push(`${i}.labelFieldRef is required.`), t.limit !== void 0 && (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit <= 0) && s.push(`${i}.limit must be a positive integer.`), s;
589
509
  }
590
- function Ye(s) {
510
+ function Le(o) {
591
511
  var n;
592
- const i = a(s.value);
512
+ const i = a(o.value);
593
513
  if (!i)
594
- return [`${s.path} is required for executable views.`];
514
+ return [`${o.path} is required for executable views.`];
595
515
  const t = [];
596
- if (!ue(i.builder))
597
- return t.push(`${s.path}.builder must be a supported SDK builder.`), t;
598
- s.sdkBuilder && i.builder !== s.sdkBuilder && t.push(`${s.path}.builder must match sdkBuilder.`), s.queryKind && w(s.queryKind) && i.builder !== nt(s.queryKind) && t.push(`${s.path}.builder must match queryKind.`);
599
- const o = a(i.spec);
600
- if (!o)
601
- return t.push(`${s.path}.spec must be an object.`), t;
516
+ if (!oe(i.builder))
517
+ return t.push(`${o.path}.builder must be a supported SDK builder.`), t;
518
+ o.sdkBuilder && i.builder !== o.sdkBuilder && t.push(`${o.path}.builder must match sdkBuilder.`), o.queryKind && S(o.queryKind) && i.builder !== Xe(o.queryKind) && t.push(`${o.path}.builder must match queryKind.`);
519
+ const s = a(i.spec);
520
+ if (!s)
521
+ return t.push(`${o.path}.spec must be an object.`), t;
602
522
  switch (i.builder) {
603
523
  case "semaphor.metric":
604
524
  t.push(
605
- ...S(o, se, `${s.path}.spec`),
606
- ...j(o, s.path),
607
- ...K(o.measures, `${s.path}.spec.measures`),
525
+ ...$(s, J, `${o.path}.spec`),
526
+ ..._(s, o.path),
527
+ ...K(s.measures, `${o.path}.spec.measures`),
608
528
  ...f(
609
- o.primaryMeasure,
610
- `${s.path}.spec.primaryMeasure`
529
+ s.primaryMeasure,
530
+ `${o.path}.spec.primaryMeasure`
611
531
  ),
612
532
  ...f(
613
- o.dateField,
614
- `${s.path}.spec.dateField`
533
+ s.dateField,
534
+ `${o.path}.spec.dateField`
615
535
  ),
616
- ...T(
617
- o.dimensions,
618
- `${s.path}.spec.dimensions`
536
+ ...N(
537
+ s.dimensions,
538
+ `${o.path}.spec.dimensions`
619
539
  ),
620
- ...M(o.orderBy, `${s.path}.spec.orderBy`),
621
- ...R(o.filters, `${s.path}.spec.filters`)
540
+ ...T(s.orderBy, `${o.path}.spec.orderBy`),
541
+ ...j(s.filters, `${o.path}.spec.filters`)
622
542
  );
623
543
  break;
624
544
  case "semaphor.analysis":
625
545
  t.push(
626
- ...S(o, Ce, `${s.path}.spec`),
627
- ...j(o, s.path),
628
- ...K(o.measures, `${s.path}.spec.measures`),
546
+ ...$(s, ke, `${o.path}.spec`),
547
+ ..._(s, o.path),
548
+ ...K(s.measures, `${o.path}.spec.measures`),
629
549
  ...f(
630
- o.primaryMeasure,
631
- `${s.path}.spec.primaryMeasure`
550
+ s.primaryMeasure,
551
+ `${o.path}.spec.primaryMeasure`
632
552
  ),
633
553
  ...f(
634
- o.dateField,
635
- `${s.path}.spec.dateField`
554
+ s.dateField,
555
+ `${o.path}.spec.dateField`
636
556
  ),
637
- ...T(
638
- o.dimensions,
639
- `${s.path}.spec.dimensions`
557
+ ...N(
558
+ s.dimensions,
559
+ `${o.path}.spec.dimensions`
640
560
  ),
641
- ...M(o.orderBy, `${s.path}.spec.orderBy`),
642
- ...R(o.filters, `${s.path}.spec.filters`),
643
- ...We(o, `${s.path}.spec`)
561
+ ...T(s.orderBy, `${o.path}.spec.orderBy`),
562
+ ...j(s.filters, `${o.path}.spec.filters`),
563
+ ...Ue(s, `${o.path}.spec`)
644
564
  );
645
565
  break;
646
566
  case "semaphor.records":
647
567
  t.push(
648
- ...S(o, qe, `${s.path}.spec`),
649
- ...j(o, s.path),
650
- ...K(o.fields, `${s.path}.spec.fields`),
568
+ ...$(s, Ie, `${o.path}.spec`),
569
+ ..._(s, o.path),
570
+ ...K(s.fields, `${o.path}.spec.fields`),
651
571
  ...f(
652
- o.dateField,
653
- `${s.path}.spec.dateField`
572
+ s.dateField,
573
+ `${o.path}.spec.dateField`
654
574
  ),
655
- ...M(o.orderBy, `${s.path}.spec.orderBy`),
656
- ...R(o.filters, `${s.path}.spec.filters`),
657
- ...Xe(
658
- o.totals,
659
- `${s.path}.spec.totals`
575
+ ...T(s.orderBy, `${o.path}.spec.orderBy`),
576
+ ...j(s.filters, `${o.path}.spec.filters`),
577
+ ...ze(
578
+ s.totals,
579
+ `${o.path}.spec.totals`
660
580
  )
661
581
  );
662
582
  break;
663
583
  case "semaphor.matrix":
664
584
  t.push(
665
- ...S(o, xe, `${s.path}.spec`),
666
- ...Ze(o, s.path),
667
- ...et(o.rows, `${s.path}.spec.rows`),
668
- ...tt(
669
- o.columns,
670
- `${s.path}.spec.columns`
585
+ ...$(s, Ae, `${o.path}.spec`),
586
+ ...He(s, o.path),
587
+ ...Qe(s.rows, `${o.path}.spec.rows`),
588
+ ...Ye(
589
+ s.columns,
590
+ `${o.path}.spec.columns`
671
591
  ),
672
- ...it(o.values, `${s.path}.spec.values`),
673
- ...st(o.sort, `${s.path}.spec.sort`),
674
- ...R(o.filters, `${s.path}.spec.filters`),
675
- ...Je(
676
- o.displayLimits,
677
- `${s.path}.spec.displayLimits`
592
+ ...We(s.values, `${o.path}.spec.values`),
593
+ ...Ze(s.sort, `${o.path}.spec.sort`),
594
+ ...j(s.filters, `${o.path}.spec.filters`),
595
+ ...Ge(
596
+ s.displayLimits,
597
+ `${o.path}.spec.displayLimits`
678
598
  )
679
599
  );
680
600
  break;
681
601
  case "semaphor.sql":
682
602
  t.push(
683
- ...S(o, Ee, `${s.path}.spec`),
684
- ...j(o, s.path)
685
- ), ((n = a(o.source)) == null ? void 0 : n.kind) !== "sql" && t.push(`${s.path}.spec.source.kind must be sql.`), (typeof o.sql != "string" || !o.sql.trim()) && t.push(`${s.path}.spec.sql is required.`), t.push(
686
- ...T(
687
- o.fields,
688
- `${s.path}.spec.fields`
603
+ ...$(s, _e, `${o.path}.spec`),
604
+ ..._(s, o.path)
605
+ ), ((n = a(s.source)) == null ? void 0 : n.kind) !== "sql" && t.push(`${o.path}.spec.source.kind must be sql.`), (typeof s.sql != "string" || !s.sql.trim()) && t.push(`${o.path}.spec.sql is required.`), t.push(
606
+ ...N(
607
+ s.fields,
608
+ `${o.path}.spec.fields`
689
609
  )
690
610
  );
691
611
  break;
692
612
  }
693
613
  return t;
694
614
  }
695
- function Je(s, i) {
696
- if (s === void 0)
615
+ function Ge(o, i) {
616
+ if (o === void 0)
697
617
  return [];
698
- const t = a(s);
618
+ const t = a(o);
699
619
  if (!t)
700
620
  return [`${i} must be an object.`];
701
- const o = [];
702
- o.push(
703
- ...W(t.rows, `${i}.rows`),
704
- ...W(
621
+ const s = [];
622
+ s.push(
623
+ ...Y(t.rows, `${i}.rows`),
624
+ ...Y(
705
625
  t.columns,
706
626
  `${i}.columns`
707
627
  )
708
628
  );
709
629
  for (const n of Object.keys(t))
710
- n === "rows" || n === "columns" || o.push(`${i}.${n} is not supported.`);
711
- return o;
630
+ n === "rows" || n === "columns" || s.push(`${i}.${n} is not supported.`);
631
+ return s;
712
632
  }
713
- function W(s, i) {
714
- if (s === void 0)
633
+ function Y(o, i) {
634
+ if (o === void 0)
715
635
  return [];
716
- const t = a(s);
636
+ const t = a(o);
717
637
  if (!t)
718
638
  return [`${i} must be an object.`];
719
- const o = [];
720
- (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit < 1) && o.push(`${i}.limit must be a positive integer.`);
639
+ const s = [];
640
+ (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit < 1) && s.push(`${i}.limit must be a positive integer.`);
721
641
  for (const n of Object.keys(t))
722
- n !== "limit" && o.push(
642
+ n !== "limit" && s.push(
723
643
  `${i}.${n} is not supported; matrix display limits are count-only in v1.`
724
644
  );
725
- return o;
645
+ return s;
726
646
  }
727
- function We(s, i) {
647
+ function Ue(o, i) {
728
648
  const t = [];
729
- if (s.driverMode !== void 0 && !Re.has(s.driverMode) && t.push(`${i}.driverMode must be a supported analysis driver mode.`), s.includePopulation !== void 0 && typeof s.includePopulation != "boolean" && t.push(`${i}.includePopulation must be a boolean.`), s.calendarContext !== void 0) {
730
- const o = a(s.calendarContext);
731
- if (!o)
649
+ if (o.driverMode !== void 0 && !we.has(o.driverMode) && t.push(`${i}.driverMode must be a supported analysis driver mode.`), o.includePopulation !== void 0 && typeof o.includePopulation != "boolean" && t.push(`${i}.includePopulation must be a boolean.`), o.calendarContext !== void 0) {
650
+ const s = a(o.calendarContext);
651
+ if (!s)
732
652
  t.push(`${i}.calendarContext must be an object.`);
733
653
  else {
734
- o.tz !== void 0 && typeof o.tz != "string" && t.push(`${i}.calendarContext.tz must be a string.`), o.weekStart !== void 0 && (typeof o.weekStart != "number" || !Number.isInteger(o.weekStart) || o.weekStart < 0 || o.weekStart > 6) && t.push(
654
+ s.tz !== void 0 && typeof s.tz != "string" && t.push(`${i}.calendarContext.tz must be a string.`), s.weekStart !== void 0 && (typeof s.weekStart != "number" || !Number.isInteger(s.weekStart) || s.weekStart < 0 || s.weekStart > 6) && t.push(
735
655
  `${i}.calendarContext.weekStart must be an integer between 0 and 6.`
736
656
  );
737
- const n = o.anchor;
657
+ const n = s.anchor;
738
658
  if (n !== void 0 && n !== "now") {
739
659
  const r = a(n);
740
660
  (!r || typeof r.iso != "string" || !r.iso.trim()) && t.push(`${i}.calendarContext.anchor must be now or { iso }.`);
@@ -743,68 +663,68 @@ function We(s, i) {
743
663
  }
744
664
  return t;
745
665
  }
746
- function Xe(s, i) {
747
- if (s === void 0)
666
+ function ze(o, i) {
667
+ if (o === void 0)
748
668
  return [];
749
- const t = a(s);
669
+ const t = a(o);
750
670
  if (!t)
751
671
  return [`${i} must be an object.`];
752
- const o = [];
753
- return t.mode !== "server" && o.push(`${i}.mode must be server.`), !Array.isArray(t.measures) || t.measures.length === 0 ? o.push(`${i}.measures must include at least one measure.`) : t.measures.forEach((n, r) => {
672
+ const s = [];
673
+ return t.mode !== "server" && s.push(`${i}.mode must be server.`), !Array.isArray(t.measures) || t.measures.length === 0 ? s.push(`${i}.measures must include at least one measure.`) : t.measures.forEach((n, r) => {
754
674
  var u;
755
- o.push(
756
- ...de(
675
+ s.push(
676
+ ...ne(
757
677
  n,
758
678
  `${i}.measures.${r}`
759
679
  )
760
- ), ((u = a(n)) == null ? void 0 : u.role) !== "measure" && o.push(`${i}.measures.${r}.role must be measure.`);
761
- }), o;
680
+ ), ((u = a(n)) == null ? void 0 : u.role) !== "measure" && s.push(`${i}.measures.${r}.role must be measure.`);
681
+ }), s;
762
682
  }
763
- function S(s, i, t) {
764
- const o = [];
765
- return Object.keys(s).forEach((n) => {
766
- i.has(n) || o.push(`${t}.${n} is not supported for this SDK builder.`);
767
- }), o;
683
+ function $(o, i, t) {
684
+ const s = [];
685
+ return Object.keys(o).forEach((n) => {
686
+ i.has(n) || s.push(`${t}.${n} is not supported for this SDK builder.`);
687
+ }), s;
768
688
  }
769
- function j(s, i) {
770
- return a(s.source) ? I(s.source, `${i}.spec.source`) : [`${i}.spec.source must be an object.`];
689
+ function _(o, i) {
690
+ return a(o.source) ? k(o.source, `${i}.spec.source`) : [`${i}.spec.source must be an object.`];
771
691
  }
772
- function Ze(s, i) {
773
- const t = a(s.source);
692
+ function He(o, i) {
693
+ const t = a(o.source);
774
694
  if (!t)
775
695
  return [`${i}.spec.source must be an object.`];
776
- const o = I(s.source, `${i}.spec.source`);
777
- return t.kind !== "semantic" && t.kind !== "physical" && o.push(`${i}.spec.source.kind must be semantic or physical.`), o;
696
+ const s = k(o.source, `${i}.spec.source`);
697
+ return t.kind !== "semantic" && t.kind !== "physical" && s.push(`${i}.spec.source.kind must be semantic or physical.`), s;
778
698
  }
779
- function K(s, i) {
780
- const t = U(s, i);
781
- return Array.isArray(s) && s.forEach((o, n) => {
782
- t.push(...c(o, `${i}.${n}`));
699
+ function K(o, i) {
700
+ const t = L(o, i);
701
+ return Array.isArray(o) && o.forEach((s, n) => {
702
+ t.push(...c(s, `${i}.${n}`));
783
703
  }), t;
784
704
  }
785
- function T(s, i) {
786
- if (s === void 0)
705
+ function N(o, i) {
706
+ if (o === void 0)
787
707
  return [];
788
- if (!Array.isArray(s))
708
+ if (!Array.isArray(o))
789
709
  return [`${i} must be an array.`];
790
710
  const t = [];
791
- return s.forEach((o, n) => {
792
- t.push(...c(o, `${i}.${n}`));
711
+ return o.forEach((s, n) => {
712
+ t.push(...c(s, `${i}.${n}`));
793
713
  }), t;
794
714
  }
795
- function M(s, i) {
796
- if (s === void 0)
715
+ function T(o, i) {
716
+ if (o === void 0)
797
717
  return [];
798
- const t = a(s);
718
+ const t = a(o);
799
719
  return t ? [
800
720
  ...c(t.field, `${i}.field`),
801
- ...ae(t.direction, `${i}.direction`)
721
+ ...ie(t.direction, `${i}.direction`)
802
722
  ] : [`${i} must be an object.`];
803
723
  }
804
- function et(s, i) {
805
- const t = U(s, i);
806
- return Array.isArray(s) && s.forEach((o, n) => {
807
- const r = a(o);
724
+ function Qe(o, i) {
725
+ const t = L(o, i);
726
+ return Array.isArray(o) && o.forEach((s, n) => {
727
+ const r = a(s);
808
728
  if (!r) {
809
729
  t.push(`${i}.${n} must be an object.`);
810
730
  return;
@@ -814,12 +734,12 @@ function et(s, i) {
814
734
  );
815
735
  }), t;
816
736
  }
817
- function tt(s, i) {
818
- if (s === void 0)
737
+ function Ye(o, i) {
738
+ if (o === void 0)
819
739
  return [];
820
740
  const t = [];
821
- return Array.isArray(s) ? (s.forEach((o, n) => {
822
- const r = a(o);
741
+ return Array.isArray(o) ? (o.forEach((s, n) => {
742
+ const r = a(s);
823
743
  if (!r) {
824
744
  t.push(`${i}.${n} must be an object.`);
825
745
  return;
@@ -829,10 +749,10 @@ function tt(s, i) {
829
749
  );
830
750
  }), t) : [`${i} must be an array.`];
831
751
  }
832
- function it(s, i) {
833
- const t = U(s, i);
834
- return Array.isArray(s) && s.forEach((o, n) => {
835
- const r = a(o);
752
+ function We(o, i) {
753
+ const t = L(o, i);
754
+ return Array.isArray(o) && o.forEach((s, n) => {
755
+ const r = a(s);
836
756
  if (!r) {
837
757
  t.push(`${i}.${n} must be an object.`);
838
758
  return;
@@ -842,26 +762,26 @@ function it(s, i) {
842
762
  );
843
763
  }), t;
844
764
  }
845
- function st(s, i) {
846
- if (s === void 0)
765
+ function Ze(o, i) {
766
+ if (o === void 0)
847
767
  return [];
848
- if (!Array.isArray(s))
768
+ if (!Array.isArray(o))
849
769
  return [`${i} must be an array.`];
850
770
  const t = [];
851
- return s.forEach((o, n) => {
852
- const r = a(o);
771
+ return o.forEach((s, n) => {
772
+ const r = a(s);
853
773
  if (!r) {
854
774
  t.push(`${i}.${n} must be an object.`);
855
775
  return;
856
776
  }
857
777
  r.axis !== "row" && r.axis !== "column" && t.push(`${i}.${n}.axis must be row or column.`), t.push(
858
- ...ae(r.direction, `${i}.${n}.direction`),
859
- ...ot(r.by, `${i}.${n}.by`)
778
+ ...ie(r.direction, `${i}.${n}.direction`),
779
+ ...Je(r.by, `${i}.${n}.by`)
860
780
  );
861
781
  }), t;
862
782
  }
863
- function ot(s, i) {
864
- const t = a(s);
783
+ function Je(o, i) {
784
+ const t = a(o);
865
785
  if (!t)
866
786
  return [`${i} must be an object.`];
867
787
  switch (t.kind) {
@@ -875,17 +795,17 @@ function ot(s, i) {
875
795
  return [`${i}.kind must be label, field, or value.`];
876
796
  }
877
797
  }
878
- function ae(s, i) {
879
- return s === "asc" || s === "desc" ? [] : [`${i} must be asc or desc.`];
798
+ function ie(o, i) {
799
+ return o === "asc" || o === "desc" ? [] : [`${i} must be asc or desc.`];
880
800
  }
881
- function R(s, i) {
882
- if (s === void 0)
801
+ function j(o, i) {
802
+ if (o === void 0)
883
803
  return [];
884
- if (!Array.isArray(s))
804
+ if (!Array.isArray(o))
885
805
  return [`${i} must be an array.`];
886
806
  const t = [];
887
- return s.forEach((o, n) => {
888
- const r = a(o);
807
+ return o.forEach((s, n) => {
808
+ const r = a(s);
889
809
  if (!r) {
890
810
  t.push(`${i}.${n} must be an object.`);
891
811
  return;
@@ -893,11 +813,11 @@ function R(s, i) {
893
813
  t.push(...c(r.field, `${i}.${n}.field`));
894
814
  }), t;
895
815
  }
896
- function U(s, i) {
897
- return !Array.isArray(s) || s.length === 0 ? [`${i} must be a non-empty array.`] : [];
816
+ function L(o, i) {
817
+ return !Array.isArray(o) || o.length === 0 ? [`${i} must be a non-empty array.`] : [];
898
818
  }
899
- function nt(s) {
900
- switch (s) {
819
+ function Xe(o) {
820
+ switch (o) {
901
821
  case "metric":
902
822
  return "semaphor.metric";
903
823
  case "records":
@@ -910,124 +830,124 @@ function nt(s) {
910
830
  return "semaphor.sql";
911
831
  }
912
832
  }
913
- function rt(s) {
914
- const i = a(s.computation), t = a(s.visualSpec);
915
- return (i == null ? void 0 : i.kind) === "presentation_only" || (i == null ? void 0 : i.kind) === "derived" || (i == null ? void 0 : i.kind) === "unsupported" || s.visual === "text_block" || (t == null ? void 0 : t.visualType) === "text_block";
833
+ function et(o) {
834
+ const i = a(o.computation), t = a(o.visualSpec);
835
+ return (i == null ? void 0 : i.kind) === "presentation_only" || (i == null ? void 0 : i.kind) === "derived" || (i == null ? void 0 : i.kind) === "unsupported" || o.visual === "text_block" || (t == null ? void 0 : t.visualType) === "text_block";
916
836
  }
917
- function at(s, i) {
918
- const t = a(s);
837
+ function tt(o, i) {
838
+ const t = a(o);
919
839
  if (!t)
920
840
  return [`${i} must be an object.`];
921
- const o = [];
922
- return Fe.has(t.visualType) || o.push(`${i}.visualType must be a supported visual type.`), t.limit !== void 0 && (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit <= 0) && o.push(`${i}.limit must be a positive integer.`), t.tableBehavior !== void 0 && o.push(
923
- ...lt(
841
+ const s = [];
842
+ return je.has(t.visualType) || s.push(`${i}.visualType must be a supported visual type.`), t.limit !== void 0 && (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit <= 0) && s.push(`${i}.limit must be a positive integer.`), t.tableBehavior !== void 0 && s.push(
843
+ ...it(
924
844
  t.tableBehavior,
925
845
  `${i}.tableBehavior`
926
846
  )
927
- ), o;
847
+ ), s;
928
848
  }
929
- function lt(s, i) {
930
- const t = a(s);
849
+ function it(o, i) {
850
+ const t = a(o);
931
851
  if (!t)
932
852
  return [`${i} must be an object.`];
933
- const o = [];
934
- return t.tableMode !== "bounded" && t.tableMode !== "server_paginated" && t.tableMode !== "server_windowed" && o.push(`${i}.tableMode must be a supported table mode.`), o.push(
935
- ...ut(t.height, `${i}.height`),
936
- ...dt(t.pagination, `${i}.pagination`),
937
- ...ct(t.sorting, `${i}.sorting`),
938
- ...pt(t.totals, `${i}.totals`)
939
- ), typeof t.serverSideRequired != "boolean" && o.push(`${i}.serverSideRequired must be a boolean.`), o;
940
- }
941
- function ut(s, i) {
942
- const t = a(s);
853
+ const s = [];
854
+ return t.tableMode !== "bounded" && t.tableMode !== "server_paginated" && t.tableMode !== "server_windowed" && s.push(`${i}.tableMode must be a supported table mode.`), s.push(
855
+ ...st(t.height, `${i}.height`),
856
+ ...ot(t.pagination, `${i}.pagination`),
857
+ ...nt(t.sorting, `${i}.sorting`),
858
+ ...rt(t.totals, `${i}.totals`)
859
+ ), typeof t.serverSideRequired != "boolean" && s.push(`${i}.serverSideRequired must be a boolean.`), s;
860
+ }
861
+ function st(o, i) {
862
+ const t = a(o);
943
863
  if (!t)
944
864
  return [`${i} must be an object.`];
945
- const o = [];
946
- return (typeof t.maxPx != "number" || !Number.isInteger(t.maxPx) || t.maxPx <= 0) && o.push(`${i}.maxPx must be a positive integer.`), t.scroll !== "vertical" && t.scroll !== "both" && o.push(`${i}.scroll must be vertical or both.`), typeof t.stickyHeader != "boolean" && o.push(`${i}.stickyHeader must be a boolean.`), o;
865
+ const s = [];
866
+ return (typeof t.maxPx != "number" || !Number.isInteger(t.maxPx) || t.maxPx <= 0) && s.push(`${i}.maxPx must be a positive integer.`), t.scroll !== "vertical" && t.scroll !== "both" && s.push(`${i}.scroll must be vertical or both.`), typeof t.stickyHeader != "boolean" && s.push(`${i}.stickyHeader must be a boolean.`), s;
947
867
  }
948
- function dt(s, i) {
949
- const t = a(s);
868
+ function ot(o, i) {
869
+ const t = a(o);
950
870
  if (!t)
951
871
  return [`${i} must be an object.`];
952
- const o = [];
953
- return t.mode !== "none" && t.mode !== "server" && t.mode !== "client_for_bounded_rows" && o.push(`${i}.mode must be a supported pagination mode.`), t.pageSize !== void 0 && (typeof t.pageSize != "number" || !Number.isInteger(t.pageSize) || t.pageSize <= 0) && o.push(`${i}.pageSize must be a positive integer.`), t.readsFrom !== void 0 && t.readsFrom !== "result.pagination" && o.push(`${i}.readsFrom must be result.pagination.`), o;
872
+ const s = [];
873
+ return t.mode !== "none" && t.mode !== "server" && t.mode !== "client_for_bounded_rows" && s.push(`${i}.mode must be a supported pagination mode.`), t.pageSize !== void 0 && (typeof t.pageSize != "number" || !Number.isInteger(t.pageSize) || t.pageSize <= 0) && s.push(`${i}.pageSize must be a positive integer.`), t.readsFrom !== void 0 && t.readsFrom !== "result.pagination" && s.push(`${i}.readsFrom must be result.pagination.`), s;
954
874
  }
955
- function ct(s, i) {
956
- const t = a(s);
875
+ function nt(o, i) {
876
+ const t = a(o);
957
877
  if (!t)
958
878
  return [`${i} must be an object.`];
959
- const o = [];
960
- return t.mode !== "server" && t.mode !== "client_for_bounded_rows" && o.push(`${i}.mode must be a supported sorting mode.`), t.defaultField !== void 0 && (typeof t.defaultField != "string" || !t.defaultField.trim()) && o.push(`${i}.defaultField must be a non-empty string.`), t.defaultDirection !== void 0 && t.defaultDirection !== "asc" && t.defaultDirection !== "desc" && o.push(`${i}.defaultDirection must be asc or desc.`), t.resetPageOnChange !== void 0 && typeof t.resetPageOnChange != "boolean" && o.push(`${i}.resetPageOnChange must be a boolean.`), o;
879
+ const s = [];
880
+ return t.mode !== "server" && t.mode !== "client_for_bounded_rows" && s.push(`${i}.mode must be a supported sorting mode.`), t.defaultField !== void 0 && (typeof t.defaultField != "string" || !t.defaultField.trim()) && s.push(`${i}.defaultField must be a non-empty string.`), t.defaultDirection !== void 0 && t.defaultDirection !== "asc" && t.defaultDirection !== "desc" && s.push(`${i}.defaultDirection must be asc or desc.`), t.resetPageOnChange !== void 0 && typeof t.resetPageOnChange != "boolean" && s.push(`${i}.resetPageOnChange must be a boolean.`), s;
961
881
  }
962
- function pt(s, i) {
963
- const t = a(s);
882
+ function rt(o, i) {
883
+ const t = a(o);
964
884
  if (!t)
965
885
  return [`${i} must be an object.`];
966
- const o = [];
967
- return t.mode !== "none" && t.mode !== "server" && t.mode !== "local" ? (o.push(`${i}.mode must be none, server, or local.`), o) : t.mode === "none" ? (t.measures !== void 0 && o.push(`${i}.measures is not allowed when mode is none.`), t.label !== void 0 && o.push(`${i}.label is not allowed when mode is none.`), o) : t.mode === "server" ? (!Array.isArray(t.measures) || t.measures.length === 0 ? o.push(`${i}.measures must include at least one measure when mode is server.`) : t.measures.forEach((n, r) => {
886
+ const s = [];
887
+ return t.mode !== "none" && t.mode !== "server" && t.mode !== "local" ? (s.push(`${i}.mode must be none, server, or local.`), s) : t.mode === "none" ? (t.measures !== void 0 && s.push(`${i}.measures is not allowed when mode is none.`), t.label !== void 0 && s.push(`${i}.label is not allowed when mode is none.`), s) : t.mode === "server" ? (!Array.isArray(t.measures) || t.measures.length === 0 ? s.push(`${i}.measures must include at least one measure when mode is server.`) : t.measures.forEach((n, r) => {
968
888
  var u;
969
- o.push(
970
- ...de(
889
+ s.push(
890
+ ...ne(
971
891
  n,
972
892
  `${i}.measures.${r}`
973
893
  )
974
- ), ((u = a(n)) == null ? void 0 : u.role) !== "measure" && o.push(`${i}.measures.${r}.role must be measure.`);
975
- }), t.label !== void 0 && o.push(`${i}.label is not allowed when mode is server.`), o) : (t.mode === "local" && (t.label !== "Displayed rows" && t.label !== "Current page" && o.push(`${i}.label must be Displayed rows or Current page when mode is local.`), t.measures !== void 0 && o.push(`${i}.measures is not allowed when mode is local.`)), o);
894
+ ), ((u = a(n)) == null ? void 0 : u.role) !== "measure" && s.push(`${i}.measures.${r}.role must be measure.`);
895
+ }), t.label !== void 0 && s.push(`${i}.label is not allowed when mode is server.`), s) : (t.mode === "local" && (t.label !== "Displayed rows" && t.label !== "Current page" && s.push(`${i}.label must be Displayed rows or Current page when mode is local.`), t.measures !== void 0 && s.push(`${i}.measures is not allowed when mode is local.`)), s);
976
896
  }
977
- function mt(s, i) {
978
- const t = a(s);
897
+ function at(o, i) {
898
+ const t = a(o);
979
899
  if (!t)
980
900
  return [`${i} must be an object.`];
981
- const o = [];
901
+ const s = [];
982
902
  switch (t.kind) {
983
903
  case "server_query":
984
- w(t.queryKind) || o.push(`${i}.queryKind must be a supported codegen query kind.`), t.queryOwnership !== void 0 && t.queryOwnership !== "view_owned" && t.queryOwnership !== "shared_query" && o.push(
904
+ S(t.queryKind) || s.push(`${i}.queryKind must be a supported codegen query kind.`), t.queryOwnership !== void 0 && t.queryOwnership !== "view_owned" && t.queryOwnership !== "shared_query" && s.push(
985
905
  `${i}.queryOwnership must be view_owned or shared_query.`
986
- ), t.sourceKeys !== void 0 && !g(t.sourceKeys) && o.push(`${i}.sourceKeys must be an array of strings.`), t.fieldNames !== void 0 && !g(t.fieldNames) && o.push(`${i}.fieldNames must be an array of strings.`);
906
+ ), t.sourceKeys !== void 0 && !g(t.sourceKeys) && s.push(`${i}.sourceKeys must be an array of strings.`), t.fieldNames !== void 0 && !g(t.fieldNames) && s.push(`${i}.fieldNames must be an array of strings.`);
987
907
  break;
988
908
  case "derived":
989
- (typeof t.upstreamViewId != "string" || !t.upstreamViewId.trim()) && o.push(`${i}.upstreamViewId is required.`), (typeof t.derivation != "string" || !t.derivation.trim()) && o.push(`${i}.derivation is required.`);
909
+ (typeof t.upstreamViewId != "string" || !t.upstreamViewId.trim()) && s.push(`${i}.upstreamViewId is required.`), (typeof t.derivation != "string" || !t.derivation.trim()) && s.push(`${i}.derivation is required.`);
990
910
  break;
991
911
  case "presentation_only":
992
912
  break;
993
913
  case "unsupported":
994
- (typeof t.reason != "string" || !t.reason.trim()) && o.push(`${i}.reason is required.`), (typeof t.suggestedModelingFix != "string" || !t.suggestedModelingFix.trim()) && o.push(`${i}.suggestedModelingFix is required.`);
914
+ (typeof t.reason != "string" || !t.reason.trim()) && s.push(`${i}.reason is required.`), (typeof t.suggestedModelingFix != "string" || !t.suggestedModelingFix.trim()) && s.push(`${i}.suggestedModelingFix is required.`);
995
915
  break;
996
916
  default:
997
- o.push(`${i}.kind must be a supported computation kind.`);
917
+ s.push(`${i}.kind must be a supported computation kind.`);
998
918
  }
999
- return o;
919
+ return s;
1000
920
  }
1001
- function gt(s, i) {
1002
- const t = a(s);
921
+ function lt(o, i) {
922
+ const t = a(o);
1003
923
  if (!t)
1004
924
  return [`${i} must be an object.`];
1005
- const o = [];
925
+ const s = [];
1006
926
  for (const r of ["title", "requestedQuestion", "suggestedModelingFix"])
1007
- (typeof t[r] != "string" || !t[r].trim()) && o.push(`${i}.${r} is required.`);
1008
- return Ne.has(t.reason) || o.push(`${i}.reason must be a supported unsupported insight reason.`), (t.relationshipCandidate !== void 0 || t.nextRepairAction !== void 0) && t.reason !== "missing_relationship" && o.push(
927
+ (typeof t[r] != "string" || !t[r].trim()) && s.push(`${i}.${r} is required.`);
928
+ return Re.has(t.reason) || s.push(`${i}.reason must be a supported unsupported insight reason.`), (t.relationshipCandidate !== void 0 || t.nextRepairAction !== void 0) && t.reason !== "missing_relationship" && s.push(
1009
929
  `${i} relationship repair metadata is only valid for missing_relationship unsupported insights.`
1010
- ), t.diagnostic !== void 0 && o.push(
1011
- ...ft(
930
+ ), t.diagnostic !== void 0 && s.push(
931
+ ...ut(
1012
932
  t.diagnostic,
1013
933
  `${i}.diagnostic`,
1014
934
  t.reason
1015
935
  )
1016
- ), t.relationshipCandidate !== void 0 && o.push(
1017
- ...yt(
936
+ ), t.relationshipCandidate !== void 0 && s.push(
937
+ ...ct(
1018
938
  t.relationshipCandidate,
1019
939
  `${i}.relationshipCandidate`
1020
940
  )
1021
- ), t.nextRepairAction !== void 0 && o.push(
1022
- ...ht(
941
+ ), t.nextRepairAction !== void 0 && s.push(
942
+ ...dt(
1023
943
  t.nextRepairAction,
1024
944
  `${i}.nextRepairAction`
1025
945
  )
1026
- ), o;
946
+ ), s;
1027
947
  }
1028
- function ft(s, i, t) {
1029
- const o = a(s);
1030
- if (!o)
948
+ function ut(o, i, t) {
949
+ const s = a(o);
950
+ if (!s)
1031
951
  return [`${i} must be an object.`];
1032
952
  const n = [], r = /* @__PURE__ */ new Set([
1033
953
  "kind",
@@ -1037,23 +957,23 @@ function ft(s, i, t) {
1037
957
  "optionField",
1038
958
  "missingEvidence"
1039
959
  ]);
1040
- Object.keys(o).forEach((l) => {
960
+ Object.keys(s).forEach((l) => {
1041
961
  r.has(l) || n.push(
1042
962
  `${i}.${l} is not supported; raw identifier diagnostics support only kind, inputId, inputLabel, optionSource, optionField, and missingEvidence.`
1043
963
  );
1044
964
  }), t !== "raw_identifier_filter_options" && n.push(
1045
965
  `${i} is only valid for raw_identifier_filter_options unsupported insights.`
1046
- ), o.kind !== "raw_identifier_filter_options" && n.push(`${i}.kind must be raw_identifier_filter_options.`);
966
+ ), s.kind !== "raw_identifier_filter_options" && n.push(`${i}.kind must be raw_identifier_filter_options.`);
1047
967
  for (const l of ["inputId", "inputLabel"])
1048
- (typeof o[l] != "string" || !o[l].trim()) && n.push(`${i}.${l} must be a non-empty string.`);
968
+ (typeof s[l] != "string" || !s[l].trim()) && n.push(`${i}.${l} must be a non-empty string.`);
1049
969
  n.push(
1050
- ...P(
1051
- o.optionSource,
970
+ ...M(
971
+ s.optionSource,
1052
972
  `${i}.optionSource`
1053
973
  )
1054
974
  ), n.push(
1055
- ...le(
1056
- o.optionField,
975
+ ...se(
976
+ s.optionField,
1057
977
  `${i}.optionField`
1058
978
  )
1059
979
  );
@@ -1061,73 +981,73 @@ function ft(s, i, t) {
1061
981
  "display_field",
1062
982
  "relationship_display_path"
1063
983
  ]);
1064
- return !Array.isArray(o.missingEvidence) || o.missingEvidence.length === 0 ? n.push(`${i}.missingEvidence must be a non-empty evidence array.`) : o.missingEvidence.forEach((l, d) => {
984
+ return !Array.isArray(s.missingEvidence) || s.missingEvidence.length === 0 ? n.push(`${i}.missingEvidence must be a non-empty evidence array.`) : s.missingEvidence.forEach((l, d) => {
1065
985
  u.has(l) || n.push(
1066
986
  `${i}.missingEvidence.${d} must be display_field or relationship_display_path.`
1067
987
  );
1068
988
  }), n;
1069
989
  }
1070
- function ht(s, i) {
1071
- const t = a(s);
990
+ function dt(o, i) {
991
+ const t = a(o);
1072
992
  if (!t)
1073
993
  return [`${i} must be an object.`];
1074
- const o = [], n = /* @__PURE__ */ new Set(["tool", "reason"]);
994
+ const s = [], n = /* @__PURE__ */ new Set(["tool", "reason"]);
1075
995
  return Object.keys(t).forEach((r) => {
1076
- n.has(r) || o.push(
996
+ n.has(r) || s.push(
1077
997
  `${i}.${r} is not supported; repair actions support only tool and reason.`
1078
998
  );
1079
- }), t.tool !== "semaphor_propose_semantic_model_change" && o.push(
999
+ }), t.tool !== "semaphor_propose_semantic_model_change" && s.push(
1080
1000
  `${i}.tool must be semaphor_propose_semantic_model_change.`
1081
- ), t.reason !== "missing_relationship" && o.push(`${i}.reason must be missing_relationship.`), o;
1001
+ ), t.reason !== "missing_relationship" && s.push(`${i}.reason must be missing_relationship.`), s;
1082
1002
  }
1083
- function yt(s, i) {
1084
- const t = a(s);
1003
+ function ct(o, i) {
1004
+ const t = a(o);
1085
1005
  if (!t)
1086
1006
  return [`${i} must be an object.`];
1087
- const o = [], n = /* @__PURE__ */ new Set(["source", "sourceFields", "target", "targetFields"]);
1007
+ const s = [], n = /* @__PURE__ */ new Set(["source", "sourceFields", "target", "targetFields"]);
1088
1008
  Object.keys(t).forEach((r) => {
1089
- n.has(r) || o.push(
1009
+ n.has(r) || s.push(
1090
1010
  `${i}.${r} is not supported; relationship candidates support only source, sourceFields, target, and targetFields.`
1091
1011
  );
1092
- }), o.push(
1093
- ...P(t.source, `${i}.source`)
1094
- ), o.push(
1095
- ...P(t.target, `${i}.target`)
1012
+ }), s.push(
1013
+ ...M(t.source, `${i}.source`)
1014
+ ), s.push(
1015
+ ...M(t.target, `${i}.target`)
1096
1016
  );
1097
1017
  for (const r of ["sourceFields", "targetFields"]) {
1098
1018
  const u = t[r];
1099
1019
  if (!Array.isArray(u) || u.length === 0) {
1100
- o.push(`${i}.${r} must be a non-empty endpoint field array.`);
1020
+ s.push(`${i}.${r} must be a non-empty endpoint field array.`);
1101
1021
  continue;
1102
1022
  }
1103
1023
  u.forEach((l, d) => {
1104
- o.push(
1105
- ...le(l, `${i}.${r}.${d}`)
1024
+ s.push(
1025
+ ...se(l, `${i}.${r}.${d}`)
1106
1026
  );
1107
1027
  });
1108
1028
  }
1109
- return o;
1029
+ return s;
1110
1030
  }
1111
- function le(s, i) {
1112
- const t = a(s);
1031
+ function se(o, i) {
1032
+ const t = a(o);
1113
1033
  if (!t)
1114
1034
  return [`${i} must be an object.`];
1115
- const o = [], n = /* @__PURE__ */ new Set(["name", "label", "role", "dataType"]);
1035
+ const s = [], n = /* @__PURE__ */ new Set(["name", "label", "role", "dataType"]);
1116
1036
  return Object.keys(t).forEach((r) => {
1117
- n.has(r) || o.push(
1037
+ n.has(r) || s.push(
1118
1038
  `${i}.${r} is not supported; relationship candidate fields are scoped by their endpoint and support only name, label, role, and dataType.`
1119
1039
  );
1120
- }), (typeof t.name != "string" || !t.name.trim()) && o.push(`${i}.name must be a non-empty string.`), t.role !== void 0 && (typeof t.role != "string" || !["dimension", "measure", "date", "id", "unknown"].includes(t.role)) && o.push(`${i}.role must be dimension, measure, date, id, or unknown.`), t.dataType !== void 0 && (typeof t.dataType != "string" || !["string", "number", "boolean", "date", "datetime", "unknown"].includes(
1040
+ }), (typeof t.name != "string" || !t.name.trim()) && s.push(`${i}.name must be a non-empty string.`), t.role !== void 0 && (typeof t.role != "string" || !["dimension", "measure", "date", "id", "unknown"].includes(t.role)) && s.push(`${i}.role must be dimension, measure, date, id, or unknown.`), t.dataType !== void 0 && (typeof t.dataType != "string" || !["string", "number", "boolean", "date", "datetime", "unknown"].includes(
1121
1041
  t.dataType
1122
- )) && o.push(
1042
+ )) && s.push(
1123
1043
  `${i}.dataType must be string, number, boolean, date, datetime, or unknown.`
1124
- ), o;
1044
+ ), s;
1125
1045
  }
1126
- function P(s, i) {
1127
- const t = a(s);
1046
+ function M(o, i) {
1047
+ const t = a(o);
1128
1048
  if (!t)
1129
1049
  return [`${i} must be an object.`];
1130
- const o = [], n = /* @__PURE__ */ new Set([
1050
+ const s = [], n = /* @__PURE__ */ new Set([
1131
1051
  "kind",
1132
1052
  "domainId",
1133
1053
  "datasetName",
@@ -1136,44 +1056,44 @@ function P(s, i) {
1136
1056
  "sourceKey"
1137
1057
  ]);
1138
1058
  return Object.keys(t).forEach((r) => {
1139
- n.has(r) || o.push(
1059
+ n.has(r) || s.push(
1140
1060
  `${i}.${r} is not supported; relationship candidate sources support only semantic identity fields.`
1141
1061
  );
1142
- }), t.kind !== "semantic" && o.push(`${i} must use semantic source identity.`), (typeof t.domainId != "string" || !t.domainId.trim() || typeof t.datasetName != "string" || !t.datasetName.trim()) && o.push(`${i} must include semantic domainId and datasetName.`), o;
1062
+ }), t.kind !== "semantic" && s.push(`${i} must use semantic source identity.`), (typeof t.domainId != "string" || !t.domainId.trim() || typeof t.datasetName != "string" || !t.datasetName.trim()) && s.push(`${i} must include semantic domainId and datasetName.`), s;
1143
1063
  }
1144
- function w(s) {
1145
- return Ae.has(s);
1064
+ function S(o) {
1065
+ return ve.has(o);
1146
1066
  }
1147
- function ue(s) {
1148
- return _e.has(s);
1067
+ function oe(o) {
1068
+ return $e.has(o);
1149
1069
  }
1150
- function f(s, i) {
1151
- return s === void 0 ? [] : c(s, i);
1070
+ function f(o, i) {
1071
+ return o === void 0 ? [] : c(o, i);
1152
1072
  }
1153
- function c(s, i) {
1154
- const t = a(s);
1073
+ function c(o, i) {
1074
+ const t = a(o);
1155
1075
  if (!t)
1156
1076
  return [`${i} must be an object.`];
1157
- const o = [];
1158
- return (typeof t.name != "string" || !t.name.trim()) && o.push(`${i}.name is required.`), !t.source && typeof t.sourceKey != "string" && o.push(`${i} must include source or sourceKey.`), t.aggregate !== void 0 && !je.has(t.aggregate) && o.push(`${i}.aggregate must be a supported aggregate function.`), o;
1077
+ const s = [];
1078
+ return (typeof t.name != "string" || !t.name.trim()) && s.push(`${i}.name is required.`), !t.source && typeof t.sourceKey != "string" && s.push(`${i} must include source or sourceKey.`), t.aggregate !== void 0 && !Se.has(t.aggregate) && s.push(`${i}.aggregate must be a supported aggregate function.`), s;
1159
1079
  }
1160
- function de(s, i) {
1161
- const t = a(s), o = c(s, i);
1080
+ function ne(o, i) {
1081
+ const t = a(o), s = c(o, i);
1162
1082
  if (!t || typeof t.sourceKey == "string" && t.sourceKey.trim())
1163
- return o;
1083
+ return s;
1164
1084
  if (t.source !== void 0) {
1165
- const r = I(t.source, `${i}.source`);
1166
- return r.length === 0 || o.push(...r), o;
1085
+ const r = k(t.source, `${i}.source`);
1086
+ return r.length === 0 || s.push(...r), s;
1167
1087
  }
1168
- return o.includes(`${i} must include source or sourceKey.`) || o.push(`${i} must include source or sourceKey.`), o;
1088
+ return s.includes(`${i} must include source or sourceKey.`) || s.push(`${i} must include source or sourceKey.`), s;
1169
1089
  }
1170
- function a(s) {
1171
- return s && typeof s == "object" && !Array.isArray(s) ? s : void 0;
1090
+ function a(o) {
1091
+ return o && typeof o == "object" && !Array.isArray(o) ? o : void 0;
1172
1092
  }
1173
- function g(s) {
1174
- return Array.isArray(s) && s.every((i) => typeof i == "string");
1093
+ function g(o) {
1094
+ return Array.isArray(o) && o.every((i) => typeof i == "string");
1175
1095
  }
1176
- const p = e.record(e.string(), e.unknown()), q = e.array(p), m = e.enum([
1096
+ const p = e.record(e.string(), e.unknown()), C = e.array(p), m = e.enum([
1177
1097
  "SUM",
1178
1098
  "COUNT",
1179
1099
  "AVG",
@@ -1181,7 +1101,7 @@ const p = e.record(e.string(), e.unknown()), q = e.array(p), m = e.enum([
1181
1101
  "MAX",
1182
1102
  "MEDIAN",
1183
1103
  "DISTINCT"
1184
- ]), x = e.enum([
1104
+ ]), q = e.enum([
1185
1105
  "postgres",
1186
1106
  "mysql",
1187
1107
  "mssql",
@@ -1192,33 +1112,33 @@ const p = e.record(e.string(), e.unknown()), q = e.array(p), m = e.enum([
1192
1112
  "duckdb",
1193
1113
  "sqlite",
1194
1114
  "unknown"
1195
- ]), ce = e.enum([
1115
+ ]), re = e.enum([
1196
1116
  "hour",
1197
1117
  "day",
1198
1118
  "week",
1199
1119
  "month",
1200
1120
  "quarter",
1201
1121
  "year"
1202
- ]), E = e.enum([
1122
+ ]), x = e.enum([
1203
1123
  "dimension",
1204
1124
  "measure",
1205
1125
  "date",
1206
1126
  "id",
1207
1127
  "unknown"
1208
- ]), F = e.enum([
1128
+ ]), E = e.enum([
1209
1129
  "string",
1210
1130
  "number",
1211
1131
  "boolean",
1212
1132
  "date",
1213
1133
  "datetime",
1214
1134
  "unknown"
1215
- ]), C = e.union([e.number(), e.string(), e.null()]), B = e.enum([
1135
+ ]), R = e.union([e.number(), e.string(), e.null()]), O = e.enum([
1216
1136
  "millisecond",
1217
1137
  "second",
1218
1138
  "minute",
1219
1139
  "hour",
1220
1140
  "day"
1221
- ]), pe = e.union([
1141
+ ]), ae = e.union([
1222
1142
  e.object({
1223
1143
  type: e.enum(["number", "currency", "percent", "percentage", "scientific"]),
1224
1144
  locale: e.string().optional(),
@@ -1232,7 +1152,13 @@ const p = e.record(e.string(), e.unknown()), q = e.array(p), m = e.enum([
1232
1152
  scale: e.number().optional(),
1233
1153
  currency: e.string().optional(),
1234
1154
  percentValueMode: e.enum(["fraction", "whole"]).optional()
1235
- }).passthrough(),
1155
+ }).passthrough().superRefine((o, i) => {
1156
+ "locale" in o && i.addIssue({
1157
+ code: e.ZodIssueCode.custom,
1158
+ path: ["locale"],
1159
+ message: "Numeric semantic formats inherit locale from viewer preferences."
1160
+ });
1161
+ }),
1236
1162
  e.object({
1237
1163
  type: e.enum(["date", "datetime"]),
1238
1164
  locale: e.string().optional(),
@@ -1245,10 +1171,10 @@ const p = e.record(e.string(), e.unknown()), q = e.array(p), m = e.enum([
1245
1171
  }).passthrough(),
1246
1172
  e.object({
1247
1173
  type: e.literal("duration"),
1248
- inputUnit: B.optional(),
1174
+ inputUnit: O.optional(),
1249
1175
  outputStyle: e.enum(["compact", "digital", "long"]).optional(),
1250
- largestUnit: B.optional(),
1251
- smallestUnit: B.optional(),
1176
+ largestUnit: O.optional(),
1177
+ smallestUnit: O.optional(),
1252
1178
  maxUnits: e.number().optional(),
1253
1179
  prefix: e.string().optional(),
1254
1180
  suffix: e.string().optional(),
@@ -1259,7 +1185,7 @@ const p = e.record(e.string(), e.unknown()), q = e.array(p), m = e.enum([
1259
1185
  prefix: e.string().optional(),
1260
1186
  suffix: e.string().optional()
1261
1187
  }).passthrough()
1262
- ]), bt = e.union([
1188
+ ]), pt = e.union([
1263
1189
  e.object({ kind: e.literal("defaultAggregate") }).passthrough(),
1264
1190
  e.object({ kind: e.literal("blank") }).passthrough(),
1265
1191
  e.object({
@@ -1277,24 +1203,24 @@ const p = e.record(e.string(), e.unknown()), q = e.array(p), m = e.enum([
1277
1203
  expressionId: e.string()
1278
1204
  }).passthrough()
1279
1205
  ]);
1280
- function A(s, i) {
1281
- return e.object(s).passthrough().superRefine((t, o) => {
1206
+ function I(o, i) {
1207
+ return e.object(o).passthrough().superRefine((t, s) => {
1282
1208
  for (const n of i)
1283
- Object.prototype.hasOwnProperty.call(t, n) || o.addIssue({
1209
+ Object.prototype.hasOwnProperty.call(t, n) || s.addIssue({
1284
1210
  code: "custom",
1285
1211
  path: [n],
1286
1212
  message: `Required field "${n}" is missing.`
1287
1213
  });
1288
1214
  });
1289
1215
  }
1290
- const me = e.object({
1216
+ const le = e.object({
1291
1217
  kind: e.literal("semantic"),
1292
1218
  domainId: e.string(),
1293
1219
  datasetName: e.string(),
1294
1220
  datasetId: e.string().optional(),
1295
1221
  label: e.string().optional(),
1296
1222
  connectionId: e.string().optional()
1297
- }).passthrough(), vt = e.object({
1223
+ }).passthrough(), mt = e.object({
1298
1224
  kind: e.literal("physical"),
1299
1225
  connectionId: e.string(),
1300
1226
  connectionType: e.string().optional(),
@@ -1302,38 +1228,38 @@ const me = e.object({
1302
1228
  databaseName: e.string().optional(),
1303
1229
  schemaName: e.string().optional(),
1304
1230
  label: e.string().optional(),
1305
- dialect: x.optional()
1306
- }).passthrough(), $t = e.object({
1231
+ dialect: q.optional()
1232
+ }).passthrough(), gt = e.object({
1307
1233
  kind: e.literal("sql"),
1308
1234
  connectionId: e.string(),
1309
- dialect: x.optional(),
1235
+ dialect: q.optional(),
1310
1236
  label: e.string().optional()
1311
- }).passthrough(), k = e.union([
1312
- me,
1313
- vt,
1314
- $t
1315
- ]), $ = e.object({
1237
+ }).passthrough(), w = e.union([
1238
+ le,
1239
+ mt,
1240
+ gt
1241
+ ]), v = e.object({
1316
1242
  name: e.string(),
1317
1243
  label: e.string().optional(),
1318
- role: E.optional(),
1319
- dataType: F.optional(),
1320
- source: k.optional(),
1244
+ role: x.optional(),
1245
+ dataType: E.optional(),
1246
+ source: w.optional(),
1321
1247
  aggregate: m.optional()
1322
- }).passthrough(), St = e.object({
1248
+ }).passthrough(), ft = e.object({
1323
1249
  kind: e.literal("field"),
1324
- field: $,
1250
+ field: v,
1325
1251
  aggregate: m.optional()
1326
- }).passthrough(), ge = e.object({
1252
+ }).passthrough(), ue = e.object({
1327
1253
  kind: e.literal("derived_field"),
1328
1254
  name: e.string(),
1329
1255
  label: e.string(),
1330
1256
  description: e.string().optional(),
1331
- resultRole: E,
1332
- dataType: F,
1257
+ resultRole: x,
1258
+ dataType: E,
1333
1259
  computeStage: e.enum(["row", "aggregate"]),
1334
1260
  expression: e.string(),
1335
1261
  expressionLanguage: e.literal("semaphor_sql_template").optional(),
1336
- inputs: e.record(St),
1262
+ inputs: e.record(ft),
1337
1263
  defaultAggregate: m.optional(),
1338
1264
  aggregationBehavior: e.enum([
1339
1265
  "additive",
@@ -1349,13 +1275,13 @@ const me = e.object({
1349
1275
  "aggregate_then_join",
1350
1276
  "weighted"
1351
1277
  ]).optional(),
1352
- format: pe.optional(),
1278
+ format: ae.optional(),
1353
1279
  tags: e.array(e.string()).optional()
1354
- }).passthrough(), z = $.and(
1280
+ }).passthrough(), G = v.and(
1355
1281
  e.object({
1356
- derivedField: ge.optional()
1282
+ derivedField: ue.optional()
1357
1283
  }).passthrough()
1358
- ), wt = me, kt = e.object({
1284
+ ), ht = le, yt = e.object({
1359
1285
  kind: e.literal("physical"),
1360
1286
  connectionId: e.string().optional(),
1361
1287
  connectionType: e.string().optional(),
@@ -1363,35 +1289,35 @@ const me = e.object({
1363
1289
  databaseName: e.string().optional(),
1364
1290
  schemaName: e.string().optional(),
1365
1291
  label: e.string().optional(),
1366
- dialect: x.optional()
1367
- }).passthrough(), It = e.object({
1292
+ dialect: q.optional()
1293
+ }).passthrough(), bt = e.object({
1368
1294
  kind: e.literal("sql"),
1369
1295
  connectionId: e.string().optional(),
1370
- dialect: x.optional(),
1296
+ dialect: q.optional(),
1371
1297
  label: e.string().optional()
1372
- }).passthrough(), At = e.union([
1373
- wt,
1374
- kt,
1375
- It
1376
- ]), _t = e.object({
1298
+ }).passthrough(), vt = e.union([
1299
+ ht,
1300
+ yt,
1301
+ bt
1302
+ ]), $t = e.object({
1377
1303
  key: e.string().optional(),
1378
1304
  name: e.string(),
1379
1305
  label: e.string().optional(),
1380
- role: E.optional(),
1381
- dataType: F.optional(),
1382
- source: At.optional(),
1306
+ role: x.optional(),
1307
+ dataType: E.optional(),
1308
+ source: vt.optional(),
1383
1309
  aggregate: m.optional(),
1384
1310
  derivedField: e.never().optional()
1385
- }).passthrough(), V = e.object({
1311
+ }).passthrough(), B = e.object({
1386
1312
  key: e.string(),
1387
1313
  name: e.string(),
1388
1314
  label: e.string(),
1389
- role: E.optional(),
1390
- dataType: F.optional(),
1315
+ role: x.optional(),
1316
+ dataType: E.optional(),
1391
1317
  aggregate: m.optional(),
1392
- source: k.optional(),
1393
- derivedField: ge.optional()
1394
- }).passthrough(), fe = e.object({
1318
+ source: w.optional(),
1319
+ derivedField: ue.optional()
1320
+ }).passthrough(), de = e.object({
1395
1321
  code: e.string(),
1396
1322
  message: e.string().optional(),
1397
1323
  invalidField: e.string().optional(),
@@ -1400,61 +1326,61 @@ const me = e.object({
1400
1326
  validDateCandidates: e.array(e.string()).optional(),
1401
1327
  validDimensionCandidates: e.array(e.string()).optional(),
1402
1328
  recommendedNextStep: e.string()
1403
- }).passthrough(), L = e.object({
1329
+ }).passthrough(), P = e.object({
1404
1330
  code: e.string(),
1405
1331
  message: e.string(),
1406
1332
  path: e.string().optional(),
1407
1333
  fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
1408
- repairHint: fe.optional()
1409
- }).passthrough(), he = e.object({
1334
+ repairHint: de.optional()
1335
+ }).passthrough(), ce = e.object({
1410
1336
  ok: e.boolean(),
1411
- errors: e.array(L),
1412
- warnings: e.array(L),
1413
- repairHints: e.array(fe)
1414
- }).passthrough(), jt = e.object({
1337
+ errors: e.array(P),
1338
+ warnings: e.array(P),
1339
+ repairHints: e.array(de)
1340
+ }).passthrough(), St = e.object({
1415
1341
  page: e.number(),
1416
1342
  pageSize: e.number(),
1417
1343
  pageCount: e.number(),
1418
1344
  totalCount: e.number(),
1419
1345
  hasNextPage: e.boolean(),
1420
1346
  hasPrevPage: e.boolean()
1421
- }).passthrough(), _ = {
1347
+ }).passthrough(), A = {
1422
1348
  intentId: e.string().optional(),
1423
1349
  queryPath: e.enum(["query_spec", "sql", "sql_python"]),
1424
1350
  warnings: e.array(e.string()).optional(),
1425
1351
  rowCount: e.number().optional(),
1426
1352
  rowLimitExceeded: e.boolean().optional(),
1427
1353
  limit: e.number().optional(),
1428
- pagination: jt.optional()
1429
- }, Rt = e.object({
1430
- ..._,
1354
+ pagination: St.optional()
1355
+ }, wt = e.object({
1356
+ ...A,
1431
1357
  kind: e.literal("metric"),
1432
- primaryValue: C,
1433
- measures: e.record(C).optional(),
1358
+ primaryValue: R,
1359
+ measures: e.record(R).optional(),
1434
1360
  missingMeasures: e.array(e.string()).optional(),
1435
1361
  comparison: e.object({
1436
1362
  kind: e.enum(["previous_period", "previous_year", "target"]),
1437
- value: C.optional(),
1363
+ value: R.optional(),
1438
1364
  delta: e.union([e.number(), e.null()]).optional(),
1439
1365
  deltaPercent: e.union([e.number(), e.null()]).optional()
1440
1366
  }).passthrough().optional(),
1441
- records: q.optional()
1442
- }).passthrough(), Ct = e.object({
1443
- ..._,
1367
+ records: C.optional()
1368
+ }).passthrough(), kt = e.object({
1369
+ ...A,
1444
1370
  kind: e.literal("records"),
1445
- columns: e.array(V),
1446
- records: q,
1371
+ columns: e.array(B),
1372
+ records: C,
1447
1373
  totals: e.object({
1448
1374
  mode: e.literal("server"),
1449
1375
  scope: e.literal("filtered_result"),
1450
1376
  row: e.record(e.string(), e.unknown()),
1451
- columns: e.array(V).optional()
1377
+ columns: e.array(B).optional()
1452
1378
  }).passthrough().optional()
1453
- }).passthrough(), qt = e.object({
1454
- ..._,
1379
+ }).passthrough(), It = e.object({
1380
+ ...A,
1455
1381
  kind: e.literal("inputOptions"),
1456
1382
  options: e.array(
1457
- A(
1383
+ I(
1458
1384
  {
1459
1385
  label: e.string(),
1460
1386
  value: e.unknown(),
@@ -1464,34 +1390,34 @@ const me = e.object({
1464
1390
  ["value"]
1465
1391
  )
1466
1392
  )
1467
- }).passthrough(), xt = e.object({
1468
- ..._,
1393
+ }).passthrough(), At = e.object({
1394
+ ...A,
1469
1395
  kind: e.literal("sql"),
1470
- columns: e.array(V),
1471
- records: q,
1396
+ columns: e.array(B),
1397
+ records: C,
1472
1398
  sqlShape: e.object({
1473
1399
  statementType: e.string().optional(),
1474
1400
  explicitLimit: e.number().optional(),
1475
1401
  hasPythonCode: e.boolean().optional()
1476
1402
  }).passthrough().optional()
1477
- }).passthrough(), Et = e.object({
1403
+ }).passthrough(), _t = e.object({
1478
1404
  enabled: e.boolean().optional(),
1479
1405
  position: e.enum(["before", "after"]).optional(),
1480
1406
  label: e.string().optional()
1481
- }).passthrough(), X = e.object({
1407
+ }).passthrough(), W = e.object({
1482
1408
  id: e.enum(["rows", "columns"]),
1483
1409
  levels: e.array(
1484
1410
  e.object({
1485
1411
  instanceId: e.string(),
1486
1412
  fieldKey: e.string(),
1487
1413
  label: e.string(),
1488
- field: $,
1489
- grain: ce.optional(),
1490
- subtotal: Et.optional()
1414
+ field: v,
1415
+ grain: re.optional(),
1416
+ subtotal: _t.optional()
1491
1417
  }).passthrough()
1492
1418
  ),
1493
1419
  nodeIds: e.array(e.string())
1494
- }).passthrough(), v = A(
1420
+ }).passthrough(), b = I(
1495
1421
  {
1496
1422
  instanceId: e.string(),
1497
1423
  fieldKey: e.string(),
@@ -1499,25 +1425,25 @@ const me = e.object({
1499
1425
  label: e.string()
1500
1426
  },
1501
1427
  ["value"]
1502
- ), Ft = e.union([
1428
+ ), jt = e.union([
1503
1429
  e.object({ kind: e.literal("label") }).passthrough(),
1504
1430
  e.object({
1505
1431
  kind: e.literal("field"),
1506
- field: $,
1432
+ field: v,
1507
1433
  aggregate: m.optional()
1508
1434
  }).passthrough(),
1509
1435
  e.object({
1510
1436
  kind: e.literal("value"),
1511
1437
  valueId: e.string(),
1512
- rowPath: e.array(v).optional(),
1513
- columnPath: e.array(v).optional()
1438
+ rowPath: e.array(b).optional(),
1439
+ columnPath: e.array(b).optional()
1514
1440
  }).passthrough()
1515
- ]), Nt = e.enum([
1441
+ ]), Rt = e.enum([
1516
1442
  "present",
1517
1443
  "presentNull",
1518
1444
  "missing",
1519
1445
  "densified"
1520
- ]), Kt = e.enum([
1446
+ ]), Ct = e.enum([
1521
1447
  "value",
1522
1448
  "rowSubtotal",
1523
1449
  "columnSubtotal",
@@ -1525,13 +1451,13 @@ const me = e.object({
1525
1451
  "rowGrandTotal",
1526
1452
  "columnGrandTotal",
1527
1453
  "matrixGrandTotal"
1528
- ]), Tt = e.object({
1454
+ ]), qt = e.object({
1529
1455
  instanceId: e.string(),
1530
1456
  fieldKey: e.string(),
1531
- field: $,
1457
+ field: v,
1532
1458
  role: e.enum(["row", "column", "measure", "sort", "filter"]),
1533
1459
  label: e.string().optional()
1534
- }).passthrough(), Mt = e.union([
1460
+ }).passthrough(), xt = e.union([
1535
1461
  e.object({
1536
1462
  kind: e.literal("additive"),
1537
1463
  aggregate: m.optional()
@@ -1539,7 +1465,7 @@ const me = e.object({
1539
1465
  e.object({
1540
1466
  kind: e.literal("semiAdditive"),
1541
1467
  aggregate: m.optional(),
1542
- grain: ce.optional()
1468
+ grain: re.optional()
1543
1469
  }).passthrough(),
1544
1470
  e.object({
1545
1471
  kind: e.literal("nonAdditive"),
@@ -1554,16 +1480,16 @@ const me = e.object({
1554
1480
  kind: e.literal("custom"),
1555
1481
  expressionId: e.string().optional()
1556
1482
  }).passthrough()
1557
- ]), Bt = e.object({
1483
+ ]), Et = e.object({
1558
1484
  instanceId: e.string(),
1559
1485
  fieldKey: e.string(),
1560
1486
  label: e.string(),
1561
- field: $,
1487
+ field: v,
1562
1488
  aggregate: m.optional(),
1563
- format: pe.optional(),
1564
- totalBehavior: bt.optional(),
1565
- semantics: Mt
1566
- }).passthrough(), Dt = e.object({
1489
+ format: ae.optional(),
1490
+ totalBehavior: pt.optional(),
1491
+ semantics: xt
1492
+ }).passthrough(), Ft = e.object({
1567
1493
  id: e.string(),
1568
1494
  measureId: e.string(),
1569
1495
  aggregate: m.optional(),
@@ -1584,15 +1510,15 @@ const me = e.object({
1584
1510
  rowNodeId: e.string().optional(),
1585
1511
  columnNodeId: e.string().optional()
1586
1512
  }).passthrough().optional()
1587
- }).passthrough(), Ot = e.object({
1513
+ }).passthrough(), Kt = e.object({
1588
1514
  kind: e.string(),
1589
1515
  label: e.string().optional(),
1590
1516
  payload: e.record(e.string(), e.unknown()).optional()
1591
- }).passthrough(), Pt = A(
1517
+ }).passthrough(), Nt = I(
1592
1518
  {
1593
1519
  id: e.string(),
1594
1520
  axis: e.enum(["row", "column"]),
1595
- path: e.array(v),
1521
+ path: e.array(b),
1596
1522
  level: e.number(),
1597
1523
  label: e.string(),
1598
1524
  value: e.unknown(),
@@ -1603,10 +1529,10 @@ const me = e.object({
1603
1529
  isGrandTotal: e.boolean().optional(),
1604
1530
  subtotalFunction: m.optional(),
1605
1531
  childCount: e.number().optional(),
1606
- actions: e.array(Ot).optional()
1532
+ actions: e.array(Kt).optional()
1607
1533
  },
1608
1534
  ["value"]
1609
- ), Vt = e.object({
1535
+ ), Tt = e.object({
1610
1536
  rowHeaderLevels: e.array(
1611
1537
  e.object({
1612
1538
  id: e.string(),
@@ -1630,7 +1556,7 @@ const me = e.object({
1630
1556
  ]),
1631
1557
  colSpan: e.number(),
1632
1558
  rowSpan: e.number(),
1633
- columnPath: e.array(v),
1559
+ columnPath: e.array(b),
1634
1560
  measureInstanceId: e.string().optional()
1635
1561
  }).passthrough()
1636
1562
  )
@@ -1641,24 +1567,29 @@ const me = e.object({
1641
1567
  id: e.string(),
1642
1568
  label: e.string(),
1643
1569
  columnNodeId: e.string().optional(),
1644
- columnPath: e.array(v),
1570
+ columnPath: e.array(b),
1645
1571
  measureInstanceId: e.string(),
1646
1572
  role: e.enum(["value", "columnSubtotal", "columnGrandTotal"])
1647
1573
  }).passthrough()
1648
1574
  )
1649
- }).passthrough(), Lt = A(
1575
+ }).passthrough(), Ot = I(
1650
1576
  {
1651
1577
  rowId: e.string(),
1652
1578
  columnId: e.string().optional(),
1653
1579
  measureId: e.string(),
1654
1580
  value: e.unknown(),
1655
- formattedValue: e.string().optional(),
1656
- presence: Nt,
1657
- role: Kt,
1581
+ presence: Rt,
1582
+ role: Ct,
1658
1583
  calculationId: e.string().optional()
1659
1584
  },
1660
1585
  ["value"]
1661
- ), Gt = e.object({
1586
+ ).superRefine((o, i) => {
1587
+ Object.prototype.hasOwnProperty.call(o, "formattedValue") && i.addIssue({
1588
+ code: "custom",
1589
+ path: ["formattedValue"],
1590
+ message: "Matrix result cells carry typed values; formattedValue is not supported."
1591
+ });
1592
+ }), Dt = e.object({
1662
1593
  rows: e.boolean().optional(),
1663
1594
  columns: e.boolean().optional(),
1664
1595
  grandTotal: e.union([
@@ -1668,7 +1599,7 @@ const me = e.object({
1668
1599
  columns: e.boolean().optional()
1669
1600
  }).passthrough()
1670
1601
  ]).optional()
1671
- }).passthrough(), Ut = A(
1602
+ }).passthrough(), Mt = I(
1672
1603
  {
1673
1604
  id: e.string(),
1674
1605
  axis: e.enum(["row", "column"]),
@@ -1676,27 +1607,27 @@ const me = e.object({
1676
1607
  direction: e.enum(["asc", "desc"]),
1677
1608
  nulls: e.enum(["warehouseDefault", "first", "last"]).optional(),
1678
1609
  scope: e.enum(["global", "withinParent"]).optional(),
1679
- by: Ft
1610
+ by: jt
1680
1611
  },
1681
1612
  ["by"]
1682
- ), zt = e.object({
1613
+ ), Bt = e.object({
1683
1614
  rowOffset: e.number().optional(),
1684
1615
  rowLimit: e.number().optional(),
1685
1616
  columnOffset: e.number().optional(),
1686
1617
  columnLimit: e.number().optional(),
1687
1618
  hasMoreRows: e.boolean().optional(),
1688
1619
  hasMoreColumns: e.boolean().optional()
1689
- }).passthrough(), Ht = e.object({
1620
+ }).passthrough(), Pt = e.object({
1690
1621
  axis: e.enum(["row", "column"]),
1691
- path: e.array(v),
1622
+ path: e.array(b),
1692
1623
  depth: e.number().optional()
1693
- }).passthrough(), Qt = e.object({
1624
+ }).passthrough(), Vt = e.object({
1694
1625
  rowLazyLoading: e.boolean().optional(),
1695
1626
  columnLazyLoading: e.boolean().optional(),
1696
1627
  expandableRowNodeIds: e.array(e.string()).optional(),
1697
1628
  expandableColumnNodeIds: e.array(e.string()).optional(),
1698
- nextRequests: e.array(Ht).optional()
1699
- }).passthrough(), Yt = e.object({
1629
+ nextRequests: e.array(Pt).optional()
1630
+ }).passthrough(), Lt = e.object({
1700
1631
  domains: e.record(
1701
1632
  e.object({
1702
1633
  min: e.number().optional(),
@@ -1704,35 +1635,35 @@ const me = e.object({
1704
1635
  }).passthrough()
1705
1636
  ).optional(),
1706
1637
  rules: e.array(e.record(e.string(), e.unknown())).optional()
1707
- }).passthrough(), Jt = e.object({
1708
- ..._,
1638
+ }).passthrough(), Gt = e.object({
1639
+ ...A,
1709
1640
  kind: e.literal("matrix"),
1710
1641
  schemaVersion: e.literal(1),
1711
1642
  shape: e.enum(["hierarchical", "pivot"]),
1712
1643
  capabilities: e.array(e.string()),
1713
1644
  executionMetadata: e.record(e.string(), e.unknown()),
1714
- fieldsById: e.record(e.string(), Tt),
1715
- measuresById: e.record(e.string(), Bt),
1716
- calculationsById: e.record(e.string(), Dt).optional(),
1645
+ fieldsById: e.record(e.string(), qt),
1646
+ measuresById: e.record(e.string(), Et),
1647
+ calculationsById: e.record(e.string(), Ft).optional(),
1717
1648
  axes: e.object({
1718
- rows: X,
1719
- columns: X
1649
+ rows: W,
1650
+ columns: W
1720
1651
  }).passthrough(),
1721
- nodesById: e.record(e.string(), Pt),
1722
- layout: Vt,
1723
- cells: e.array(Lt),
1724
- totals: Gt,
1725
- sort: e.array(Ut),
1726
- formattingContext: Yt,
1727
- pageInfo: zt.optional(),
1728
- expansion: Qt.optional()
1729
- }).passthrough(), Wt = e.union([
1730
- Rt,
1731
- Ct,
1732
- qt,
1733
- xt,
1734
- Jt
1735
- ]), Xt = e.object({
1652
+ nodesById: e.record(e.string(), Nt),
1653
+ layout: Tt,
1654
+ cells: e.array(Ot),
1655
+ totals: Dt,
1656
+ sort: e.array(Mt),
1657
+ formattingContext: Lt,
1658
+ pageInfo: Bt.optional(),
1659
+ expansion: Vt.optional()
1660
+ }).passthrough(), Ut = e.union([
1661
+ wt,
1662
+ kt,
1663
+ It,
1664
+ At,
1665
+ Gt
1666
+ ]), zt = e.object({
1736
1667
  status: e.enum([
1737
1668
  "not_required",
1738
1669
  "resolved",
@@ -1741,15 +1672,15 @@ const me = e.object({
1741
1672
  "fanout_risk",
1742
1673
  "unknown"
1743
1674
  ]),
1744
- requiredSources: e.array(k).optional(),
1675
+ requiredSources: e.array(w).optional(),
1745
1676
  relationshipsUsed: e.array(e.string()).optional(),
1746
1677
  missingSources: e.array(e.string()).optional(),
1747
1678
  warnings: e.array(e.string()).optional(),
1748
1679
  message: e.string().optional(),
1749
1680
  recommendedNextStep: e.string().optional(),
1750
1681
  joinPlanSummary: e.object({
1751
- baseSource: k.optional(),
1752
- joinedSources: e.array(k).optional(),
1682
+ baseSource: w.optional(),
1683
+ joinedSources: e.array(w).optional(),
1753
1684
  joinCount: e.number().optional()
1754
1685
  }).passthrough().optional(),
1755
1686
  fanoutRisk: e.object({
@@ -1766,7 +1697,7 @@ const me = e.object({
1766
1697
  "presentation_incomplete",
1767
1698
  "query_validation_failed",
1768
1699
  "unsafe_join"
1769
- ]), ye = e.object({
1700
+ ]), pe = e.object({
1770
1701
  version: e.literal(1),
1771
1702
  status: e.enum(["answered", "partial", "blocked"]),
1772
1703
  summary: e.string(),
@@ -1776,7 +1707,7 @@ const me = e.object({
1776
1707
  queryId: e.string().optional(),
1777
1708
  summary: e.string(),
1778
1709
  evidenceIds: e.array(e.string()).optional(),
1779
- fieldsUsed: e.array(z).optional()
1710
+ fieldsUsed: e.array(G).optional()
1780
1711
  }).passthrough()
1781
1712
  ),
1782
1713
  blocked: e.array(
@@ -1801,14 +1732,14 @@ const me = e.object({
1801
1732
  recommendedNextStep: e.string().optional()
1802
1733
  }).passthrough()
1803
1734
  ).optional()
1804
- }).passthrough(), be = e.object({
1735
+ }).passthrough(), me = e.object({
1805
1736
  scope: e.literal("filtered_query"),
1806
- measures: e.record(C)
1807
- }).passthrough(), ve = e.object({
1737
+ measures: e.record(R)
1738
+ }).passthrough(), ge = e.object({
1808
1739
  answeredObligations: e.array(e.string()),
1809
1740
  missingObligations: e.array(e.string()),
1810
- warnings: e.array(L).optional()
1811
- }).passthrough(), Zt = e.object({
1741
+ warnings: e.array(P).optional()
1742
+ }).passthrough(), Ht = e.object({
1812
1743
  intentId: e.string().optional(),
1813
1744
  queryId: e.string().optional(),
1814
1745
  status: e.enum(["answered", "partial", "failed"]),
@@ -1823,39 +1754,39 @@ const me = e.object({
1823
1754
  ]).optional(),
1824
1755
  intent: e.unknown().optional(),
1825
1756
  compiledQuery: e.unknown().optional(),
1826
- fieldsUsed: e.array(z).optional(),
1827
- result: Wt.optional(),
1828
- validation: he,
1829
- coverage: ve.optional(),
1757
+ fieldsUsed: e.array(G).optional(),
1758
+ result: Ut.optional(),
1759
+ validation: ce,
1760
+ coverage: ge.optional(),
1830
1761
  missingFields: e.array(e.string()).optional(),
1831
1762
  warnings: e.array(e.string()).optional(),
1832
- relationshipDiagnostics: Xt.optional(),
1833
- diagnosticFeedback: ye.optional(),
1834
- population: be.optional(),
1763
+ relationshipDiagnostics: zt.optional(),
1764
+ diagnosticFeedback: pe.optional(),
1765
+ population: me.optional(),
1835
1766
  metadata: e.record(e.string(), e.unknown()).optional()
1836
1767
  }).passthrough();
1837
- function ei(s) {
1838
- switch (s) {
1768
+ function Qt(o) {
1769
+ switch (o) {
1839
1770
  case "boolean":
1840
1771
  return e.boolean().optional();
1841
1772
  case "compactExecutionFieldArray":
1842
- return e.array(_t).optional();
1773
+ return e.array($t).optional();
1843
1774
  case "coverage":
1844
- return ve.optional();
1775
+ return ge.optional();
1845
1776
  case "diagnosticFeedback":
1846
- return ye.optional();
1777
+ return pe.optional();
1847
1778
  case "executionFieldArray":
1848
- return e.array(z).optional();
1779
+ return e.array(G).optional();
1849
1780
  case "executionResult":
1850
- return Zt.optional();
1781
+ return Ht.optional();
1851
1782
  case "number":
1852
1783
  return e.number().finite().optional();
1853
1784
  case "population":
1854
- return be.optional();
1785
+ return me.optional();
1855
1786
  case "record":
1856
1787
  return p.optional();
1857
1788
  case "recordArray":
1858
- return q.optional();
1789
+ return C.optional();
1859
1790
  case "responseDetail":
1860
1791
  return e.enum(["compact", "standard", "debug"]).optional();
1861
1792
  case "string":
@@ -1867,14 +1798,14 @@ function ei(s) {
1867
1798
  case "unknownArray":
1868
1799
  return e.array(e.unknown()).optional();
1869
1800
  case "validationResult":
1870
- return he.optional();
1801
+ return ce.optional();
1871
1802
  }
1872
1803
  }
1873
- const ti = Object.fromEntries(
1874
- Object.entries(G).map(
1875
- ([s, i]) => [s, ei(i)]
1804
+ const Yt = Object.fromEntries(
1805
+ Object.entries(V).map(
1806
+ ([o, i]) => [o, Qt(i)]
1876
1807
  )
1877
- ), ii = e.object(ti).strict(), H = e.object({
1808
+ ), Wt = e.object(Yt).strict(), U = e.object({
1878
1809
  sourceKey: e.string().optional(),
1879
1810
  kind: e.enum(["semantic", "physical", "sql"]).optional(),
1880
1811
  domainId: e.string().optional(),
@@ -1890,11 +1821,11 @@ const ti = Object.fromEntries(
1890
1821
  dataType: e.enum(["string", "number", "boolean", "date", "datetime", "unknown"]).optional(),
1891
1822
  aggregate: m.optional(),
1892
1823
  sourceKey: e.string().optional(),
1893
- source: H.optional()
1894
- }).passthrough(), $e = e.object({
1824
+ source: U.optional()
1825
+ }).passthrough(), fe = e.object({
1895
1826
  id: e.string().optional(),
1896
1827
  builder: e.literal("semaphor.inputOptions"),
1897
- source: H.optional(),
1828
+ source: U.optional(),
1898
1829
  sourceKey: e.string().optional(),
1899
1830
  valueFieldRef: h,
1900
1831
  labelFieldRef: h,
@@ -1903,24 +1834,24 @@ const ti = Object.fromEntries(
1903
1834
  dependencies: e.unknown().optional(),
1904
1835
  limit: e.number().int().positive().optional(),
1905
1836
  spec: p.optional()
1906
- }).passthrough(), Se = e.object({
1837
+ }).passthrough(), he = e.object({
1907
1838
  appliesToViewIds: e.array(e.string()).optional(),
1908
1839
  viewId: e.string().optional(),
1909
1840
  fieldRef: h,
1910
1841
  relationshipHint: e.unknown().optional(),
1911
1842
  relationshipsUsed: e.array(p).optional()
1912
- }).passthrough(), si = e.object({
1843
+ }).passthrough(), Zt = e.object({
1913
1844
  id: e.string(),
1914
1845
  label: e.string().optional(),
1915
1846
  type: e.string().optional(),
1916
1847
  serverSide: e.boolean().optional(),
1917
1848
  fieldRef: h.optional(),
1918
- optionQuery: $e.optional(),
1919
- bindings: e.array(Se).optional(),
1849
+ optionQuery: fe.optional(),
1850
+ bindings: e.array(he).optional(),
1920
1851
  appliesToViewIds: e.array(e.string()),
1921
1852
  relationshipHint: e.unknown().optional(),
1922
1853
  relationshipsUsed: e.array(p).optional()
1923
- }).passthrough(), oi = e.object({
1854
+ }).passthrough(), Jt = e.object({
1924
1855
  builder: e.enum([
1925
1856
  "semaphor.metric",
1926
1857
  "semaphor.records",
@@ -1930,7 +1861,7 @@ const ti = Object.fromEntries(
1930
1861
  ]),
1931
1862
  spec: p,
1932
1863
  fallbackReason: p.optional()
1933
- }).passthrough(), ni = e.object({
1864
+ }).passthrough(), Xt = e.object({
1934
1865
  id: e.string(),
1935
1866
  title: e.string().optional(),
1936
1867
  purpose: e.string().optional(),
@@ -1948,31 +1879,31 @@ const ti = Object.fromEntries(
1948
1879
  "semaphor.analysis",
1949
1880
  "semaphor.sql"
1950
1881
  ]).optional(),
1951
- sdkSpec: oi.optional(),
1882
+ sdkSpec: Jt.optional(),
1952
1883
  fields: e.array(h).optional(),
1953
1884
  computation: p.optional(),
1954
1885
  uxExpectations: e.array(e.string()).optional(),
1955
1886
  validation: p.optional()
1956
- }).passthrough(), ri = e.object({
1887
+ }).passthrough(), ei = e.object({
1957
1888
  inputId: e.string(),
1958
1889
  label: e.string().optional(),
1959
1890
  type: e.string().optional(),
1960
1891
  serverSide: e.boolean().optional(),
1961
1892
  fieldRef: h.optional(),
1962
- optionQuery: $e.optional(),
1963
- bindings: e.array(Se),
1893
+ optionQuery: fe.optional(),
1894
+ bindings: e.array(he),
1964
1895
  appliesToViewIds: e.array(e.string()),
1965
1896
  notAppliedToViewIds: e.array(e.string())
1966
- }).passthrough(), hi = e.object({
1967
- schemaVersion: e.literal(O),
1897
+ }).passthrough(), ai = e.object({
1898
+ schemaVersion: e.literal(D),
1968
1899
  title: e.string(),
1969
1900
  purpose: e.string().optional(),
1970
1901
  userGoal: e.string().optional(),
1971
1902
  nextStep: e.string().optional(),
1972
- sources: e.array(H),
1973
- inputs: e.array(si),
1974
- views: e.array(ni),
1975
- filterContracts: e.array(ri),
1903
+ sources: e.array(U),
1904
+ inputs: e.array(Zt),
1905
+ views: e.array(Xt),
1906
+ filterContracts: e.array(ei),
1976
1907
  implementationChecklist: e.object({
1977
1908
  schemaVersion: e.string().optional(),
1978
1909
  requiredDevtools: e.object({
@@ -2001,76 +1932,67 @@ const ti = Object.fromEntries(
2001
1932
  ).optional(),
2002
1933
  assumptions: e.array(e.string()).optional(),
2003
1934
  validation: p.optional()
2004
- }).passthrough().superRefine((s, i) => {
2005
- const t = oe(s);
2006
- for (const o of t.issues)
1935
+ }).passthrough().superRefine((o, i) => {
1936
+ const t = X(o);
1937
+ for (const s of t.issues)
2007
1938
  i.addIssue({
2008
1939
  code: e.ZodIssueCode.custom,
2009
- message: o
1940
+ message: s
2010
1941
  });
2011
- }), ai = new Set(
2012
- Object.keys(G)
1942
+ }), ti = new Set(
1943
+ Object.keys(V)
2013
1944
  );
2014
- function yi() {
1945
+ function li() {
2015
1946
  return Object.keys(
2016
- G
1947
+ V
2017
1948
  );
2018
1949
  }
2019
- function li(s) {
2020
- return ai.has(s);
1950
+ function ii(o) {
1951
+ return ti.has(o);
2021
1952
  }
2022
- function bi(s) {
2023
- if (!s || typeof s != "object" || Array.isArray(s))
1953
+ function ui(o) {
1954
+ if (!o || typeof o != "object" || Array.isArray(o))
2024
1955
  throw new Error("Semaphor analyze result must be an object.");
2025
- const t = Object.keys(s).filter(
2026
- (o) => !li(o)
1956
+ const t = Object.keys(o).filter(
1957
+ (s) => !ii(s)
2027
1958
  );
2028
1959
  if (t.length)
2029
1960
  throw new Error(
2030
1961
  `Semaphor analyze result contains unsupported top-level field(s): ${t.join(", ")}.`
2031
1962
  );
2032
- return ii.parse(s);
1963
+ return Wt.parse(o);
2033
1964
  }
2034
1965
  export {
2035
- z as A,
2036
- $ as B,
2037
- qt as C,
2038
- Jt as D,
2039
- ke as E,
2040
- Rt as F,
2041
- vt as G,
2042
- Ct as H,
2043
- Xt as I,
2044
- V as J,
2045
- me as K,
2046
- k as L,
2047
- xt as M,
2048
- $t as N,
2049
- O as S,
2050
- gi as a,
2051
- ie as b,
2052
- ee as c,
2053
- D as d,
2054
- G as e,
2055
- li as f,
2056
- yi as g,
2057
- di as h,
2058
- fi as i,
2059
- bi as j,
2060
- te as k,
2061
- ve as l,
2062
- ci as m,
2063
- ye as n,
2064
- Zt as o,
2065
- mi as p,
2066
- be as q,
2067
- Wt as r,
2068
- pi as s,
2069
- L as t,
2070
- he as u,
2071
- oe as v,
2072
- ii as w,
2073
- ti as x,
2074
- hi as y,
2075
- ge as z
1966
+ B as A,
1967
+ le as B,
1968
+ w as C,
1969
+ At as D,
1970
+ gt as E,
1971
+ D as S,
1972
+ ni as a,
1973
+ V as b,
1974
+ ii as c,
1975
+ pe as d,
1976
+ Ht as e,
1977
+ me as f,
1978
+ li as g,
1979
+ Ut as h,
1980
+ ri as i,
1981
+ P as j,
1982
+ ce as k,
1983
+ Wt as l,
1984
+ Yt as m,
1985
+ ai as n,
1986
+ ue as o,
1987
+ ui as p,
1988
+ G as q,
1989
+ v as r,
1990
+ ge as s,
1991
+ It as t,
1992
+ Gt as u,
1993
+ X as v,
1994
+ wt as w,
1995
+ mt as x,
1996
+ kt as y,
1997
+ zt as z
2076
1998
  };