react-semaphor 0.1.399 → 0.1.400

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 (48) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +1 -1
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/chunks/{analyze-result-contract-CUO5QmqV.js → analyze-result-contract-BUgK3759.js} +675 -639
  6. package/dist/chunks/analyze-result-contract-S8u7CcPL.js +1 -0
  7. package/dist/chunks/{calendar-preferences-dialog-B3fnFtJt.js → calendar-preferences-dialog-Ci3rHHgA.js} +1 -1
  8. package/dist/chunks/{calendar-preferences-dialog-9SvYDLp6.js → calendar-preferences-dialog-i3-jBIYS.js} +3 -3
  9. package/dist/chunks/{dashboard-briefing-launcher-APVyc9al.js → dashboard-briefing-launcher-BpwjeJsQ.js} +4 -4
  10. package/dist/chunks/{dashboard-briefing-launcher-D3R4R7ww.js → dashboard-briefing-launcher-DiEpMS9E.js} +1 -1
  11. package/dist/chunks/{dashboard-controls-v7jslCXR.js → dashboard-controls-BaUUrvSI.js} +1 -1
  12. package/dist/chunks/{dashboard-controls-CHDQlMZ9.js → dashboard-controls-Bkjpgr3d.js} +5 -5
  13. package/dist/chunks/{dashboard-json-L1Qo5xcX.js → dashboard-json-CxNyExRm.js} +1 -1
  14. package/dist/chunks/{dashboard-json-DF_syvRu.js → dashboard-json-DvULhhN2.js} +3 -3
  15. package/dist/chunks/{edit-dashboard-visual-DwfIWUe-.js → edit-dashboard-visual-DBrsgEtL.js} +4 -4
  16. package/dist/chunks/{edit-dashboard-visual-qdruQruO.js → edit-dashboard-visual-DJRPiKdY.js} +1 -1
  17. package/dist/chunks/{index-DH7hOGQl.js → index-BepF6hoa.js} +2 -2
  18. package/dist/chunks/{index-BdVymLVq.js → index-Drz04wqE.js} +5 -5
  19. package/dist/chunks/{switch-CYG3dY8r.js → switch-D2oOmorN.js} +1 -1
  20. package/dist/chunks/{switch-BiU6-YSY.js → switch-qUw8u-gU.js} +1 -1
  21. package/dist/chunks/update-policy-BmtOqvbf.js +3 -0
  22. package/dist/chunks/update-policy-KImUg4Od.js +831 -0
  23. package/dist/chunks/{use-create-flow-overlay-state-CwUkhLBL.js → use-create-flow-overlay-state-CFJIHt5D.js} +3 -3
  24. package/dist/chunks/{use-create-flow-overlay-state-qe7DHQKr.js → use-create-flow-overlay-state-DrkYiyQz.js} +1 -1
  25. package/dist/dashboard/index.cjs +1 -1
  26. package/dist/dashboard/index.js +1 -1
  27. package/dist/dashboard-authoring/index.cjs +1 -1
  28. package/dist/dashboard-authoring/index.js +1 -1
  29. package/dist/data-app-builder/index.cjs +1 -1
  30. package/dist/data-app-builder/index.js +2 -2
  31. package/dist/data-app-codegen/index.cjs +1 -0
  32. package/dist/data-app-codegen/index.js +22 -0
  33. package/dist/data-app-codegen-node/index.cjs +462 -0
  34. package/dist/data-app-codegen-node/index.js +1424 -0
  35. package/dist/data-app-sdk/index.cjs +1 -1
  36. package/dist/data-app-sdk/index.js +1 -1
  37. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  38. package/dist/data-app-sdk-adapters/index.js +1 -1
  39. package/dist/data-app-sdk-validation/index.cjs +1 -1
  40. package/dist/data-app-sdk-validation/index.js +1 -1
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.js +7 -7
  43. package/dist/surfboard/index.cjs +1 -1
  44. package/dist/surfboard/index.js +2 -2
  45. package/dist/types/data-app-codegen-node.d.ts +1165 -0
  46. package/dist/types/data-app-codegen.d.ts +1137 -0
  47. package/package.json +9 -1
  48. package/dist/chunks/analyze-result-contract-OqFtOCpZ.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import { z as e } from "zod";
2
- const M = {
2
+ const B = {
3
3
  answerSummary: "string",
4
4
  responseDetail: "responseDetail",
5
5
  mode: "string",
@@ -39,7 +39,7 @@ const M = {
39
39
  periodRows: "recordArray",
40
40
  sql: "unknown",
41
41
  omitted: "stringArray"
42
- }, N = "semaphor-data-app-codegen-summary/v1", Ho = "semaphor-data-app-codegen-summary-validator/v2", ge = /* @__PURE__ */ new Set([
42
+ }, K = "semaphor-data-app-codegen-summary/v1", Ht = "semaphor-data-app-codegen-summary-validator/v2", ge = /* @__PURE__ */ new Set([
43
43
  "metric",
44
44
  "records",
45
45
  "matrix",
@@ -57,7 +57,7 @@ const M = {
57
57
  "largest_positive",
58
58
  "positive_and_negative",
59
59
  "all"
60
- ]), Y = /* @__PURE__ */ new Set([
60
+ ]), W = /* @__PURE__ */ new Set([
61
61
  "source",
62
62
  "id",
63
63
  "label",
@@ -73,7 +73,7 @@ const M = {
73
73
  "limit",
74
74
  "derivedFields"
75
75
  ]), be = /* @__PURE__ */ new Set([
76
- ...Y,
76
+ ...W,
77
77
  "analysis",
78
78
  "timeWindow",
79
79
  "filters",
@@ -150,68 +150,68 @@ const M = {
150
150
  "requires_sql_escape_hatch",
151
151
  "unsupported_sdk_capability"
152
152
  ]);
153
- function Qo(i) {
154
- return W(i).ok;
153
+ function Qt(i) {
154
+ return Z(i).ok;
155
155
  }
156
- function W(i) {
157
- const t = [];
156
+ function Z(i) {
157
+ const o = [];
158
158
  if (!i || typeof i != "object")
159
159
  return { ok: !1, issues: ["Summary must be an object."] };
160
- const o = i;
161
- return o.schemaVersion !== N && t.push(
162
- `schemaVersion must be ${N}.`
163
- ), (typeof o.title != "string" || !o.title.trim()) && t.push("title is required."), Array.isArray(o.sources) || t.push("sources must be an array."), Array.isArray(o.inputs) || t.push("inputs must be an array."), Array.isArray(o.views) || t.push("views must be an array."), Array.isArray(o.filterContracts) || t.push("filterContracts must be an array."), (!o.implementationChecklist || typeof o.implementationChecklist != "object") && t.push("implementationChecklist must be an object."), o.implementationChecklist && typeof o.implementationChecklist == "object" && t.push(
164
- ...Ae(o.implementationChecklist)
165
- ), Array.isArray(o.sources) && o.sources.forEach((s, r) => {
166
- t.push(...w(s, `sources.${r}`));
167
- }), Array.isArray(o.inputs) && o.inputs.forEach((s, r) => {
168
- t.push(...Ie(s, `inputs.${r}`));
169
- }), Array.isArray(o.views) && o.views.forEach((s, r) => {
170
- t.push(..._e(s, `views.${r}`));
171
- }), Array.isArray(o.filterContracts) && o.filterContracts.forEach((s, r) => {
172
- t.push(
173
- ...xe(s, `filterContracts.${r}`)
160
+ const t = i;
161
+ return t.schemaVersion !== K && o.push(
162
+ `schemaVersion must be ${K}.`
163
+ ), (typeof t.title != "string" || !t.title.trim()) && o.push("title is required."), Array.isArray(t.sources) || o.push("sources must be an array."), Array.isArray(t.inputs) || o.push("inputs must be an array."), Array.isArray(t.views) || o.push("views must be an array."), Array.isArray(t.filterContracts) || o.push("filterContracts must be an array."), (!t.implementationChecklist || typeof t.implementationChecklist != "object") && o.push("implementationChecklist must be an object."), t.implementationChecklist && typeof t.implementationChecklist == "object" && o.push(
164
+ ...Ie(t.implementationChecklist)
165
+ ), Array.isArray(t.sources) && t.sources.forEach((s, n) => {
166
+ o.push(...w(s, `sources.${n}`));
167
+ }), Array.isArray(t.inputs) && t.inputs.forEach((s, n) => {
168
+ o.push(...Ae(s, `inputs.${n}`));
169
+ }), Array.isArray(t.views) && t.views.forEach((s, n) => {
170
+ o.push(..._e(s, `views.${n}`));
171
+ }), Array.isArray(t.filterContracts) && t.filterContracts.forEach((s, n) => {
172
+ o.push(
173
+ ...Ee(s, `filterContracts.${n}`)
174
174
  );
175
- }), o.unsupportedInsights !== void 0 && (Array.isArray(o.unsupportedInsights) ? o.unsupportedInsights.forEach((s, r) => {
176
- t.push(
177
- ...We(
175
+ }), t.unsupportedInsights !== void 0 && (Array.isArray(t.unsupportedInsights) ? t.unsupportedInsights.forEach((s, n) => {
176
+ o.push(
177
+ ...Ze(
178
178
  s,
179
- `unsupportedInsights.${r}`
179
+ `unsupportedInsights.${n}`
180
180
  )
181
181
  );
182
- }) : t.push("unsupportedInsights must be an array.")), t.push(...ke(o)), { ok: t.length === 0, issues: t };
182
+ }) : o.push("unsupportedInsights must be an array.")), o.push(...ke(t)), { ok: o.length === 0, issues: o };
183
183
  }
184
184
  function ke(i) {
185
- const t = Array.isArray(i.unsupportedInsights) && i.unsupportedInsights.some(
185
+ const o = Array.isArray(i.unsupportedInsights) && i.unsupportedInsights.some(
186
186
  (l) => {
187
187
  var u;
188
188
  return ((u = a(l)) == null ? void 0 : u.reason) === "missing_relationship";
189
189
  }
190
- ), o = Array.isArray(i.views) && i.views.some((l) => {
191
- var p;
192
- const u = a((p = a(l)) == null ? void 0 : p.computation);
190
+ ), t = Array.isArray(i.views) && i.views.some((l) => {
191
+ var c;
192
+ const u = a((c = a(l)) == null ? void 0 : c.computation);
193
193
  return (u == null ? void 0 : u.kind) === "unsupported" && u.reason === "missing_relationship";
194
194
  });
195
- if (!t && !o)
195
+ if (!o && !t)
196
196
  return [];
197
- const s = [], r = a(i.validation);
198
- (r == null ? void 0 : r.status) !== "blocked" && s.push(
197
+ const s = [], n = a(i.validation);
198
+ (n == null ? void 0 : n.status) !== "blocked" && s.push(
199
199
  "validation.status must be blocked when missing_relationship gaps are present."
200
200
  );
201
- const n = a(i.nextRequiredTool);
202
- return (n == null ? void 0 : n.name) !== "semaphor_propose_semantic_model_change" && s.push(
201
+ const r = a(i.nextRequiredTool);
202
+ return (r == null ? void 0 : r.name) !== "semaphor_propose_semantic_model_change" && s.push(
203
203
  "nextRequiredTool.name must be semaphor_propose_semantic_model_change when missing_relationship gaps are present."
204
204
  ), s;
205
205
  }
206
- function w(i, t) {
207
- const o = a(i);
208
- return o ? o.kind === "semantic" ? typeof o.domainId == "string" && o.domainId.trim() && typeof o.datasetName == "string" && o.datasetName.trim() ? [] : [`${t} must include sourceKey or a supported source identity.`] : typeof o.sourceKey == "string" && o.sourceKey.trim() ? [] : o.kind === "physical" && typeof o.tableName == "string" && o.tableName.trim() && typeof o.connectionId == "string" && o.connectionId.trim() ? [] : o.kind === "sql" && typeof o.connectionId == "string" && o.connectionId.trim() ? [] : [`${t} must include sourceKey or a supported source identity.`] : [`${t} must be an object.`];
209
- }
210
- function Ae(i) {
206
+ function w(i, o) {
211
207
  const t = a(i);
212
- if (!t)
208
+ return t ? t.kind === "semantic" ? typeof t.domainId == "string" && t.domainId.trim() && typeof t.datasetName == "string" && t.datasetName.trim() ? [] : [`${o} 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() ? [] : [`${o} must include sourceKey or a supported source identity.`] : [`${o} must be an object.`];
209
+ }
210
+ function Ie(i) {
211
+ const o = a(i);
212
+ if (!o)
213
213
  return ["implementationChecklist must be an object."];
214
- const o = [], s = [
214
+ const t = [], s = [
215
215
  "requiredDevtools",
216
216
  "requiredInputOptions",
217
217
  "filterScopeByInput",
@@ -219,197 +219,233 @@ function Ae(i) {
219
219
  "validationCommands",
220
220
  "browserSmokeChecks"
221
221
  ];
222
- for (const n of s)
223
- n in t || o.push(`implementationChecklist.${n} is required.`);
224
- const r = a(t.requiredDevtools);
225
- return r ? typeof r.mountRootDevtools != "boolean" && o.push(
222
+ for (const r of s)
223
+ r in o || t.push(`implementationChecklist.${r} is required.`);
224
+ const n = a(o.requiredDevtools);
225
+ return n ? typeof n.mountRootDevtools != "boolean" && t.push(
226
226
  "implementationChecklist.requiredDevtools.mountRootDevtools must be a boolean."
227
- ) : o.push("implementationChecklist.requiredDevtools must be an object."), Array.isArray(t.requiredInputOptions) || o.push(
227
+ ) : t.push("implementationChecklist.requiredDevtools must be an object."), Array.isArray(o.requiredInputOptions) || t.push(
228
228
  "implementationChecklist.requiredInputOptions must be an array."
229
- ), Array.isArray(t.filterScopeByInput) || o.push("implementationChecklist.filterScopeByInput must be an array."), a(t.bindingsByView) || o.push("implementationChecklist.bindingsByView must be an object."), g(t.validationCommands) || o.push(
229
+ ), Array.isArray(o.filterScopeByInput) || t.push("implementationChecklist.filterScopeByInput must be an array."), a(o.bindingsByView) || t.push("implementationChecklist.bindingsByView must be an object."), g(o.validationCommands) || t.push(
230
230
  "implementationChecklist.validationCommands must be an array of strings."
231
- ), g(t.browserSmokeChecks) || o.push(
231
+ ), g(o.browserSmokeChecks) || t.push(
232
232
  "implementationChecklist.browserSmokeChecks must be an array of strings."
233
- ), o;
233
+ ), t;
234
234
  }
235
- function Ie(i, t) {
236
- const o = a(i);
237
- if (!o)
238
- return [`${t} must be an object.`];
235
+ function Ae(i, o) {
236
+ const t = a(i);
237
+ if (!t)
238
+ return [`${o} must be an object.`];
239
239
  const s = [];
240
- return (typeof o.id != "string" || !o.id.trim()) && s.push(`${t}.id is required.`), o.fieldRef && s.push(...d(o.fieldRef, `${t}.fieldRef`)), s.push(...Z(o.optionQuery, `${t}.optionQuery`)), g(o.appliesToViewIds) || s.push(`${t}.appliesToViewIds must be an array of strings.`), o.bindings !== void 0 && !Array.isArray(o.bindings) && s.push(`${t}.bindings must be an array.`), Array.isArray(o.bindings) && o.bindings.forEach((r, n) => {
241
- const l = a(r);
240
+ return (typeof t.id != "string" || !t.id.trim()) && s.push(`${o}.id is required.`), t.fieldRef && s.push(...p(t.fieldRef, `${o}.fieldRef`)), s.push(...X(t.optionQuery, `${o}.optionQuery`)), g(t.appliesToViewIds) || s.push(`${o}.appliesToViewIds must be an array of strings.`), t.bindings !== void 0 && !Array.isArray(t.bindings) && s.push(`${o}.bindings must be an array.`), Array.isArray(t.bindings) && t.bindings.forEach((n, r) => {
241
+ const l = a(n);
242
242
  if (!l) {
243
- s.push(`${t}.bindings.${n} must be an object.`);
243
+ s.push(`${o}.bindings.${r} must be an object.`);
244
244
  return;
245
245
  }
246
246
  g(l.appliesToViewIds) || s.push(
247
- `${t}.bindings.${n}.appliesToViewIds must be an array of strings.`
247
+ `${o}.bindings.${r}.appliesToViewIds must be an array of strings.`
248
248
  ), s.push(
249
- ...d(
249
+ ...p(
250
250
  l.fieldRef,
251
- `${t}.bindings.${n}.fieldRef`
251
+ `${o}.bindings.${r}.fieldRef`
252
252
  )
253
253
  );
254
254
  }), s;
255
255
  }
256
- function _e(i, t) {
257
- const o = a(i);
258
- if (!o)
259
- return [`${t} must be an object.`];
256
+ function _e(i, o) {
257
+ const t = a(i);
258
+ if (!t)
259
+ return [`${o} must be an object.`];
260
260
  const s = [];
261
- if ((typeof o.id != "string" || !o.id.trim()) && s.push(`${t}.id is required.`), o.visualSpec !== void 0 && s.push(...Le(o.visualSpec, `${t}.visualSpec`)), o.computation !== void 0 && s.push(...Ye(o.computation, `${t}.computation`)), Ve(o))
262
- return o.fields !== void 0 && (Array.isArray(o.fields) ? o.fields.forEach((n, l) => {
263
- s.push(...d(n, `${t}.fields.${l}`));
264
- }) : s.push(`${t}.fields must be an array.`)), o.queryKind !== void 0 && s.push(`${t}.queryKind is not allowed for non-executable views.`), o.sdkBuilder !== void 0 && s.push(`${t}.sdkBuilder is not allowed for non-executable views.`), o.sdkSpec !== void 0 && s.push(`${t}.sdkSpec is not allowed for non-executable views.`), s;
265
- if (!Array.isArray(o.fields))
266
- return s.push(`${t}.fields must be an array.`), (o.sdkSpec !== void 0 || o.sdkBuilder !== void 0) && s.push(`${t}.fields must be an array for executable views.`), s;
267
- o.fields.forEach((n, l) => {
268
- s.push(...d(n, `${t}.fields.${l}`));
269
- }), $(o.queryKind) || s.push(`${t}.queryKind must be a supported codegen query kind.`), o.sdkBuilder !== void 0 && !J(o.sdkBuilder) && s.push(`${t}.sdkBuilder must be a supported SDK builder.`);
270
- const r = a(o.computation);
271
- return (r == null ? void 0 : r.kind) === "server_query" && $(o.queryKind) && $(r.queryKind) && r.queryKind !== o.queryKind && s.push(`${t}.computation.queryKind must match queryKind.`), s.push(
272
- ...Ee({
273
- value: o.sdkSpec,
274
- path: `${t}.sdkSpec`,
275
- queryKind: typeof o.queryKind == "string" ? o.queryKind : void 0,
276
- sdkBuilder: typeof o.sdkBuilder == "string" ? o.sdkBuilder : void 0
261
+ if ((typeof t.id != "string" || !t.id.trim()) && s.push(`${o}.id is required.`), t.visualSpec !== void 0 && s.push(...Ge(t.visualSpec, `${o}.visualSpec`)), t.computation !== void 0 && s.push(...We(t.computation, `${o}.computation`)), Le(t))
262
+ return s.push(...E(t, `${o}`)), t.fields !== void 0 && (Array.isArray(t.fields) ? t.fields.forEach((r, l) => {
263
+ s.push(...p(r, `${o}.fields.${l}`));
264
+ }) : s.push(`${o}.fields must be an array.`)), t.queryKind !== void 0 && s.push(`${o}.queryKind is not allowed for non-executable views.`), t.sdkBuilder !== void 0 && s.push(`${o}.sdkBuilder is not allowed for non-executable views.`), t.sdkSpec !== void 0 && s.push(`${o}.sdkSpec is not allowed for non-executable views.`), s;
265
+ if (!Array.isArray(t.fields))
266
+ return s.push(`${o}.fields must be an array.`), (t.sdkSpec !== void 0 || t.sdkBuilder !== void 0) && s.push(`${o}.fields must be an array for executable views.`), s.push(...E(t, `${o}`)), s;
267
+ t.fields.forEach((r, l) => {
268
+ s.push(...p(r, `${o}.fields.${l}`));
269
+ }), $(t.queryKind) || s.push(`${o}.queryKind must be a supported codegen query kind.`), t.sdkBuilder !== void 0 && !ee(t.sdkBuilder) && s.push(`${o}.sdkBuilder must be a supported SDK builder.`);
270
+ const n = a(t.computation);
271
+ return (n == null ? void 0 : n.kind) === "server_query" && $(t.queryKind) && $(n.queryKind) && n.queryKind !== t.queryKind && s.push(`${o}.computation.queryKind must match queryKind.`), s.push(
272
+ ...Fe({
273
+ value: t.sdkSpec,
274
+ path: `${o}.sdkSpec`,
275
+ queryKind: typeof t.queryKind == "string" ? t.queryKind : void 0,
276
+ sdkBuilder: typeof t.sdkBuilder == "string" ? t.sdkBuilder : void 0
277
277
  }),
278
- ...je(o, `${t}`)
278
+ ...E(t, `${o}`)
279
279
  ), s;
280
280
  }
281
- function je(i, t) {
282
- var L, G;
283
- const o = a((L = a(i.visualSpec)) == null ? void 0 : L.tableBehavior);
284
- if (!o)
285
- return [];
286
- const s = a(o.totals);
287
- if (!s)
288
- return [];
289
- const r = a(i.sdkSpec), n = a(r == null ? void 0 : r.spec), l = a(n == null ? void 0 : n.totals), u = [], p = typeof (r == null ? void 0 : r.builder) == "string" ? r.builder : void 0, me = (G = a(o.pagination)) == null ? void 0 : G.mode;
290
- return s.mode === "server" && (p !== "semaphor.records" && u.push(
291
- `${t}.visualSpec.tableBehavior.totals.mode server is only supported for semaphor.records views.`
281
+ function E(i, o) {
282
+ var G;
283
+ const t = a((G = a(i.visualSpec)) == null ? void 0 : G.tableBehavior), s = a(i.sdkSpec), n = a(s == null ? void 0 : s.spec), r = typeof (s == null ? void 0 : s.builder) == "string" ? s.builder : void 0, l = r === "semaphor.records" ? a(n == null ? void 0 : n.totals) : void 0, u = [];
284
+ if (!t)
285
+ return l && u.push(
286
+ `${o}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`
287
+ ), u;
288
+ const c = a(t.totals);
289
+ return c ? (c.mode === "server" && (r !== "semaphor.records" && u.push(
290
+ `${o}.visualSpec.tableBehavior.totals.mode server is only supported for semaphor.records views.`
292
291
  ), !l || l.mode !== "server" ? u.push(
293
- `${t}.sdkSpec.spec.totals.mode must be server when tableBehavior.totals.mode is server.`
292
+ `${o}.sdkSpec.spec.totals.mode must be server when tableBehavior.totals.mode is server.`
294
293
  ) : u.push(
295
- ...Re({
296
- left: s.measures,
294
+ ...je({
295
+ left: c.measures,
297
296
  right: l.measures,
298
- leftPath: `${t}.visualSpec.tableBehavior.totals.measures`,
299
- rightPath: `${t}.sdkSpec.spec.totals.measures`
297
+ leftPath: `${o}.visualSpec.tableBehavior.totals.measures`,
298
+ rightPath: `${o}.sdkSpec.spec.totals.measures`
300
299
  })
301
- )), s.mode !== "server" && l && u.push(
302
- `${t}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`
303
- ), s.mode === "local" && me === "server" && u.push(
304
- `${t}.visualSpec.tableBehavior.totals.mode must not be local for server-paginated tables.`
305
- ), p === "semaphor.sql" && s.mode !== "none" && u.push(
306
- `${t}.visualSpec.tableBehavior.totals.mode must be none for semaphor.sql views.`
307
- ), p === "semaphor.sql" && l && u.push(`${t}.sdkSpec.spec.totals is not supported for semaphor.sql.`), u;
300
+ )), c.mode !== "server" && l && u.push(
301
+ `${o}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`
302
+ ), r === "semaphor.sql" && c.mode !== "none" && u.push(
303
+ `${o}.visualSpec.tableBehavior.totals.mode must be none for semaphor.sql views.`
304
+ ), r === "semaphor.sql" && a(n == null ? void 0 : n.totals) && u.push(`${o}.sdkSpec.spec.totals is not supported for semaphor.sql.`), u) : (l && u.push(
305
+ `${o}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`
306
+ ), u);
308
307
  }
309
- function Re({
308
+ function je({
310
309
  left: i,
311
- right: t,
312
- leftPath: o,
310
+ right: o,
311
+ leftPath: t,
313
312
  rightPath: s
314
313
  }) {
315
- if (!Array.isArray(i) || !Array.isArray(t))
316
- return [`${s} must match ${o}.`];
317
- const r = [];
318
- return i.length !== t.length ? (r.push(`${s} must match ${o}.`), r) : (i.forEach((n, l) => {
319
- Ce(
320
- a(n),
321
- a(t[l])
322
- ) || r.push(`${s}.${l} must match ${o}.${l}.`);
323
- }), r);
314
+ if (!Array.isArray(i) || !Array.isArray(o))
315
+ return [`${s} must match ${t}.`];
316
+ const n = [];
317
+ return i.length !== o.length ? (n.push(`${s} must match ${t}.`), n) : (i.forEach((r, l) => {
318
+ Re(
319
+ a(r),
320
+ a(o[l])
321
+ ) || n.push(`${s}.${l} must match ${t}.${l}.`);
322
+ }), n);
324
323
  }
325
- function Ce(i, t) {
326
- return !i || !t ? !1 : i.name === t.name && (i.role || "measure") === (t.role || "measure") && U(i) === U(t) && qe(i, t);
324
+ function Re(i, o) {
325
+ return !i || !o ? !1 : i.name === o.name && (i.role || "measure") === (o.role || "measure") && U(i) === U(o) && Ce(i, o);
327
326
  }
328
327
  function U(i) {
329
328
  return typeof i.aggregate == "string" ? i.aggregate.toUpperCase() : "SUM";
330
329
  }
331
- function qe(i, t) {
332
- const o = typeof i.sourceKey == "string" ? i.sourceKey : void 0, s = typeof t.sourceKey == "string" ? t.sourceKey : void 0;
333
- if (o || s)
334
- return o === s;
335
- const r = a(i.source), n = a(t.source);
336
- return !r || !n || r.kind !== n.kind ? !1 : r.kind === "semantic" ? r.domainId === n.domainId && r.datasetName === n.datasetName && (r.datasetId === void 0 || n.datasetId === void 0 || r.datasetId === n.datasetId) : r.kind === "physical" ? r.connectionId === n.connectionId && r.tableName === n.tableName : r.kind === "sql" ? r.connectionId === n.connectionId : !1;
330
+ function Ce(i, o) {
331
+ const t = a(i.source), s = a(o.source);
332
+ if (qe(t, s))
333
+ return !1;
334
+ const n = z(i), r = z(o);
335
+ if (n.size > 0 || r.size > 0) {
336
+ for (const l of n)
337
+ if (r.has(l))
338
+ return !0;
339
+ return !1;
340
+ }
341
+ 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;
337
342
  }
338
- function xe(i, t) {
339
- const o = a(i);
340
- if (!o)
341
- return [`${t} must be an object.`];
343
+ function qe(i, o) {
344
+ if (!i || !o || i.kind !== "semantic" || o.kind !== "semantic")
345
+ return !1;
346
+ const t = typeof i.datasetId == "string" ? i.datasetId.trim() : "", s = typeof o.datasetId == "string" ? o.datasetId.trim() : "";
347
+ return !!(t && s && t !== s);
348
+ }
349
+ function z(i) {
350
+ const o = typeof i.sourceKey == "string" ? i.sourceKey.trim() : "";
351
+ return o ? /* @__PURE__ */ new Set([o]) : xe(a(i.source));
352
+ }
353
+ function xe(i) {
354
+ const o = /* @__PURE__ */ new Set();
355
+ if (!i)
356
+ return o;
357
+ const t = typeof i.sourceKey == "string" ? i.sourceKey.trim() : "";
358
+ if (t && o.add(t), i.kind === "semantic") {
359
+ const s = typeof i.domainId == "string" ? i.domainId : "", n = typeof i.datasetName == "string" ? i.datasetName : "", r = typeof i.datasetId == "string" ? i.datasetId : "";
360
+ s && r && o.add(`semantic:${s}:datasetId:${r}`), s && n && o.add(`semantic:${s}:datasetName:${n}`);
361
+ }
362
+ if (i.kind === "physical") {
363
+ const s = typeof i.connectionId == "string" ? i.connectionId : "", n = typeof i.tableName == "string" ? i.tableName : "", r = typeof i.databaseName == "string" ? i.databaseName : "", l = typeof i.schemaName == "string" ? i.schemaName : "";
364
+ s && n && (o.add(
365
+ ["physical", s, r, l, n].join(":")
366
+ ), o.add(`physical:${s}:${n}`));
367
+ }
368
+ if (i.kind === "sql") {
369
+ const s = typeof i.connectionId == "string" ? i.connectionId : "", n = typeof i.dialect == "string" ? i.dialect : "", r = typeof i.label == "string" ? i.label : "";
370
+ s && (o.add(["sql", s, n, r].join(":")), o.add(`sql:${s}`));
371
+ }
372
+ return o;
373
+ }
374
+ function Ee(i, o) {
375
+ const t = a(i);
376
+ if (!t)
377
+ return [`${o} must be an object.`];
342
378
  const s = [];
343
- if (o.fieldRef && s.push(
344
- ...d(o.fieldRef, `${t}.fieldRef`)
345
- ), (typeof o.inputId != "string" || !o.inputId.trim()) && s.push(`${t}.inputId is required.`), s.push(
346
- ...Z(o.optionQuery, `${t}.optionQuery`)
347
- ), g(o.appliesToViewIds) || s.push(`${t}.appliesToViewIds must be an array of strings.`), g(o.notAppliedToViewIds) || s.push(`${t}.notAppliedToViewIds must be an array of strings.`), !Array.isArray(o.bindings))
348
- s.push(`${t}.bindings must be an array.`);
379
+ if (t.fieldRef && s.push(
380
+ ...p(t.fieldRef, `${o}.fieldRef`)
381
+ ), (typeof t.inputId != "string" || !t.inputId.trim()) && s.push(`${o}.inputId is required.`), s.push(
382
+ ...X(t.optionQuery, `${o}.optionQuery`)
383
+ ), g(t.appliesToViewIds) || s.push(`${o}.appliesToViewIds must be an array of strings.`), g(t.notAppliedToViewIds) || s.push(`${o}.notAppliedToViewIds must be an array of strings.`), !Array.isArray(t.bindings))
384
+ s.push(`${o}.bindings must be an array.`);
349
385
  else {
350
- const r = g(o.appliesToViewIds) ? new Set(o.appliesToViewIds) : void 0, n = g(
351
- o.notAppliedToViewIds
352
- ) ? new Set(o.notAppliedToViewIds) : void 0;
353
- o.bindings.forEach((l, u) => {
354
- const p = a(l);
355
- if (!p) {
356
- s.push(`${t}.bindings.${u} must be an object.`);
386
+ const n = g(t.appliesToViewIds) ? new Set(t.appliesToViewIds) : void 0, r = g(
387
+ t.notAppliedToViewIds
388
+ ) ? new Set(t.notAppliedToViewIds) : void 0;
389
+ t.bindings.forEach((l, u) => {
390
+ const c = a(l);
391
+ if (!c) {
392
+ s.push(`${o}.bindings.${u} must be an object.`);
357
393
  return;
358
394
  }
359
- typeof p.viewId != "string" || !p.viewId ? s.push(`${t}.bindings.${u}.viewId is required.`) : (r && !r.has(p.viewId) && s.push(
360
- `${t}.bindings.${u}.viewId must be included in appliesToViewIds.`
361
- ), n != null && n.has(p.viewId) && s.push(
362
- `${t}.bindings.${u}.viewId must not be listed in notAppliedToViewIds.`
395
+ typeof c.viewId != "string" || !c.viewId ? s.push(`${o}.bindings.${u}.viewId is required.`) : (n && !n.has(c.viewId) && s.push(
396
+ `${o}.bindings.${u}.viewId must be included in appliesToViewIds.`
397
+ ), r != null && r.has(c.viewId) && s.push(
398
+ `${o}.bindings.${u}.viewId must not be listed in notAppliedToViewIds.`
363
399
  )), s.push(
364
- ...d(
365
- p.fieldRef,
366
- `${t}.bindings.${u}.fieldRef`
400
+ ...p(
401
+ c.fieldRef,
402
+ `${o}.bindings.${u}.fieldRef`
367
403
  )
368
404
  );
369
405
  });
370
406
  }
371
407
  return s;
372
408
  }
373
- function Z(i, t) {
409
+ function X(i, o) {
374
410
  if (i === void 0)
375
411
  return [];
376
- const o = a(i);
377
- if (!o)
378
- return [`${t} must be an object.`];
412
+ const t = a(i);
413
+ if (!t)
414
+ return [`${o} must be an object.`];
379
415
  const s = [
380
416
  ...h(
381
- o.valueFieldRef,
382
- `${t}.valueFieldRef`
417
+ t.valueFieldRef,
418
+ `${o}.valueFieldRef`
383
419
  ),
384
420
  ...h(
385
- o.labelFieldRef,
386
- `${t}.labelFieldRef`
421
+ t.labelFieldRef,
422
+ `${o}.labelFieldRef`
387
423
  ),
388
424
  ...h(
389
- o.filterFieldRef,
390
- `${t}.filterFieldRef`
425
+ t.filterFieldRef,
426
+ `${o}.filterFieldRef`
391
427
  )
392
428
  ];
393
- return o.builder !== "semaphor.inputOptions" && s.push(`${t}.builder must be semaphor.inputOptions.`), typeof o.sourceKey != "string" && o.source === void 0 && s.push(`${t} must include source or sourceKey.`), o.source !== void 0 && s.push(...w(o.source, `${t}.source`)), a(o.valueFieldRef) || s.push(`${t}.valueFieldRef is required.`), a(o.labelFieldRef) || s.push(`${t}.labelFieldRef is required.`), o.limit !== void 0 && (typeof o.limit != "number" || !Number.isInteger(o.limit) || o.limit <= 0) && s.push(`${t}.limit must be a positive integer.`), s;
429
+ return t.builder !== "semaphor.inputOptions" && s.push(`${o}.builder must be semaphor.inputOptions.`), typeof t.sourceKey != "string" && t.source === void 0 && s.push(`${o} must include source or sourceKey.`), t.source !== void 0 && s.push(...w(t.source, `${o}.source`)), a(t.valueFieldRef) || s.push(`${o}.valueFieldRef is required.`), a(t.labelFieldRef) || s.push(`${o}.labelFieldRef is required.`), t.limit !== void 0 && (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit <= 0) && s.push(`${o}.limit must be a positive integer.`), s;
394
430
  }
395
- function Ee(i) {
396
- var r;
397
- const t = a(i.value);
398
- if (!t)
431
+ function Fe(i) {
432
+ var n;
433
+ const o = a(i.value);
434
+ if (!o)
399
435
  return [`${i.path} is required for executable views.`];
400
- const o = [];
401
- if (!J(t.builder))
402
- return o.push(`${i.path}.builder must be a supported SDK builder.`), o;
403
- i.sdkBuilder && t.builder !== i.sdkBuilder && o.push(`${i.path}.builder must match sdkBuilder.`), i.queryKind && $(i.queryKind) && t.builder !== Pe(i.queryKind) && o.push(`${i.path}.builder must match queryKind.`);
404
- const s = a(t.spec);
436
+ const t = [];
437
+ if (!ee(o.builder))
438
+ return t.push(`${i.path}.builder must be a supported SDK builder.`), t;
439
+ i.sdkBuilder && o.builder !== i.sdkBuilder && t.push(`${i.path}.builder must match sdkBuilder.`), i.queryKind && $(i.queryKind) && o.builder !== Ve(i.queryKind) && t.push(`${i.path}.builder must match queryKind.`);
440
+ const s = a(o.spec);
405
441
  if (!s)
406
- return o.push(`${i.path}.spec must be an object.`), o;
407
- switch (t.builder) {
442
+ return t.push(`${i.path}.spec must be an object.`), t;
443
+ switch (o.builder) {
408
444
  case "semaphor.metric":
409
- o.push(
410
- ...v(s, Y, `${i.path}.spec`),
411
- ...I(s, i.path),
412
- ...E(s.measures, `${i.path}.spec.measures`),
445
+ t.push(
446
+ ...v(s, W, `${i.path}.spec`),
447
+ ...A(s, i.path),
448
+ ...F(s.measures, `${i.path}.spec.measures`),
413
449
  ...h(
414
450
  s.primaryMeasure,
415
451
  `${i.path}.spec.primaryMeasure`
@@ -418,7 +454,7 @@ function Ee(i) {
418
454
  s.dateField,
419
455
  `${i.path}.spec.dateField`
420
456
  ),
421
- ...F(
457
+ ...N(
422
458
  s.dimensions,
423
459
  `${i.path}.spec.dimensions`
424
460
  ),
@@ -427,10 +463,10 @@ function Ee(i) {
427
463
  );
428
464
  break;
429
465
  case "semaphor.analysis":
430
- o.push(
466
+ t.push(
431
467
  ...v(s, be, `${i.path}.spec`),
432
- ...I(s, i.path),
433
- ...E(s.measures, `${i.path}.spec.measures`),
468
+ ...A(s, i.path),
469
+ ...F(s.measures, `${i.path}.spec.measures`),
434
470
  ...h(
435
471
  s.primaryMeasure,
436
472
  `${i.path}.spec.primaryMeasure`
@@ -439,20 +475,20 @@ function Ee(i) {
439
475
  s.dateField,
440
476
  `${i.path}.spec.dateField`
441
477
  ),
442
- ...F(
478
+ ...N(
443
479
  s.dimensions,
444
480
  `${i.path}.spec.dimensions`
445
481
  ),
446
482
  ...T(s.orderBy, `${i.path}.spec.orderBy`),
447
483
  ..._(s.filters, `${i.path}.spec.filters`),
448
- ...Fe(s, `${i.path}.spec`)
484
+ ...Ne(s, `${i.path}.spec`)
449
485
  );
450
486
  break;
451
487
  case "semaphor.records":
452
- o.push(
488
+ t.push(
453
489
  ...v(s, ye, `${i.path}.spec`),
454
- ...I(s, i.path),
455
- ...E(s.fields, `${i.path}.spec.fields`),
490
+ ...A(s, i.path),
491
+ ...F(s.fields, `${i.path}.spec.fields`),
456
492
  ...h(
457
493
  s.dateField,
458
494
  `${i.path}.spec.dateField`
@@ -466,206 +502,206 @@ function Ee(i) {
466
502
  );
467
503
  break;
468
504
  case "semaphor.matrix":
469
- o.push(
505
+ t.push(
470
506
  ...v(s, ve, `${i.path}.spec`),
471
507
  ...De(s, i.path),
472
- ...Ne(s.rows, `${i.path}.spec.rows`),
508
+ ...Ke(s.rows, `${i.path}.spec.rows`),
473
509
  ...Oe(
474
510
  s.columns,
475
511
  `${i.path}.spec.columns`
476
512
  ),
477
- ...Ke(s.values, `${i.path}.spec.values`),
478
- ...Me(s.sort, `${i.path}.spec.sort`),
513
+ ...Me(s.values, `${i.path}.spec.values`),
514
+ ...Be(s.sort, `${i.path}.spec.sort`),
479
515
  ..._(s.filters, `${i.path}.spec.filters`)
480
516
  );
481
517
  break;
482
518
  case "semaphor.sql":
483
- o.push(
519
+ t.push(
484
520
  ...v(s, $e, `${i.path}.spec`),
485
- ...I(s, i.path)
486
- ), ((r = a(s.source)) == null ? void 0 : r.kind) !== "sql" && o.push(`${i.path}.spec.source.kind must be sql.`), (typeof s.sql != "string" || !s.sql.trim()) && o.push(`${i.path}.spec.sql is required.`), o.push(
487
- ...F(
521
+ ...A(s, i.path)
522
+ ), ((n = a(s.source)) == null ? void 0 : n.kind) !== "sql" && t.push(`${i.path}.spec.source.kind must be sql.`), (typeof s.sql != "string" || !s.sql.trim()) && t.push(`${i.path}.spec.sql is required.`), t.push(
523
+ ...N(
488
524
  s.fields,
489
525
  `${i.path}.spec.fields`
490
526
  )
491
527
  );
492
528
  break;
493
529
  }
494
- return o;
530
+ return t;
495
531
  }
496
- function Fe(i, t) {
497
- const o = [];
498
- if (i.driverMode !== void 0 && !fe.has(i.driverMode) && o.push(`${t}.driverMode must be a supported analysis driver mode.`), i.includePopulation !== void 0 && typeof i.includePopulation != "boolean" && o.push(`${t}.includePopulation must be a boolean.`), i.calendarContext !== void 0) {
532
+ function Ne(i, o) {
533
+ const t = [];
534
+ if (i.driverMode !== void 0 && !fe.has(i.driverMode) && t.push(`${o}.driverMode must be a supported analysis driver mode.`), i.includePopulation !== void 0 && typeof i.includePopulation != "boolean" && t.push(`${o}.includePopulation must be a boolean.`), i.calendarContext !== void 0) {
499
535
  const s = a(i.calendarContext);
500
536
  if (!s)
501
- o.push(`${t}.calendarContext must be an object.`);
537
+ t.push(`${o}.calendarContext must be an object.`);
502
538
  else {
503
- s.tz !== void 0 && typeof s.tz != "string" && o.push(`${t}.calendarContext.tz must be a string.`), s.weekStart !== void 0 && (typeof s.weekStart != "number" || !Number.isInteger(s.weekStart) || s.weekStart < 0 || s.weekStart > 6) && o.push(
504
- `${t}.calendarContext.weekStart must be an integer between 0 and 6.`
539
+ s.tz !== void 0 && typeof s.tz != "string" && t.push(`${o}.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(
540
+ `${o}.calendarContext.weekStart must be an integer between 0 and 6.`
505
541
  );
506
- const r = s.anchor;
507
- if (r !== void 0 && r !== "now") {
508
- const n = a(r);
509
- (!n || typeof n.iso != "string" || !n.iso.trim()) && o.push(`${t}.calendarContext.anchor must be now or { iso }.`);
542
+ const n = s.anchor;
543
+ if (n !== void 0 && n !== "now") {
544
+ const r = a(n);
545
+ (!r || typeof r.iso != "string" || !r.iso.trim()) && t.push(`${o}.calendarContext.anchor must be now or { iso }.`);
510
546
  }
511
547
  }
512
548
  }
513
- return o;
549
+ return t;
514
550
  }
515
- function Te(i, t) {
551
+ function Te(i, o) {
516
552
  if (i === void 0)
517
553
  return [];
518
- const o = a(i);
519
- if (!o)
520
- return [`${t} must be an object.`];
554
+ const t = a(i);
555
+ if (!t)
556
+ return [`${o} must be an object.`];
521
557
  const s = [];
522
- return o.mode !== "server" && s.push(`${t}.mode must be server.`), !Array.isArray(o.measures) || o.measures.length === 0 ? s.push(`${t}.measures must include at least one measure.`) : o.measures.forEach((r, n) => {
558
+ return t.mode !== "server" && s.push(`${o}.mode must be server.`), !Array.isArray(t.measures) || t.measures.length === 0 ? s.push(`${o}.measures must include at least one measure.`) : t.measures.forEach((n, r) => {
523
559
  var l;
524
560
  s.push(
525
- ...ee(
526
- r,
527
- `${t}.measures.${n}`
561
+ ...te(
562
+ n,
563
+ `${o}.measures.${r}`
528
564
  )
529
- ), ((l = a(r)) == null ? void 0 : l.role) !== "measure" && s.push(`${t}.measures.${n}.role must be measure.`);
565
+ ), ((l = a(n)) == null ? void 0 : l.role) !== "measure" && s.push(`${o}.measures.${r}.role must be measure.`);
530
566
  }), s;
531
567
  }
532
- function v(i, t, o) {
568
+ function v(i, o, t) {
533
569
  const s = [];
534
- return Object.keys(i).forEach((r) => {
535
- t.has(r) || s.push(`${o}.${r} is not supported for this SDK builder.`);
570
+ return Object.keys(i).forEach((n) => {
571
+ o.has(n) || s.push(`${t}.${n} is not supported for this SDK builder.`);
536
572
  }), s;
537
573
  }
538
- function I(i, t) {
539
- return a(i.source) ? w(i.source, `${t}.spec.source`) : [`${t}.spec.source must be an object.`];
574
+ function A(i, o) {
575
+ return a(i.source) ? w(i.source, `${o}.spec.source`) : [`${o}.spec.source must be an object.`];
540
576
  }
541
- function De(i, t) {
542
- const o = a(i.source);
543
- if (!o)
544
- return [`${t}.spec.source must be an object.`];
545
- const s = w(i.source, `${t}.spec.source`);
546
- return o.kind !== "semantic" && o.kind !== "physical" && s.push(`${t}.spec.source.kind must be semantic or physical.`), s;
577
+ function De(i, o) {
578
+ const t = a(i.source);
579
+ if (!t)
580
+ return [`${o}.spec.source must be an object.`];
581
+ const s = w(i.source, `${o}.spec.source`);
582
+ return t.kind !== "semantic" && t.kind !== "physical" && s.push(`${o}.spec.source.kind must be semantic or physical.`), s;
547
583
  }
548
- function E(i, t) {
549
- const o = B(i, t);
550
- return Array.isArray(i) && i.forEach((s, r) => {
551
- o.push(...d(s, `${t}.${r}`));
552
- }), o;
584
+ function F(i, o) {
585
+ const t = P(i, o);
586
+ return Array.isArray(i) && i.forEach((s, n) => {
587
+ t.push(...p(s, `${o}.${n}`));
588
+ }), t;
553
589
  }
554
- function F(i, t) {
590
+ function N(i, o) {
555
591
  if (i === void 0)
556
592
  return [];
557
593
  if (!Array.isArray(i))
558
- return [`${t} must be an array.`];
559
- const o = [];
560
- return i.forEach((s, r) => {
561
- o.push(...d(s, `${t}.${r}`));
562
- }), o;
594
+ return [`${o} must be an array.`];
595
+ const t = [];
596
+ return i.forEach((s, n) => {
597
+ t.push(...p(s, `${o}.${n}`));
598
+ }), t;
563
599
  }
564
- function T(i, t) {
600
+ function T(i, o) {
565
601
  if (i === void 0)
566
602
  return [];
567
- const o = a(i);
568
- return o ? [
569
- ...d(o.field, `${t}.field`),
570
- ...X(o.direction, `${t}.direction`)
571
- ] : [`${t} must be an object.`];
603
+ const t = a(i);
604
+ return t ? [
605
+ ...p(t.field, `${o}.field`),
606
+ ...J(t.direction, `${o}.direction`)
607
+ ] : [`${o} must be an object.`];
572
608
  }
573
- function Ne(i, t) {
574
- const o = B(i, t);
575
- return Array.isArray(i) && i.forEach((s, r) => {
576
- const n = a(s);
577
- if (!n) {
578
- o.push(`${t}.${r} must be an object.`);
609
+ function Ke(i, o) {
610
+ const t = P(i, o);
611
+ return Array.isArray(i) && i.forEach((s, n) => {
612
+ const r = a(s);
613
+ if (!r) {
614
+ t.push(`${o}.${n} must be an object.`);
579
615
  return;
580
616
  }
581
- o.push(
582
- ...d(n.field, `${t}.${r}.field`)
617
+ t.push(
618
+ ...p(r.field, `${o}.${n}.field`)
583
619
  );
584
- }), o;
620
+ }), t;
585
621
  }
586
- function Oe(i, t) {
622
+ function Oe(i, o) {
587
623
  if (i === void 0)
588
624
  return [];
589
- const o = [];
590
- return Array.isArray(i) ? (i.forEach((s, r) => {
591
- const n = a(s);
592
- if (!n) {
593
- o.push(`${t}.${r} must be an object.`);
625
+ const t = [];
626
+ return Array.isArray(i) ? (i.forEach((s, n) => {
627
+ const r = a(s);
628
+ if (!r) {
629
+ t.push(`${o}.${n} must be an object.`);
594
630
  return;
595
631
  }
596
- o.push(
597
- ...d(n.field, `${t}.${r}.field`)
632
+ t.push(
633
+ ...p(r.field, `${o}.${n}.field`)
598
634
  );
599
- }), o) : [`${t} must be an array.`];
635
+ }), t) : [`${o} must be an array.`];
600
636
  }
601
- function Ke(i, t) {
602
- const o = B(i, t);
603
- return Array.isArray(i) && i.forEach((s, r) => {
604
- const n = a(s);
605
- if (!n) {
606
- o.push(`${t}.${r} must be an object.`);
637
+ function Me(i, o) {
638
+ const t = P(i, o);
639
+ return Array.isArray(i) && i.forEach((s, n) => {
640
+ const r = a(s);
641
+ if (!r) {
642
+ t.push(`${o}.${n} must be an object.`);
607
643
  return;
608
644
  }
609
- o.push(
610
- ...d(n.field, `${t}.${r}.field`)
645
+ t.push(
646
+ ...p(r.field, `${o}.${n}.field`)
611
647
  );
612
- }), o;
648
+ }), t;
613
649
  }
614
- function Me(i, t) {
650
+ function Be(i, o) {
615
651
  if (i === void 0)
616
652
  return [];
617
653
  if (!Array.isArray(i))
618
- return [`${t} must be an array.`];
619
- const o = [];
620
- return i.forEach((s, r) => {
621
- const n = a(s);
622
- if (!n) {
623
- o.push(`${t}.${r} must be an object.`);
654
+ return [`${o} must be an array.`];
655
+ const t = [];
656
+ return i.forEach((s, n) => {
657
+ const r = a(s);
658
+ if (!r) {
659
+ t.push(`${o}.${n} must be an object.`);
624
660
  return;
625
661
  }
626
- n.axis !== "row" && n.axis !== "column" && o.push(`${t}.${r}.axis must be row or column.`), o.push(
627
- ...X(n.direction, `${t}.${r}.direction`),
628
- ...Be(n.by, `${t}.${r}.by`)
662
+ r.axis !== "row" && r.axis !== "column" && t.push(`${o}.${n}.axis must be row or column.`), t.push(
663
+ ...J(r.direction, `${o}.${n}.direction`),
664
+ ...Pe(r.by, `${o}.${n}.by`)
629
665
  );
630
- }), o;
666
+ }), t;
631
667
  }
632
- function Be(i, t) {
633
- const o = a(i);
634
- if (!o)
635
- return [`${t} must be an object.`];
636
- switch (o.kind) {
668
+ function Pe(i, o) {
669
+ const t = a(i);
670
+ if (!t)
671
+ return [`${o} must be an object.`];
672
+ switch (t.kind) {
637
673
  case "label":
638
674
  return [];
639
675
  case "field":
640
- return d(o.field, `${t}.field`);
676
+ return p(t.field, `${o}.field`);
641
677
  case "value":
642
- return typeof o.valueId != "string" || !o.valueId.trim() ? [`${t}.valueId is required.`] : [];
678
+ return typeof t.valueId != "string" || !t.valueId.trim() ? [`${o}.valueId is required.`] : [];
643
679
  default:
644
- return [`${t}.kind must be label, field, or value.`];
680
+ return [`${o}.kind must be label, field, or value.`];
645
681
  }
646
682
  }
647
- function X(i, t) {
648
- return i === "asc" || i === "desc" ? [] : [`${t} must be asc or desc.`];
683
+ function J(i, o) {
684
+ return i === "asc" || i === "desc" ? [] : [`${o} must be asc or desc.`];
649
685
  }
650
- function _(i, t) {
686
+ function _(i, o) {
651
687
  if (i === void 0)
652
688
  return [];
653
689
  if (!Array.isArray(i))
654
- return [`${t} must be an array.`];
655
- const o = [];
656
- return i.forEach((s, r) => {
657
- const n = a(s);
658
- if (!n) {
659
- o.push(`${t}.${r} must be an object.`);
690
+ return [`${o} must be an array.`];
691
+ const t = [];
692
+ return i.forEach((s, n) => {
693
+ const r = a(s);
694
+ if (!r) {
695
+ t.push(`${o}.${n} must be an object.`);
660
696
  return;
661
697
  }
662
- o.push(...d(n.field, `${t}.${r}.field`));
663
- }), o;
698
+ t.push(...p(r.field, `${o}.${n}.field`));
699
+ }), t;
664
700
  }
665
- function B(i, t) {
666
- return !Array.isArray(i) || i.length === 0 ? [`${t} must be a non-empty array.`] : [];
701
+ function P(i, o) {
702
+ return !Array.isArray(i) || i.length === 0 ? [`${o} must be a non-empty array.`] : [];
667
703
  }
668
- function Pe(i) {
704
+ function Ve(i) {
669
705
  switch (i) {
670
706
  case "metric":
671
707
  return "semaphor.metric";
@@ -679,176 +715,176 @@ function Pe(i) {
679
715
  return "semaphor.sql";
680
716
  }
681
717
  }
682
- function Ve(i) {
683
- const t = a(i.computation), o = a(i.visualSpec);
684
- return (t == null ? void 0 : t.kind) === "presentation_only" || (t == null ? void 0 : t.kind) === "derived" || (t == null ? void 0 : t.kind) === "unsupported" || i.visual === "text_block" || (o == null ? void 0 : o.visualType) === "text_block";
718
+ function Le(i) {
719
+ const o = a(i.computation), t = a(i.visualSpec);
720
+ return (o == null ? void 0 : o.kind) === "presentation_only" || (o == null ? void 0 : o.kind) === "derived" || (o == null ? void 0 : o.kind) === "unsupported" || i.visual === "text_block" || (t == null ? void 0 : t.visualType) === "text_block";
685
721
  }
686
- function Le(i, t) {
687
- const o = a(i);
688
- if (!o)
689
- return [`${t} must be an object.`];
722
+ function Ge(i, o) {
723
+ const t = a(i);
724
+ if (!t)
725
+ return [`${o} must be an object.`];
690
726
  const s = [];
691
- return Se.has(o.visualType) || s.push(`${t}.visualType must be a supported visual type.`), o.limit !== void 0 && (typeof o.limit != "number" || !Number.isInteger(o.limit) || o.limit <= 0) && s.push(`${t}.limit must be a positive integer.`), o.tableBehavior !== void 0 && s.push(
692
- ...Ge(
693
- o.tableBehavior,
694
- `${t}.tableBehavior`
727
+ return Se.has(t.visualType) || s.push(`${o}.visualType must be a supported visual type.`), t.limit !== void 0 && (typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit <= 0) && s.push(`${o}.limit must be a positive integer.`), t.tableBehavior !== void 0 && s.push(
728
+ ...Ue(
729
+ t.tableBehavior,
730
+ `${o}.tableBehavior`
695
731
  )
696
732
  ), s;
697
733
  }
698
- function Ge(i, t) {
699
- const o = a(i);
700
- if (!o)
701
- return [`${t} must be an object.`];
734
+ function Ue(i, o) {
735
+ const t = a(i);
736
+ if (!t)
737
+ return [`${o} must be an object.`];
702
738
  const s = [];
703
- return o.tableMode !== "bounded" && o.tableMode !== "server_paginated" && o.tableMode !== "server_windowed" && s.push(`${t}.tableMode must be a supported table mode.`), s.push(
704
- ...Ue(o.height, `${t}.height`),
705
- ...ze(o.pagination, `${t}.pagination`),
706
- ...He(o.sorting, `${t}.sorting`),
707
- ...Qe(o.totals, `${t}.totals`)
708
- ), typeof o.serverSideRequired != "boolean" && s.push(`${t}.serverSideRequired must be a boolean.`), s;
739
+ return t.tableMode !== "bounded" && t.tableMode !== "server_paginated" && t.tableMode !== "server_windowed" && s.push(`${o}.tableMode must be a supported table mode.`), s.push(
740
+ ...ze(t.height, `${o}.height`),
741
+ ...He(t.pagination, `${o}.pagination`),
742
+ ...Qe(t.sorting, `${o}.sorting`),
743
+ ...Ye(t.totals, `${o}.totals`)
744
+ ), typeof t.serverSideRequired != "boolean" && s.push(`${o}.serverSideRequired must be a boolean.`), s;
709
745
  }
710
- function Ue(i, t) {
711
- const o = a(i);
712
- if (!o)
713
- return [`${t} must be an object.`];
746
+ function ze(i, o) {
747
+ const t = a(i);
748
+ if (!t)
749
+ return [`${o} must be an object.`];
714
750
  const s = [];
715
- return (typeof o.maxPx != "number" || !Number.isInteger(o.maxPx) || o.maxPx <= 0) && s.push(`${t}.maxPx must be a positive integer.`), o.scroll !== "vertical" && o.scroll !== "both" && s.push(`${t}.scroll must be vertical or both.`), typeof o.stickyHeader != "boolean" && s.push(`${t}.stickyHeader must be a boolean.`), s;
751
+ return (typeof t.maxPx != "number" || !Number.isInteger(t.maxPx) || t.maxPx <= 0) && s.push(`${o}.maxPx must be a positive integer.`), t.scroll !== "vertical" && t.scroll !== "both" && s.push(`${o}.scroll must be vertical or both.`), typeof t.stickyHeader != "boolean" && s.push(`${o}.stickyHeader must be a boolean.`), s;
716
752
  }
717
- function ze(i, t) {
718
- const o = a(i);
719
- if (!o)
720
- return [`${t} must be an object.`];
753
+ function He(i, o) {
754
+ const t = a(i);
755
+ if (!t)
756
+ return [`${o} must be an object.`];
721
757
  const s = [];
722
- return o.mode !== "none" && o.mode !== "server" && o.mode !== "client_for_bounded_rows" && s.push(`${t}.mode must be a supported pagination mode.`), o.pageSize !== void 0 && (typeof o.pageSize != "number" || !Number.isInteger(o.pageSize) || o.pageSize <= 0) && s.push(`${t}.pageSize must be a positive integer.`), o.readsFrom !== void 0 && o.readsFrom !== "result.pagination" && s.push(`${t}.readsFrom must be result.pagination.`), s;
758
+ return t.mode !== "none" && t.mode !== "server" && t.mode !== "client_for_bounded_rows" && s.push(`${o}.mode must be a supported pagination mode.`), t.pageSize !== void 0 && (typeof t.pageSize != "number" || !Number.isInteger(t.pageSize) || t.pageSize <= 0) && s.push(`${o}.pageSize must be a positive integer.`), t.readsFrom !== void 0 && t.readsFrom !== "result.pagination" && s.push(`${o}.readsFrom must be result.pagination.`), s;
723
759
  }
724
- function He(i, t) {
725
- const o = a(i);
726
- if (!o)
727
- return [`${t} must be an object.`];
760
+ function Qe(i, o) {
761
+ const t = a(i);
762
+ if (!t)
763
+ return [`${o} must be an object.`];
728
764
  const s = [];
729
- return o.mode !== "server" && o.mode !== "client_for_bounded_rows" && s.push(`${t}.mode must be a supported sorting mode.`), o.defaultField !== void 0 && (typeof o.defaultField != "string" || !o.defaultField.trim()) && s.push(`${t}.defaultField must be a non-empty string.`), o.defaultDirection !== void 0 && o.defaultDirection !== "asc" && o.defaultDirection !== "desc" && s.push(`${t}.defaultDirection must be asc or desc.`), o.resetPageOnChange !== void 0 && typeof o.resetPageOnChange != "boolean" && s.push(`${t}.resetPageOnChange must be a boolean.`), s;
765
+ return t.mode !== "server" && t.mode !== "client_for_bounded_rows" && s.push(`${o}.mode must be a supported sorting mode.`), t.defaultField !== void 0 && (typeof t.defaultField != "string" || !t.defaultField.trim()) && s.push(`${o}.defaultField must be a non-empty string.`), t.defaultDirection !== void 0 && t.defaultDirection !== "asc" && t.defaultDirection !== "desc" && s.push(`${o}.defaultDirection must be asc or desc.`), t.resetPageOnChange !== void 0 && typeof t.resetPageOnChange != "boolean" && s.push(`${o}.resetPageOnChange must be a boolean.`), s;
730
766
  }
731
- function Qe(i, t) {
732
- const o = a(i);
733
- if (!o)
734
- return [`${t} must be an object.`];
767
+ function Ye(i, o) {
768
+ const t = a(i);
769
+ if (!t)
770
+ return [`${o} must be an object.`];
735
771
  const s = [];
736
- return o.mode !== "none" && o.mode !== "server" && o.mode !== "local" ? (s.push(`${t}.mode must be none, server, or local.`), s) : o.mode === "none" ? (o.measures !== void 0 && s.push(`${t}.measures is not allowed when mode is none.`), o.label !== void 0 && s.push(`${t}.label is not allowed when mode is none.`), s) : o.mode === "server" ? (!Array.isArray(o.measures) || o.measures.length === 0 ? s.push(`${t}.measures must include at least one measure when mode is server.`) : o.measures.forEach((r, n) => {
772
+ return t.mode !== "none" && t.mode !== "server" && t.mode !== "local" ? (s.push(`${o}.mode must be none, server, or local.`), s) : t.mode === "none" ? (t.measures !== void 0 && s.push(`${o}.measures is not allowed when mode is none.`), t.label !== void 0 && s.push(`${o}.label is not allowed when mode is none.`), s) : t.mode === "server" ? (!Array.isArray(t.measures) || t.measures.length === 0 ? s.push(`${o}.measures must include at least one measure when mode is server.`) : t.measures.forEach((n, r) => {
737
773
  var l;
738
774
  s.push(
739
- ...ee(
740
- r,
741
- `${t}.measures.${n}`
775
+ ...te(
776
+ n,
777
+ `${o}.measures.${r}`
742
778
  )
743
- ), ((l = a(r)) == null ? void 0 : l.role) !== "measure" && s.push(`${t}.measures.${n}.role must be measure.`);
744
- }), o.label !== void 0 && s.push(`${t}.label is not allowed when mode is server.`), s) : (o.mode === "local" && (o.label !== "Displayed rows" && o.label !== "Current page" && s.push(`${t}.label must be Displayed rows or Current page when mode is local.`), o.measures !== void 0 && s.push(`${t}.measures is not allowed when mode is local.`)), s);
779
+ ), ((l = a(n)) == null ? void 0 : l.role) !== "measure" && s.push(`${o}.measures.${r}.role must be measure.`);
780
+ }), t.label !== void 0 && s.push(`${o}.label is not allowed when mode is server.`), s) : (t.mode === "local" && (t.label !== "Displayed rows" && t.label !== "Current page" && s.push(`${o}.label must be Displayed rows or Current page when mode is local.`), t.measures !== void 0 && s.push(`${o}.measures is not allowed when mode is local.`)), s);
745
781
  }
746
- function Ye(i, t) {
747
- const o = a(i);
748
- if (!o)
749
- return [`${t} must be an object.`];
782
+ function We(i, o) {
783
+ const t = a(i);
784
+ if (!t)
785
+ return [`${o} must be an object.`];
750
786
  const s = [];
751
- switch (o.kind) {
787
+ switch (t.kind) {
752
788
  case "server_query":
753
- $(o.queryKind) || s.push(`${t}.queryKind must be a supported codegen query kind.`), o.queryOwnership !== void 0 && o.queryOwnership !== "view_owned" && o.queryOwnership !== "shared_query" && s.push(
754
- `${t}.queryOwnership must be view_owned or shared_query.`
755
- ), o.sourceKeys !== void 0 && !g(o.sourceKeys) && s.push(`${t}.sourceKeys must be an array of strings.`), o.fieldNames !== void 0 && !g(o.fieldNames) && s.push(`${t}.fieldNames must be an array of strings.`);
789
+ $(t.queryKind) || s.push(`${o}.queryKind must be a supported codegen query kind.`), t.queryOwnership !== void 0 && t.queryOwnership !== "view_owned" && t.queryOwnership !== "shared_query" && s.push(
790
+ `${o}.queryOwnership must be view_owned or shared_query.`
791
+ ), t.sourceKeys !== void 0 && !g(t.sourceKeys) && s.push(`${o}.sourceKeys must be an array of strings.`), t.fieldNames !== void 0 && !g(t.fieldNames) && s.push(`${o}.fieldNames must be an array of strings.`);
756
792
  break;
757
793
  case "derived":
758
- (typeof o.upstreamViewId != "string" || !o.upstreamViewId.trim()) && s.push(`${t}.upstreamViewId is required.`), (typeof o.derivation != "string" || !o.derivation.trim()) && s.push(`${t}.derivation is required.`);
794
+ (typeof t.upstreamViewId != "string" || !t.upstreamViewId.trim()) && s.push(`${o}.upstreamViewId is required.`), (typeof t.derivation != "string" || !t.derivation.trim()) && s.push(`${o}.derivation is required.`);
759
795
  break;
760
796
  case "presentation_only":
761
797
  break;
762
798
  case "unsupported":
763
- (typeof o.reason != "string" || !o.reason.trim()) && s.push(`${t}.reason is required.`), (typeof o.suggestedModelingFix != "string" || !o.suggestedModelingFix.trim()) && s.push(`${t}.suggestedModelingFix is required.`);
799
+ (typeof t.reason != "string" || !t.reason.trim()) && s.push(`${o}.reason is required.`), (typeof t.suggestedModelingFix != "string" || !t.suggestedModelingFix.trim()) && s.push(`${o}.suggestedModelingFix is required.`);
764
800
  break;
765
801
  default:
766
- s.push(`${t}.kind must be a supported computation kind.`);
802
+ s.push(`${o}.kind must be a supported computation kind.`);
767
803
  }
768
804
  return s;
769
805
  }
770
- function We(i, t) {
771
- const o = a(i);
772
- if (!o)
773
- return [`${t} must be an object.`];
806
+ function Ze(i, o) {
807
+ const t = a(i);
808
+ if (!t)
809
+ return [`${o} must be an object.`];
774
810
  const s = [];
775
- for (const n of ["title", "requestedQuestion", "suggestedModelingFix"])
776
- (typeof o[n] != "string" || !o[n].trim()) && s.push(`${t}.${n} is required.`);
777
- return we.has(o.reason) || s.push(`${t}.reason must be a supported unsupported insight reason.`), (o.relationshipCandidate !== void 0 || o.nextRepairAction !== void 0) && o.reason !== "missing_relationship" && s.push(
778
- `${t} relationship repair metadata is only valid for missing_relationship unsupported insights.`
779
- ), o.relationshipCandidate !== void 0 && s.push(
780
- ...Xe(
781
- o.relationshipCandidate,
782
- `${t}.relationshipCandidate`
811
+ for (const r of ["title", "requestedQuestion", "suggestedModelingFix"])
812
+ (typeof t[r] != "string" || !t[r].trim()) && s.push(`${o}.${r} is required.`);
813
+ return we.has(t.reason) || s.push(`${o}.reason must be a supported unsupported insight reason.`), (t.relationshipCandidate !== void 0 || t.nextRepairAction !== void 0) && t.reason !== "missing_relationship" && s.push(
814
+ `${o} relationship repair metadata is only valid for missing_relationship unsupported insights.`
815
+ ), t.relationshipCandidate !== void 0 && s.push(
816
+ ...Je(
817
+ t.relationshipCandidate,
818
+ `${o}.relationshipCandidate`
783
819
  )
784
- ), o.nextRepairAction !== void 0 && s.push(
785
- ...Ze(
786
- o.nextRepairAction,
787
- `${t}.nextRepairAction`
820
+ ), t.nextRepairAction !== void 0 && s.push(
821
+ ...Xe(
822
+ t.nextRepairAction,
823
+ `${o}.nextRepairAction`
788
824
  )
789
825
  ), s;
790
826
  }
791
- function Ze(i, t) {
792
- const o = a(i);
793
- if (!o)
794
- return [`${t} must be an object.`];
795
- const s = [], r = /* @__PURE__ */ new Set(["tool", "reason"]);
796
- return Object.keys(o).forEach((n) => {
797
- r.has(n) || s.push(
798
- `${t}.${n} is not supported; repair actions support only tool and reason.`
827
+ function Xe(i, o) {
828
+ const t = a(i);
829
+ if (!t)
830
+ return [`${o} must be an object.`];
831
+ const s = [], n = /* @__PURE__ */ new Set(["tool", "reason"]);
832
+ return Object.keys(t).forEach((r) => {
833
+ n.has(r) || s.push(
834
+ `${o}.${r} is not supported; repair actions support only tool and reason.`
799
835
  );
800
- }), o.tool !== "semaphor_propose_semantic_model_change" && s.push(
801
- `${t}.tool must be semaphor_propose_semantic_model_change.`
802
- ), o.reason !== "missing_relationship" && s.push(`${t}.reason must be missing_relationship.`), s;
836
+ }), t.tool !== "semaphor_propose_semantic_model_change" && s.push(
837
+ `${o}.tool must be semaphor_propose_semantic_model_change.`
838
+ ), t.reason !== "missing_relationship" && s.push(`${o}.reason must be missing_relationship.`), s;
803
839
  }
804
- function Xe(i, t) {
805
- const o = a(i);
806
- if (!o)
807
- return [`${t} must be an object.`];
808
- const s = [], r = /* @__PURE__ */ new Set(["source", "sourceFields", "target", "targetFields"]);
809
- Object.keys(o).forEach((n) => {
810
- r.has(n) || s.push(
811
- `${t}.${n} is not supported; relationship candidates support only source, sourceFields, target, and targetFields.`
840
+ function Je(i, o) {
841
+ const t = a(i);
842
+ if (!t)
843
+ return [`${o} must be an object.`];
844
+ const s = [], n = /* @__PURE__ */ new Set(["source", "sourceFields", "target", "targetFields"]);
845
+ Object.keys(t).forEach((r) => {
846
+ n.has(r) || s.push(
847
+ `${o}.${r} is not supported; relationship candidates support only source, sourceFields, target, and targetFields.`
812
848
  );
813
849
  }), s.push(
814
- ...z(o.source, `${t}.source`)
850
+ ...H(t.source, `${o}.source`)
815
851
  ), s.push(
816
- ...z(o.target, `${t}.target`)
852
+ ...H(t.target, `${o}.target`)
817
853
  );
818
- for (const n of ["sourceFields", "targetFields"]) {
819
- const l = o[n];
854
+ for (const r of ["sourceFields", "targetFields"]) {
855
+ const l = t[r];
820
856
  if (!Array.isArray(l) || l.length === 0) {
821
- s.push(`${t}.${n} must be a non-empty endpoint field array.`);
857
+ s.push(`${o}.${r} must be a non-empty endpoint field array.`);
822
858
  continue;
823
859
  }
824
- l.forEach((u, p) => {
860
+ l.forEach((u, c) => {
825
861
  s.push(
826
- ...Je(u, `${t}.${n}.${p}`)
862
+ ...et(u, `${o}.${r}.${c}`)
827
863
  );
828
864
  });
829
865
  }
830
866
  return s;
831
867
  }
832
- function Je(i, t) {
833
- const o = a(i);
834
- if (!o)
835
- return [`${t} must be an object.`];
836
- const s = [], r = /* @__PURE__ */ new Set(["name", "label", "role", "dataType"]);
837
- return Object.keys(o).forEach((n) => {
838
- r.has(n) || s.push(
839
- `${t}.${n} is not supported; relationship candidate fields are scoped by their endpoint and support only name, label, role, and dataType.`
868
+ function et(i, o) {
869
+ const t = a(i);
870
+ if (!t)
871
+ return [`${o} must be an object.`];
872
+ const s = [], n = /* @__PURE__ */ new Set(["name", "label", "role", "dataType"]);
873
+ return Object.keys(t).forEach((r) => {
874
+ n.has(r) || s.push(
875
+ `${o}.${r} is not supported; relationship candidate fields are scoped by their endpoint and support only name, label, role, and dataType.`
840
876
  );
841
- }), (typeof o.name != "string" || !o.name.trim()) && s.push(`${t}.name must be a non-empty string.`), o.role !== void 0 && (typeof o.role != "string" || !["dimension", "measure", "date", "id", "unknown"].includes(o.role)) && s.push(`${t}.role must be dimension, measure, date, id, or unknown.`), o.dataType !== void 0 && (typeof o.dataType != "string" || !["string", "number", "boolean", "date", "datetime", "unknown"].includes(
842
- o.dataType
877
+ }), (typeof t.name != "string" || !t.name.trim()) && s.push(`${o}.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(`${o}.role must be dimension, measure, date, id, or unknown.`), t.dataType !== void 0 && (typeof t.dataType != "string" || !["string", "number", "boolean", "date", "datetime", "unknown"].includes(
878
+ t.dataType
843
879
  )) && s.push(
844
- `${t}.dataType must be string, number, boolean, date, datetime, or unknown.`
880
+ `${o}.dataType must be string, number, boolean, date, datetime, or unknown.`
845
881
  ), s;
846
882
  }
847
- function z(i, t) {
848
- const o = a(i);
849
- if (!o)
850
- return [`${t} must be an object.`];
851
- const s = [], r = /* @__PURE__ */ new Set([
883
+ function H(i, o) {
884
+ const t = a(i);
885
+ if (!t)
886
+ return [`${o} must be an object.`];
887
+ const s = [], n = /* @__PURE__ */ new Set([
852
888
  "kind",
853
889
  "domainId",
854
890
  "datasetName",
@@ -856,45 +892,45 @@ function z(i, t) {
856
892
  "label",
857
893
  "sourceKey"
858
894
  ]);
859
- return Object.keys(o).forEach((n) => {
860
- r.has(n) || s.push(
861
- `${t}.${n} is not supported; relationship candidate sources support only semantic identity fields.`
895
+ return Object.keys(t).forEach((r) => {
896
+ n.has(r) || s.push(
897
+ `${o}.${r} is not supported; relationship candidate sources support only semantic identity fields.`
862
898
  );
863
- }), o.kind !== "semantic" && s.push(`${t} must use semantic source identity.`), (typeof o.domainId != "string" || !o.domainId.trim() || typeof o.datasetName != "string" || !o.datasetName.trim()) && s.push(`${t} must include semantic domainId and datasetName.`), s;
899
+ }), t.kind !== "semantic" && s.push(`${o} must use semantic source identity.`), (typeof t.domainId != "string" || !t.domainId.trim() || typeof t.datasetName != "string" || !t.datasetName.trim()) && s.push(`${o} must include semantic domainId and datasetName.`), s;
864
900
  }
865
901
  function $(i) {
866
902
  return ge.has(i);
867
903
  }
868
- function J(i) {
904
+ function ee(i) {
869
905
  return he.has(i);
870
906
  }
871
- function h(i, t) {
872
- return i === void 0 ? [] : d(i, t);
907
+ function h(i, o) {
908
+ return i === void 0 ? [] : p(i, o);
873
909
  }
874
- function d(i, t) {
875
- const o = a(i);
876
- if (!o)
877
- return [`${t} must be an object.`];
910
+ function p(i, o) {
911
+ const t = a(i);
912
+ if (!t)
913
+ return [`${o} must be an object.`];
878
914
  const s = [];
879
- return (typeof o.name != "string" || !o.name.trim()) && s.push(`${t}.name is required.`), !o.source && typeof o.sourceKey != "string" && s.push(`${t} must include source or sourceKey.`), s;
915
+ return (typeof t.name != "string" || !t.name.trim()) && s.push(`${o}.name is required.`), !t.source && typeof t.sourceKey != "string" && s.push(`${o} must include source or sourceKey.`), s;
880
916
  }
881
- function ee(i, t) {
882
- const o = a(i), s = d(i, t);
883
- if (!o || typeof o.sourceKey == "string" && o.sourceKey.trim())
917
+ function te(i, o) {
918
+ const t = a(i), s = p(i, o);
919
+ if (!t || typeof t.sourceKey == "string" && t.sourceKey.trim())
884
920
  return s;
885
- if (o.source !== void 0) {
886
- const n = w(o.source, `${t}.source`);
887
- return n.length === 0 || s.push(...n), s;
921
+ if (t.source !== void 0) {
922
+ const r = w(t.source, `${o}.source`);
923
+ return r.length === 0 || s.push(...r), s;
888
924
  }
889
- return s.includes(`${t} must include source or sourceKey.`) || s.push(`${t} must include source or sourceKey.`), s;
925
+ return s.includes(`${o} must include source or sourceKey.`) || s.push(`${o} must include source or sourceKey.`), s;
890
926
  }
891
927
  function a(i) {
892
928
  return i && typeof i == "object" && !Array.isArray(i) ? i : void 0;
893
929
  }
894
930
  function g(i) {
895
- return Array.isArray(i) && i.every((t) => typeof t == "string");
931
+ return Array.isArray(i) && i.every((o) => typeof o == "string");
896
932
  }
897
- const m = e.record(e.string(), e.unknown()), R = e.array(m), c = e.enum([
933
+ const m = e.record(e.string(), e.unknown()), R = e.array(m), d = e.enum([
898
934
  "SUM",
899
935
  "COUNT",
900
936
  "AVG",
@@ -933,7 +969,7 @@ const m = e.record(e.string(), e.unknown()), R = e.array(m), c = e.enum([
933
969
  "date",
934
970
  "datetime",
935
971
  "unknown"
936
- ]), te = e.enum([
972
+ ]), se = e.enum([
937
973
  "semantic_model",
938
974
  "caller_override",
939
975
  "default_sum"
@@ -943,7 +979,7 @@ const m = e.record(e.string(), e.unknown()), R = e.array(m), c = e.enum([
943
979
  "minute",
944
980
  "hour",
945
981
  "day"
946
- ]), se = e.union([
982
+ ]), ie = e.union([
947
983
  e.object({
948
984
  type: e.enum(["number", "currency", "percent", "percentage", "scientific"]),
949
985
  locale: e.string().optional(),
@@ -984,7 +1020,7 @@ const m = e.record(e.string(), e.unknown()), R = e.array(m), c = e.enum([
984
1020
  prefix: e.string().optional(),
985
1021
  suffix: e.string().optional()
986
1022
  }).passthrough()
987
- ]), eo = e.union([
1023
+ ]), tt = e.union([
988
1024
  e.object({ kind: e.literal("defaultAggregate") }).passthrough(),
989
1025
  e.object({ kind: e.literal("blank") }).passthrough(),
990
1026
  e.object({
@@ -993,7 +1029,7 @@ const m = e.record(e.string(), e.unknown()), R = e.array(m), c = e.enum([
993
1029
  }).passthrough(),
994
1030
  e.object({
995
1031
  kind: e.literal("customAggregate"),
996
- aggregate: c
1032
+ aggregate: d
997
1033
  }).passthrough(),
998
1034
  e.object({ kind: e.literal("percentOfParent") }).passthrough(),
999
1035
  e.object({ kind: e.literal("percentOfGrandTotal") }).passthrough(),
@@ -1002,24 +1038,24 @@ const m = e.record(e.string(), e.unknown()), R = e.array(m), c = e.enum([
1002
1038
  expressionId: e.string()
1003
1039
  }).passthrough()
1004
1040
  ]);
1005
- function k(i, t) {
1006
- return e.object(i).passthrough().superRefine((o, s) => {
1007
- for (const r of t)
1008
- Object.prototype.hasOwnProperty.call(o, r) || s.addIssue({
1041
+ function k(i, o) {
1042
+ return e.object(i).passthrough().superRefine((t, s) => {
1043
+ for (const n of o)
1044
+ Object.prototype.hasOwnProperty.call(t, n) || s.addIssue({
1009
1045
  code: "custom",
1010
- path: [r],
1011
- message: `Required field "${r}" is missing.`
1046
+ path: [n],
1047
+ message: `Required field "${n}" is missing.`
1012
1048
  });
1013
1049
  });
1014
1050
  }
1015
- const ie = e.object({
1051
+ const ne = e.object({
1016
1052
  kind: e.literal("semantic"),
1017
1053
  domainId: e.string(),
1018
1054
  datasetName: e.string(),
1019
1055
  datasetId: e.string().optional(),
1020
1056
  label: e.string().optional(),
1021
1057
  connectionId: e.string().optional()
1022
- }).passthrough(), oo = e.object({
1058
+ }).passthrough(), ot = e.object({
1023
1059
  kind: e.literal("physical"),
1024
1060
  connectionId: e.string(),
1025
1061
  connectionType: e.string().optional(),
@@ -1028,26 +1064,26 @@ const ie = e.object({
1028
1064
  schemaName: e.string().optional(),
1029
1065
  label: e.string().optional(),
1030
1066
  dialect: C.optional()
1031
- }).passthrough(), to = e.object({
1067
+ }).passthrough(), st = e.object({
1032
1068
  kind: e.literal("sql"),
1033
1069
  connectionId: e.string(),
1034
1070
  dialect: C.optional(),
1035
1071
  label: e.string().optional()
1036
1072
  }).passthrough(), S = e.union([
1037
- ie,
1038
- oo,
1039
- to
1073
+ ne,
1074
+ ot,
1075
+ st
1040
1076
  ]), y = e.object({
1041
1077
  name: e.string(),
1042
1078
  label: e.string().optional(),
1043
1079
  role: q.optional(),
1044
1080
  dataType: x.optional(),
1045
1081
  source: S.optional(),
1046
- aggregate: c.optional()
1047
- }).passthrough(), so = e.object({
1082
+ aggregate: d.optional()
1083
+ }).passthrough(), it = e.object({
1048
1084
  kind: e.literal("field"),
1049
1085
  field: y,
1050
- aggregate: c.optional()
1086
+ aggregate: d.optional()
1051
1087
  }).passthrough(), re = e.object({
1052
1088
  kind: e.literal("derived_field"),
1053
1089
  name: e.string(),
@@ -1058,8 +1094,8 @@ const ie = e.object({
1058
1094
  computeStage: e.enum(["row", "aggregate"]),
1059
1095
  expression: e.string(),
1060
1096
  expressionLanguage: e.literal("semaphor_sql_template").optional(),
1061
- inputs: e.record(so),
1062
- defaultAggregate: c.optional(),
1097
+ inputs: e.record(it),
1098
+ defaultAggregate: d.optional(),
1063
1099
  aggregationBehavior: e.enum([
1064
1100
  "additive",
1065
1101
  "non_additive",
@@ -1074,16 +1110,16 @@ const ie = e.object({
1074
1110
  "aggregate_then_join",
1075
1111
  "weighted"
1076
1112
  ]).optional(),
1077
- format: se.optional(),
1113
+ format: ie.optional(),
1078
1114
  tags: e.array(e.string()).optional()
1079
- }).passthrough(), P = y.and(
1115
+ }).passthrough(), V = y.and(
1080
1116
  e.object({
1081
- semanticAggregate: c.optional(),
1082
- effectiveAggregate: c.optional(),
1083
- aggregateSource: te.optional(),
1117
+ semanticAggregate: d.optional(),
1118
+ effectiveAggregate: d.optional(),
1119
+ aggregateSource: se.optional(),
1084
1120
  derivedField: re.optional()
1085
1121
  }).passthrough()
1086
- ), io = ie, ro = e.object({
1122
+ ), nt = ne, rt = e.object({
1087
1123
  kind: e.literal("physical"),
1088
1124
  connectionId: e.string().optional(),
1089
1125
  connectionType: e.string().optional(),
@@ -1092,26 +1128,26 @@ const ie = e.object({
1092
1128
  schemaName: e.string().optional(),
1093
1129
  label: e.string().optional(),
1094
1130
  dialect: C.optional()
1095
- }).passthrough(), no = e.object({
1131
+ }).passthrough(), at = e.object({
1096
1132
  kind: e.literal("sql"),
1097
1133
  connectionId: e.string().optional(),
1098
1134
  dialect: C.optional(),
1099
1135
  label: e.string().optional()
1100
- }).passthrough(), ao = e.union([
1101
- io,
1102
- ro,
1103
- no
1104
- ]), lo = e.object({
1136
+ }).passthrough(), lt = e.union([
1137
+ nt,
1138
+ rt,
1139
+ at
1140
+ ]), ut = e.object({
1105
1141
  key: e.string().optional(),
1106
1142
  name: e.string(),
1107
1143
  label: e.string().optional(),
1108
1144
  role: q.optional(),
1109
1145
  dataType: x.optional(),
1110
- source: ao.optional(),
1111
- aggregate: c.optional(),
1112
- semanticAggregate: c.optional(),
1113
- effectiveAggregate: c.optional(),
1114
- aggregateSource: te.optional(),
1146
+ source: lt.optional(),
1147
+ aggregate: d.optional(),
1148
+ semanticAggregate: d.optional(),
1149
+ effectiveAggregate: d.optional(),
1150
+ aggregateSource: se.optional(),
1115
1151
  derivedField: e.never().optional()
1116
1152
  }).passthrough(), O = e.object({
1117
1153
  key: e.string(),
@@ -1119,10 +1155,10 @@ const ie = e.object({
1119
1155
  label: e.string(),
1120
1156
  role: q.optional(),
1121
1157
  dataType: x.optional(),
1122
- aggregate: c.optional(),
1158
+ aggregate: d.optional(),
1123
1159
  source: S.optional(),
1124
1160
  derivedField: re.optional()
1125
- }).passthrough(), ne = e.object({
1161
+ }).passthrough(), ae = e.object({
1126
1162
  code: e.string(),
1127
1163
  message: e.string().optional(),
1128
1164
  invalidField: e.string().optional(),
@@ -1131,34 +1167,34 @@ const ie = e.object({
1131
1167
  validDateCandidates: e.array(e.string()).optional(),
1132
1168
  validDimensionCandidates: e.array(e.string()).optional(),
1133
1169
  recommendedNextStep: e.string()
1134
- }).passthrough(), K = e.object({
1170
+ }).passthrough(), M = e.object({
1135
1171
  code: e.string(),
1136
1172
  message: e.string(),
1137
1173
  path: e.string().optional(),
1138
1174
  fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
1139
- repairHint: ne.optional()
1140
- }).passthrough(), ae = e.object({
1175
+ repairHint: ae.optional()
1176
+ }).passthrough(), le = e.object({
1141
1177
  ok: e.boolean(),
1142
- errors: e.array(K),
1143
- warnings: e.array(K),
1144
- repairHints: e.array(ne)
1145
- }).passthrough(), uo = e.object({
1178
+ errors: e.array(M),
1179
+ warnings: e.array(M),
1180
+ repairHints: e.array(ae)
1181
+ }).passthrough(), dt = e.object({
1146
1182
  page: e.number(),
1147
1183
  pageSize: e.number(),
1148
1184
  pageCount: e.number(),
1149
1185
  totalCount: e.number(),
1150
1186
  hasNextPage: e.boolean(),
1151
1187
  hasPrevPage: e.boolean()
1152
- }).passthrough(), A = {
1188
+ }).passthrough(), I = {
1153
1189
  intentId: e.string().optional(),
1154
1190
  queryPath: e.enum(["query_spec", "sql", "sql_python"]),
1155
1191
  warnings: e.array(e.string()).optional(),
1156
1192
  rowCount: e.number().optional(),
1157
1193
  rowLimitExceeded: e.boolean().optional(),
1158
1194
  limit: e.number().optional(),
1159
- pagination: uo.optional()
1160
- }, co = e.object({
1161
- ...A,
1195
+ pagination: dt.optional()
1196
+ }, ct = e.object({
1197
+ ...I,
1162
1198
  kind: e.literal("metric"),
1163
1199
  value: j,
1164
1200
  measures: e.record(j).optional(),
@@ -1169,8 +1205,8 @@ const ie = e.object({
1169
1205
  deltaPercent: e.union([e.number(), e.null()]).optional()
1170
1206
  }).passthrough().optional(),
1171
1207
  records: R.optional()
1172
- }).passthrough(), po = e.object({
1173
- ...A,
1208
+ }).passthrough(), pt = e.object({
1209
+ ...I,
1174
1210
  kind: e.literal("records"),
1175
1211
  columns: e.array(O),
1176
1212
  records: R,
@@ -1180,8 +1216,8 @@ const ie = e.object({
1180
1216
  row: e.record(e.string(), e.unknown()),
1181
1217
  columns: e.array(O).optional()
1182
1218
  }).passthrough().optional()
1183
- }).passthrough(), mo = e.object({
1184
- ...A,
1219
+ }).passthrough(), mt = e.object({
1220
+ ...I,
1185
1221
  kind: e.literal("inputOptions"),
1186
1222
  options: e.array(
1187
1223
  k(
@@ -1194,8 +1230,8 @@ const ie = e.object({
1194
1230
  ["value"]
1195
1231
  )
1196
1232
  )
1197
- }).passthrough(), go = e.object({
1198
- ...A,
1233
+ }).passthrough(), gt = e.object({
1234
+ ...I,
1199
1235
  kind: e.literal("sql"),
1200
1236
  columns: e.array(O),
1201
1237
  records: R,
@@ -1204,11 +1240,11 @@ const ie = e.object({
1204
1240
  explicitLimit: e.number().optional(),
1205
1241
  hasPythonCode: e.boolean().optional()
1206
1242
  }).passthrough().optional()
1207
- }).passthrough(), ho = e.object({
1243
+ }).passthrough(), ht = e.object({
1208
1244
  enabled: e.boolean().optional(),
1209
1245
  position: e.enum(["before", "after"]).optional(),
1210
1246
  label: e.string().optional()
1211
- }).passthrough(), H = e.object({
1247
+ }).passthrough(), Q = e.object({
1212
1248
  id: e.enum(["rows", "columns"]),
1213
1249
  levels: e.array(
1214
1250
  e.object({
@@ -1217,7 +1253,7 @@ const ie = e.object({
1217
1253
  label: e.string(),
1218
1254
  field: y,
1219
1255
  grain: oe.optional(),
1220
- subtotal: ho.optional()
1256
+ subtotal: ht.optional()
1221
1257
  }).passthrough()
1222
1258
  ),
1223
1259
  nodeIds: e.array(e.string())
@@ -1229,12 +1265,12 @@ const ie = e.object({
1229
1265
  label: e.string()
1230
1266
  },
1231
1267
  ["value"]
1232
- ), fo = e.union([
1268
+ ), ft = e.union([
1233
1269
  e.object({ kind: e.literal("label") }).passthrough(),
1234
1270
  e.object({
1235
1271
  kind: e.literal("field"),
1236
1272
  field: y,
1237
- aggregate: c.optional()
1273
+ aggregate: d.optional()
1238
1274
  }).passthrough(),
1239
1275
  e.object({
1240
1276
  kind: e.literal("value"),
@@ -1242,12 +1278,12 @@ const ie = e.object({
1242
1278
  rowPath: e.array(b).optional(),
1243
1279
  columnPath: e.array(b).optional()
1244
1280
  }).passthrough()
1245
- ]), bo = e.enum([
1281
+ ]), bt = e.enum([
1246
1282
  "present",
1247
1283
  "presentNull",
1248
1284
  "missing",
1249
1285
  "densified"
1250
- ]), yo = e.enum([
1286
+ ]), yt = e.enum([
1251
1287
  "value",
1252
1288
  "rowSubtotal",
1253
1289
  "columnSubtotal",
@@ -1255,25 +1291,25 @@ const ie = e.object({
1255
1291
  "rowGrandTotal",
1256
1292
  "columnGrandTotal",
1257
1293
  "matrixGrandTotal"
1258
- ]), vo = e.object({
1294
+ ]), vt = e.object({
1259
1295
  instanceId: e.string(),
1260
1296
  fieldKey: e.string(),
1261
1297
  field: y,
1262
1298
  role: e.enum(["row", "column", "measure", "sort", "filter"]),
1263
1299
  label: e.string().optional()
1264
- }).passthrough(), $o = e.union([
1300
+ }).passthrough(), $t = e.union([
1265
1301
  e.object({
1266
1302
  kind: e.literal("additive"),
1267
- aggregate: c.optional()
1303
+ aggregate: d.optional()
1268
1304
  }).passthrough(),
1269
1305
  e.object({
1270
1306
  kind: e.literal("semiAdditive"),
1271
- aggregate: c.optional(),
1307
+ aggregate: d.optional(),
1272
1308
  grain: oe.optional()
1273
1309
  }).passthrough(),
1274
1310
  e.object({
1275
1311
  kind: e.literal("nonAdditive"),
1276
- aggregate: c.optional()
1312
+ aggregate: d.optional()
1277
1313
  }).passthrough(),
1278
1314
  e.object({
1279
1315
  kind: e.literal("ratio"),
@@ -1284,19 +1320,19 @@ const ie = e.object({
1284
1320
  kind: e.literal("custom"),
1285
1321
  expressionId: e.string().optional()
1286
1322
  }).passthrough()
1287
- ]), So = e.object({
1323
+ ]), St = e.object({
1288
1324
  instanceId: e.string(),
1289
1325
  fieldKey: e.string(),
1290
1326
  label: e.string(),
1291
1327
  field: y,
1292
- aggregate: c.optional(),
1293
- format: se.optional(),
1294
- totalBehavior: eo.optional(),
1295
- semantics: $o
1296
- }).passthrough(), wo = e.object({
1328
+ aggregate: d.optional(),
1329
+ format: ie.optional(),
1330
+ totalBehavior: tt.optional(),
1331
+ semantics: $t
1332
+ }).passthrough(), wt = e.object({
1297
1333
  id: e.string(),
1298
1334
  measureId: e.string(),
1299
- aggregate: c.optional(),
1335
+ aggregate: d.optional(),
1300
1336
  label: e.string().optional(),
1301
1337
  source: e.enum([
1302
1338
  "measureDefault",
@@ -1314,11 +1350,11 @@ const ie = e.object({
1314
1350
  rowNodeId: e.string().optional(),
1315
1351
  columnNodeId: e.string().optional()
1316
1352
  }).passthrough().optional()
1317
- }).passthrough(), ko = e.object({
1353
+ }).passthrough(), kt = e.object({
1318
1354
  kind: e.string(),
1319
1355
  label: e.string().optional(),
1320
1356
  payload: e.record(e.string(), e.unknown()).optional()
1321
- }).passthrough(), Ao = k(
1357
+ }).passthrough(), It = k(
1322
1358
  {
1323
1359
  id: e.string(),
1324
1360
  axis: e.enum(["row", "column"]),
@@ -1331,12 +1367,12 @@ const ie = e.object({
1331
1367
  isExpanded: e.boolean().optional(),
1332
1368
  isSubtotal: e.boolean().optional(),
1333
1369
  isGrandTotal: e.boolean().optional(),
1334
- subtotalFunction: c.optional(),
1370
+ subtotalFunction: d.optional(),
1335
1371
  childCount: e.number().optional(),
1336
- actions: e.array(ko).optional()
1372
+ actions: e.array(kt).optional()
1337
1373
  },
1338
1374
  ["value"]
1339
- ), Io = e.object({
1375
+ ), At = e.object({
1340
1376
  rowHeaderLevels: e.array(
1341
1377
  e.object({
1342
1378
  id: e.string(),
@@ -1376,19 +1412,19 @@ const ie = e.object({
1376
1412
  role: e.enum(["value", "columnSubtotal", "columnGrandTotal"])
1377
1413
  }).passthrough()
1378
1414
  )
1379
- }).passthrough(), _o = k(
1415
+ }).passthrough(), _t = k(
1380
1416
  {
1381
1417
  rowId: e.string(),
1382
1418
  columnId: e.string().optional(),
1383
1419
  measureId: e.string(),
1384
1420
  value: e.unknown(),
1385
1421
  formattedValue: e.string().optional(),
1386
- presence: bo,
1387
- role: yo,
1422
+ presence: bt,
1423
+ role: yt,
1388
1424
  calculationId: e.string().optional()
1389
1425
  },
1390
1426
  ["value"]
1391
- ), jo = e.object({
1427
+ ), jt = e.object({
1392
1428
  rows: e.boolean().optional(),
1393
1429
  columns: e.boolean().optional(),
1394
1430
  grandTotal: e.union([
@@ -1398,7 +1434,7 @@ const ie = e.object({
1398
1434
  columns: e.boolean().optional()
1399
1435
  }).passthrough()
1400
1436
  ]).optional()
1401
- }).passthrough(), Ro = k(
1437
+ }).passthrough(), Rt = k(
1402
1438
  {
1403
1439
  id: e.string(),
1404
1440
  axis: e.enum(["row", "column"]),
@@ -1406,27 +1442,27 @@ const ie = e.object({
1406
1442
  direction: e.enum(["asc", "desc"]),
1407
1443
  nulls: e.enum(["warehouseDefault", "first", "last"]).optional(),
1408
1444
  scope: e.enum(["global", "withinParent"]).optional(),
1409
- by: fo
1445
+ by: ft
1410
1446
  },
1411
1447
  ["by"]
1412
- ), Co = e.object({
1448
+ ), Ct = e.object({
1413
1449
  rowOffset: e.number().optional(),
1414
1450
  rowLimit: e.number().optional(),
1415
1451
  columnOffset: e.number().optional(),
1416
1452
  columnLimit: e.number().optional(),
1417
1453
  hasMoreRows: e.boolean().optional(),
1418
1454
  hasMoreColumns: e.boolean().optional()
1419
- }).passthrough(), qo = e.object({
1455
+ }).passthrough(), qt = e.object({
1420
1456
  axis: e.enum(["row", "column"]),
1421
1457
  path: e.array(b),
1422
1458
  depth: e.number().optional()
1423
- }).passthrough(), xo = e.object({
1459
+ }).passthrough(), xt = e.object({
1424
1460
  rowLazyLoading: e.boolean().optional(),
1425
1461
  columnLazyLoading: e.boolean().optional(),
1426
1462
  expandableRowNodeIds: e.array(e.string()).optional(),
1427
1463
  expandableColumnNodeIds: e.array(e.string()).optional(),
1428
- nextRequests: e.array(qo).optional()
1429
- }).passthrough(), Eo = e.object({
1464
+ nextRequests: e.array(qt).optional()
1465
+ }).passthrough(), Et = e.object({
1430
1466
  domains: e.record(
1431
1467
  e.object({
1432
1468
  min: e.number().optional(),
@@ -1434,35 +1470,35 @@ const ie = e.object({
1434
1470
  }).passthrough()
1435
1471
  ).optional(),
1436
1472
  rules: e.array(e.record(e.string(), e.unknown())).optional()
1437
- }).passthrough(), Fo = e.object({
1438
- ...A,
1473
+ }).passthrough(), Ft = e.object({
1474
+ ...I,
1439
1475
  kind: e.literal("matrix"),
1440
1476
  schemaVersion: e.literal(1),
1441
1477
  shape: e.enum(["hierarchical", "pivot"]),
1442
1478
  capabilities: e.array(e.string()),
1443
1479
  executionMetadata: e.record(e.string(), e.unknown()),
1444
- fieldsById: e.record(e.string(), vo),
1445
- measuresById: e.record(e.string(), So),
1446
- calculationsById: e.record(e.string(), wo).optional(),
1480
+ fieldsById: e.record(e.string(), vt),
1481
+ measuresById: e.record(e.string(), St),
1482
+ calculationsById: e.record(e.string(), wt).optional(),
1447
1483
  axes: e.object({
1448
- rows: H,
1449
- columns: H
1484
+ rows: Q,
1485
+ columns: Q
1450
1486
  }).passthrough(),
1451
- nodesById: e.record(e.string(), Ao),
1452
- layout: Io,
1453
- cells: e.array(_o),
1454
- totals: jo,
1455
- sort: e.array(Ro),
1456
- formattingContext: Eo,
1457
- pageInfo: Co.optional(),
1458
- expansion: xo.optional()
1459
- }).passthrough(), To = e.union([
1460
- co,
1461
- po,
1462
- mo,
1463
- go,
1464
- Fo
1465
- ]), Do = e.object({
1487
+ nodesById: e.record(e.string(), It),
1488
+ layout: At,
1489
+ cells: e.array(_t),
1490
+ totals: jt,
1491
+ sort: e.array(Rt),
1492
+ formattingContext: Et,
1493
+ pageInfo: Ct.optional(),
1494
+ expansion: xt.optional()
1495
+ }).passthrough(), Nt = e.union([
1496
+ ct,
1497
+ pt,
1498
+ mt,
1499
+ gt,
1500
+ Ft
1501
+ ]), Tt = e.object({
1466
1502
  status: e.enum([
1467
1503
  "not_required",
1468
1504
  "resolved",
@@ -1486,7 +1522,7 @@ const ie = e.object({
1486
1522
  status: e.enum(["none", "warning", "error", "unknown"]),
1487
1523
  message: e.string().optional()
1488
1524
  }).passthrough().optional()
1489
- }).passthrough(), Q = e.enum([
1525
+ }).passthrough(), Y = e.enum([
1490
1526
  "ambiguous_fields",
1491
1527
  "empty_result",
1492
1528
  "missing_grounded_fields",
@@ -1496,7 +1532,7 @@ const ie = e.object({
1496
1532
  "presentation_incomplete",
1497
1533
  "query_validation_failed",
1498
1534
  "unsafe_join"
1499
- ]), le = e.object({
1535
+ ]), ue = e.object({
1500
1536
  version: e.literal(1),
1501
1537
  status: e.enum(["answered", "partial", "blocked"]),
1502
1538
  summary: e.string(),
@@ -1506,14 +1542,14 @@ const ie = e.object({
1506
1542
  queryId: e.string().optional(),
1507
1543
  summary: e.string(),
1508
1544
  evidenceIds: e.array(e.string()).optional(),
1509
- fieldsUsed: e.array(P).optional()
1545
+ fieldsUsed: e.array(V).optional()
1510
1546
  }).passthrough()
1511
1547
  ),
1512
1548
  blocked: e.array(
1513
1549
  e.object({
1514
1550
  slotId: e.string().optional(),
1515
1551
  queryId: e.string().optional(),
1516
- reasonCode: Q,
1552
+ reasonCode: Y,
1517
1553
  message: e.string(),
1518
1554
  missingFields: e.array(e.string()).optional(),
1519
1555
  availableFields: e.array(e.string()).optional(),
@@ -1526,19 +1562,19 @@ const ie = e.object({
1526
1562
  ),
1527
1563
  semanticModelRecommendations: e.array(
1528
1564
  e.object({
1529
- reasonCode: Q,
1565
+ reasonCode: Y,
1530
1566
  message: e.string(),
1531
1567
  recommendedNextStep: e.string().optional()
1532
1568
  }).passthrough()
1533
1569
  ).optional()
1534
- }).passthrough(), ue = e.object({
1570
+ }).passthrough(), de = e.object({
1535
1571
  scope: e.literal("filtered_query"),
1536
1572
  measures: e.record(j)
1537
1573
  }).passthrough(), ce = e.object({
1538
1574
  answeredObligations: e.array(e.string()),
1539
1575
  missingObligations: e.array(e.string()),
1540
- warnings: e.array(K).optional()
1541
- }).passthrough(), No = e.object({
1576
+ warnings: e.array(M).optional()
1577
+ }).passthrough(), Dt = e.object({
1542
1578
  intentId: e.string().optional(),
1543
1579
  queryId: e.string().optional(),
1544
1580
  status: e.enum(["answered", "partial", "failed"]),
@@ -1553,35 +1589,35 @@ const ie = e.object({
1553
1589
  ]).optional(),
1554
1590
  intent: e.unknown().optional(),
1555
1591
  compiledQuery: e.unknown().optional(),
1556
- fieldsUsed: e.array(P).optional(),
1557
- result: To.optional(),
1558
- validation: ae,
1592
+ fieldsUsed: e.array(V).optional(),
1593
+ result: Nt.optional(),
1594
+ validation: le,
1559
1595
  coverage: ce.optional(),
1560
1596
  missingFields: e.array(e.string()).optional(),
1561
1597
  warnings: e.array(e.string()).optional(),
1562
- relationshipDiagnostics: Do.optional(),
1563
- diagnosticFeedback: le.optional(),
1564
- population: ue.optional(),
1598
+ relationshipDiagnostics: Tt.optional(),
1599
+ diagnosticFeedback: ue.optional(),
1600
+ population: de.optional(),
1565
1601
  metadata: e.record(e.string(), e.unknown()).optional()
1566
1602
  }).passthrough();
1567
- function Oo(i) {
1603
+ function Kt(i) {
1568
1604
  switch (i) {
1569
1605
  case "boolean":
1570
1606
  return e.boolean().optional();
1571
1607
  case "compactExecutionFieldArray":
1572
- return e.array(lo).optional();
1608
+ return e.array(ut).optional();
1573
1609
  case "coverage":
1574
1610
  return ce.optional();
1575
1611
  case "diagnosticFeedback":
1576
- return le.optional();
1612
+ return ue.optional();
1577
1613
  case "executionFieldArray":
1578
- return e.array(P).optional();
1614
+ return e.array(V).optional();
1579
1615
  case "executionResult":
1580
- return No.optional();
1616
+ return Dt.optional();
1581
1617
  case "number":
1582
1618
  return e.number().finite().optional();
1583
1619
  case "population":
1584
- return ue.optional();
1620
+ return de.optional();
1585
1621
  case "record":
1586
1622
  return m.optional();
1587
1623
  case "recordArray":
@@ -1597,14 +1633,14 @@ function Oo(i) {
1597
1633
  case "unknownArray":
1598
1634
  return e.array(e.unknown()).optional();
1599
1635
  case "validationResult":
1600
- return ae.optional();
1636
+ return le.optional();
1601
1637
  }
1602
1638
  }
1603
- const Ko = Object.fromEntries(
1604
- Object.entries(M).map(
1605
- ([i, t]) => [i, Oo(t)]
1639
+ const Ot = Object.fromEntries(
1640
+ Object.entries(B).map(
1641
+ ([i, o]) => [i, Kt(o)]
1606
1642
  )
1607
- ), Mo = e.object(Ko).strict(), V = e.object({
1643
+ ), Mt = e.object(Ot).strict(), L = e.object({
1608
1644
  sourceKey: e.string().optional(),
1609
1645
  kind: e.enum(["semantic", "physical", "sql"]).optional(),
1610
1646
  domainId: e.string().optional(),
@@ -1618,13 +1654,13 @@ const Ko = Object.fromEntries(
1618
1654
  label: e.string().optional(),
1619
1655
  role: e.enum(["dimension", "measure", "date", "id", "unknown"]).optional(),
1620
1656
  dataType: e.enum(["string", "number", "boolean", "date", "datetime", "unknown"]).optional(),
1621
- aggregate: c.optional(),
1657
+ aggregate: d.optional(),
1622
1658
  sourceKey: e.string().optional(),
1623
- source: V.optional()
1624
- }).passthrough(), de = e.object({
1659
+ source: L.optional()
1660
+ }).passthrough(), pe = e.object({
1625
1661
  id: e.string().optional(),
1626
1662
  builder: e.literal("semaphor.inputOptions"),
1627
- source: V.optional(),
1663
+ source: L.optional(),
1628
1664
  sourceKey: e.string().optional(),
1629
1665
  valueFieldRef: f,
1630
1666
  labelFieldRef: f,
@@ -1633,24 +1669,24 @@ const Ko = Object.fromEntries(
1633
1669
  dependencies: e.unknown().optional(),
1634
1670
  limit: e.number().int().positive().optional(),
1635
1671
  spec: m.optional()
1636
- }).passthrough(), pe = e.object({
1672
+ }).passthrough(), me = e.object({
1637
1673
  appliesToViewIds: e.array(e.string()).optional(),
1638
1674
  viewId: e.string().optional(),
1639
1675
  fieldRef: f,
1640
1676
  relationshipHint: e.unknown().optional(),
1641
1677
  relationshipsUsed: e.array(m).optional()
1642
- }).passthrough(), Bo = e.object({
1678
+ }).passthrough(), Bt = e.object({
1643
1679
  id: e.string(),
1644
1680
  label: e.string().optional(),
1645
1681
  type: e.string().optional(),
1646
1682
  serverSide: e.boolean().optional(),
1647
1683
  fieldRef: f.optional(),
1648
- optionQuery: de.optional(),
1649
- bindings: e.array(pe).optional(),
1684
+ optionQuery: pe.optional(),
1685
+ bindings: e.array(me).optional(),
1650
1686
  appliesToViewIds: e.array(e.string()),
1651
1687
  relationshipHint: e.unknown().optional(),
1652
1688
  relationshipsUsed: e.array(m).optional()
1653
- }).passthrough(), Po = e.object({
1689
+ }).passthrough(), Pt = e.object({
1654
1690
  builder: e.enum([
1655
1691
  "semaphor.metric",
1656
1692
  "semaphor.records",
@@ -1660,7 +1696,7 @@ const Ko = Object.fromEntries(
1660
1696
  ]),
1661
1697
  spec: m,
1662
1698
  fallbackReason: m.optional()
1663
- }).passthrough(), Vo = e.object({
1699
+ }).passthrough(), Vt = e.object({
1664
1700
  id: e.string(),
1665
1701
  title: e.string().optional(),
1666
1702
  purpose: e.string().optional(),
@@ -1678,31 +1714,31 @@ const Ko = Object.fromEntries(
1678
1714
  "semaphor.analysis",
1679
1715
  "semaphor.sql"
1680
1716
  ]).optional(),
1681
- sdkSpec: Po.optional(),
1717
+ sdkSpec: Pt.optional(),
1682
1718
  fields: e.array(f).optional(),
1683
1719
  computation: m.optional(),
1684
1720
  uxExpectations: e.array(e.string()).optional(),
1685
1721
  validation: m.optional()
1686
- }).passthrough(), Lo = e.object({
1722
+ }).passthrough(), Lt = e.object({
1687
1723
  inputId: e.string(),
1688
1724
  label: e.string().optional(),
1689
1725
  type: e.string().optional(),
1690
1726
  serverSide: e.boolean().optional(),
1691
1727
  fieldRef: f.optional(),
1692
- optionQuery: de.optional(),
1693
- bindings: e.array(pe),
1728
+ optionQuery: pe.optional(),
1729
+ bindings: e.array(me),
1694
1730
  appliesToViewIds: e.array(e.string()),
1695
1731
  notAppliedToViewIds: e.array(e.string())
1696
- }).passthrough(), Yo = e.object({
1697
- schemaVersion: e.literal(N),
1732
+ }).passthrough(), Yt = e.object({
1733
+ schemaVersion: e.literal(K),
1698
1734
  title: e.string(),
1699
1735
  purpose: e.string().optional(),
1700
1736
  userGoal: e.string().optional(),
1701
1737
  nextStep: e.string().optional(),
1702
- sources: e.array(V),
1703
- inputs: e.array(Bo),
1704
- views: e.array(Vo),
1705
- filterContracts: e.array(Lo),
1738
+ sources: e.array(L),
1739
+ inputs: e.array(Bt),
1740
+ views: e.array(Vt),
1741
+ filterContracts: e.array(Lt),
1706
1742
  implementationChecklist: e.object({
1707
1743
  schemaVersion: e.string().optional(),
1708
1744
  requiredDevtools: e.object({
@@ -1731,67 +1767,67 @@ const Ko = Object.fromEntries(
1731
1767
  ).optional(),
1732
1768
  assumptions: e.array(e.string()).optional(),
1733
1769
  validation: m.optional()
1734
- }).passthrough().superRefine((i, t) => {
1735
- const o = W(i);
1736
- for (const s of o.issues)
1737
- t.addIssue({
1770
+ }).passthrough().superRefine((i, o) => {
1771
+ const t = Z(i);
1772
+ for (const s of t.issues)
1773
+ o.addIssue({
1738
1774
  code: e.ZodIssueCode.custom,
1739
1775
  message: s
1740
1776
  });
1741
- }), Go = new Set(
1742
- Object.keys(M)
1777
+ }), Gt = new Set(
1778
+ Object.keys(B)
1743
1779
  );
1744
- function Wo() {
1780
+ function Wt() {
1745
1781
  return Object.keys(
1746
- M
1782
+ B
1747
1783
  );
1748
1784
  }
1749
- function Uo(i) {
1750
- return Go.has(i);
1785
+ function Ut(i) {
1786
+ return Gt.has(i);
1751
1787
  }
1752
- function Zo(i) {
1788
+ function Zt(i) {
1753
1789
  if (!i || typeof i != "object" || Array.isArray(i))
1754
1790
  throw new Error("Semaphor analyze result must be an object.");
1755
- const o = Object.keys(i).filter(
1756
- (s) => !Uo(s)
1791
+ const t = Object.keys(i).filter(
1792
+ (s) => !Ut(s)
1757
1793
  );
1758
- if (o.length)
1794
+ if (t.length)
1759
1795
  throw new Error(
1760
- `Semaphor analyze result contains unsupported top-level field(s): ${o.join(", ")}.`
1796
+ `Semaphor analyze result contains unsupported top-level field(s): ${t.join(", ")}.`
1761
1797
  );
1762
- return Mo.parse(i);
1798
+ return Mt.parse(i);
1763
1799
  }
1764
1800
  export {
1765
1801
  ce as A,
1766
- No as B,
1767
- Ko as C,
1768
- Mo as D,
1769
- Yo as E,
1770
- M as S,
1771
- N as a,
1772
- Ho as b,
1773
- Qo as c,
1774
- oo as d,
1775
- to as e,
1802
+ Dt as B,
1803
+ Ot as C,
1804
+ Mt as D,
1805
+ Yt as E,
1806
+ K as S,
1807
+ Ht as a,
1808
+ Ut as b,
1809
+ B as c,
1810
+ ot as d,
1811
+ st as e,
1776
1812
  S as f,
1777
- Wo as g,
1813
+ Wt as g,
1778
1814
  y as h,
1779
- Uo as i,
1815
+ Qt as i,
1780
1816
  re as j,
1781
- P as k,
1817
+ V as k,
1782
1818
  O as l,
1783
- K as m,
1784
- ae as n,
1785
- co as o,
1786
- Zo as p,
1787
- po as q,
1788
- mo as r,
1789
- ie as s,
1790
- go as t,
1791
- Fo as u,
1792
- W as v,
1793
- To as w,
1794
- Do as x,
1795
- le as y,
1796
- ue as z
1819
+ M as m,
1820
+ le as n,
1821
+ ct as o,
1822
+ Zt as p,
1823
+ pt as q,
1824
+ mt as r,
1825
+ ne as s,
1826
+ gt as t,
1827
+ Ft as u,
1828
+ Z as v,
1829
+ Nt as w,
1830
+ Tt as x,
1831
+ ue as y,
1832
+ de as z
1797
1833
  };