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.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +1 -1
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/chunks/{analyze-result-contract-CUO5QmqV.js → analyze-result-contract-BUgK3759.js} +675 -639
- package/dist/chunks/analyze-result-contract-S8u7CcPL.js +1 -0
- package/dist/chunks/{calendar-preferences-dialog-B3fnFtJt.js → calendar-preferences-dialog-Ci3rHHgA.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-9SvYDLp6.js → calendar-preferences-dialog-i3-jBIYS.js} +3 -3
- package/dist/chunks/{dashboard-briefing-launcher-APVyc9al.js → dashboard-briefing-launcher-BpwjeJsQ.js} +4 -4
- package/dist/chunks/{dashboard-briefing-launcher-D3R4R7ww.js → dashboard-briefing-launcher-DiEpMS9E.js} +1 -1
- package/dist/chunks/{dashboard-controls-v7jslCXR.js → dashboard-controls-BaUUrvSI.js} +1 -1
- package/dist/chunks/{dashboard-controls-CHDQlMZ9.js → dashboard-controls-Bkjpgr3d.js} +5 -5
- package/dist/chunks/{dashboard-json-L1Qo5xcX.js → dashboard-json-CxNyExRm.js} +1 -1
- package/dist/chunks/{dashboard-json-DF_syvRu.js → dashboard-json-DvULhhN2.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-DwfIWUe-.js → edit-dashboard-visual-DBrsgEtL.js} +4 -4
- package/dist/chunks/{edit-dashboard-visual-qdruQruO.js → edit-dashboard-visual-DJRPiKdY.js} +1 -1
- package/dist/chunks/{index-DH7hOGQl.js → index-BepF6hoa.js} +2 -2
- package/dist/chunks/{index-BdVymLVq.js → index-Drz04wqE.js} +5 -5
- package/dist/chunks/{switch-CYG3dY8r.js → switch-D2oOmorN.js} +1 -1
- package/dist/chunks/{switch-BiU6-YSY.js → switch-qUw8u-gU.js} +1 -1
- package/dist/chunks/update-policy-BmtOqvbf.js +3 -0
- package/dist/chunks/update-policy-KImUg4Od.js +831 -0
- package/dist/chunks/{use-create-flow-overlay-state-CwUkhLBL.js → use-create-flow-overlay-state-CFJIHt5D.js} +3 -3
- package/dist/chunks/{use-create-flow-overlay-state-qe7DHQKr.js → use-create-flow-overlay-state-DrkYiyQz.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -0
- package/dist/data-app-codegen/index.js +22 -0
- package/dist/data-app-codegen-node/index.cjs +462 -0
- package/dist/data-app-codegen-node/index.js +1424 -0
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +1 -1
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/data-app-codegen-node.d.ts +1165 -0
- package/dist/types/data-app-codegen.d.ts +1137 -0
- package/package.json +9 -1
- package/dist/chunks/analyze-result-contract-OqFtOCpZ.js +0 -1
package/dist/chunks/{analyze-result-contract-CUO5QmqV.js → analyze-result-contract-BUgK3759.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
|
-
const
|
|
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
|
-
},
|
|
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
|
-
]),
|
|
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
|
-
...
|
|
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
|
|
154
|
-
return
|
|
153
|
+
function Qt(i) {
|
|
154
|
+
return Z(i).ok;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
const
|
|
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
|
|
161
|
-
return
|
|
162
|
-
`schemaVersion must be ${
|
|
163
|
-
), (typeof
|
|
164
|
-
...
|
|
165
|
-
), Array.isArray(
|
|
166
|
-
|
|
167
|
-
}), Array.isArray(
|
|
168
|
-
|
|
169
|
-
}), Array.isArray(
|
|
170
|
-
|
|
171
|
-
}), Array.isArray(
|
|
172
|
-
|
|
173
|
-
...
|
|
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
|
-
}),
|
|
176
|
-
|
|
177
|
-
...
|
|
175
|
+
}), t.unsupportedInsights !== void 0 && (Array.isArray(t.unsupportedInsights) ? t.unsupportedInsights.forEach((s, n) => {
|
|
176
|
+
o.push(
|
|
177
|
+
...Ze(
|
|
178
178
|
s,
|
|
179
|
-
`unsupportedInsights.${
|
|
179
|
+
`unsupportedInsights.${n}`
|
|
180
180
|
)
|
|
181
181
|
);
|
|
182
|
-
}) :
|
|
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
|
|
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
|
-
),
|
|
191
|
-
var
|
|
192
|
-
const u = a((
|
|
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 (!
|
|
195
|
+
if (!o && !t)
|
|
196
196
|
return [];
|
|
197
|
-
const s = [],
|
|
198
|
-
(
|
|
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
|
|
202
|
-
return (
|
|
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,
|
|
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
|
-
|
|
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
|
|
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
|
|
223
|
-
|
|
224
|
-
const
|
|
225
|
-
return
|
|
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
|
-
) :
|
|
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(
|
|
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(
|
|
231
|
+
), g(o.browserSmokeChecks) || t.push(
|
|
232
232
|
"implementationChecklist.browserSmokeChecks must be an array of strings."
|
|
233
|
-
),
|
|
233
|
+
), t;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
const
|
|
237
|
-
if (!
|
|
238
|
-
return [`${
|
|
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
|
|
241
|
-
const l = a(
|
|
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(`${
|
|
243
|
+
s.push(`${o}.bindings.${r} must be an object.`);
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
246
|
g(l.appliesToViewIds) || s.push(
|
|
247
|
-
`${
|
|
247
|
+
`${o}.bindings.${r}.appliesToViewIds must be an array of strings.`
|
|
248
248
|
), s.push(
|
|
249
|
-
...
|
|
249
|
+
...p(
|
|
250
250
|
l.fieldRef,
|
|
251
|
-
`${
|
|
251
|
+
`${o}.bindings.${r}.fieldRef`
|
|
252
252
|
)
|
|
253
253
|
);
|
|
254
254
|
}), s;
|
|
255
255
|
}
|
|
256
|
-
function _e(i,
|
|
257
|
-
const
|
|
258
|
-
if (!
|
|
259
|
-
return [`${
|
|
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
|
|
262
|
-
return o.fields !== void 0 && (Array.isArray(
|
|
263
|
-
s.push(...
|
|
264
|
-
}) : s.push(`${
|
|
265
|
-
if (!Array.isArray(
|
|
266
|
-
return s.push(`${
|
|
267
|
-
|
|
268
|
-
s.push(...
|
|
269
|
-
}), $(
|
|
270
|
-
const
|
|
271
|
-
return (
|
|
272
|
-
...
|
|
273
|
-
value:
|
|
274
|
-
path: `${
|
|
275
|
-
queryKind: typeof
|
|
276
|
-
sdkBuilder: typeof
|
|
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
|
-
...
|
|
278
|
+
...E(t, `${o}`)
|
|
279
279
|
), s;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
var
|
|
283
|
-
const
|
|
284
|
-
if (!
|
|
285
|
-
return
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
-
`${
|
|
292
|
+
`${o}.sdkSpec.spec.totals.mode must be server when tableBehavior.totals.mode is server.`
|
|
294
293
|
) : u.push(
|
|
295
|
-
...
|
|
296
|
-
left:
|
|
294
|
+
...je({
|
|
295
|
+
left: c.measures,
|
|
297
296
|
right: l.measures,
|
|
298
|
-
leftPath: `${
|
|
299
|
-
rightPath: `${
|
|
297
|
+
leftPath: `${o}.visualSpec.tableBehavior.totals.measures`,
|
|
298
|
+
rightPath: `${o}.sdkSpec.spec.totals.measures`
|
|
300
299
|
})
|
|
301
|
-
)),
|
|
302
|
-
`${
|
|
303
|
-
),
|
|
304
|
-
`${
|
|
305
|
-
),
|
|
306
|
-
`${
|
|
307
|
-
),
|
|
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
|
|
308
|
+
function je({
|
|
310
309
|
left: i,
|
|
311
|
-
right:
|
|
312
|
-
leftPath:
|
|
310
|
+
right: o,
|
|
311
|
+
leftPath: t,
|
|
313
312
|
rightPath: s
|
|
314
313
|
}) {
|
|
315
|
-
if (!Array.isArray(i) || !Array.isArray(
|
|
316
|
-
return [`${s} must match ${
|
|
317
|
-
const
|
|
318
|
-
return i.length !==
|
|
319
|
-
|
|
320
|
-
a(
|
|
321
|
-
a(
|
|
322
|
-
) ||
|
|
323
|
-
}),
|
|
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
|
|
326
|
-
return !i || !
|
|
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
|
|
332
|
-
const
|
|
333
|
-
if (
|
|
334
|
-
return
|
|
335
|
-
const
|
|
336
|
-
|
|
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
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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 (
|
|
344
|
-
...
|
|
345
|
-
), (typeof
|
|
346
|
-
...
|
|
347
|
-
), g(
|
|
348
|
-
s.push(`${
|
|
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
|
|
351
|
-
|
|
352
|
-
) ? new Set(
|
|
353
|
-
|
|
354
|
-
const
|
|
355
|
-
if (!
|
|
356
|
-
s.push(`${
|
|
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
|
|
360
|
-
`${
|
|
361
|
-
),
|
|
362
|
-
`${
|
|
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
|
-
...
|
|
365
|
-
|
|
366
|
-
`${
|
|
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
|
|
409
|
+
function X(i, o) {
|
|
374
410
|
if (i === void 0)
|
|
375
411
|
return [];
|
|
376
|
-
const
|
|
377
|
-
if (!
|
|
378
|
-
return [`${
|
|
412
|
+
const t = a(i);
|
|
413
|
+
if (!t)
|
|
414
|
+
return [`${o} must be an object.`];
|
|
379
415
|
const s = [
|
|
380
416
|
...h(
|
|
381
|
-
|
|
382
|
-
`${
|
|
417
|
+
t.valueFieldRef,
|
|
418
|
+
`${o}.valueFieldRef`
|
|
383
419
|
),
|
|
384
420
|
...h(
|
|
385
|
-
|
|
386
|
-
`${
|
|
421
|
+
t.labelFieldRef,
|
|
422
|
+
`${o}.labelFieldRef`
|
|
387
423
|
),
|
|
388
424
|
...h(
|
|
389
|
-
|
|
390
|
-
`${
|
|
425
|
+
t.filterFieldRef,
|
|
426
|
+
`${o}.filterFieldRef`
|
|
391
427
|
)
|
|
392
428
|
];
|
|
393
|
-
return
|
|
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
|
|
396
|
-
var
|
|
397
|
-
const
|
|
398
|
-
if (!
|
|
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
|
|
401
|
-
if (!
|
|
402
|
-
return
|
|
403
|
-
i.sdkBuilder &&
|
|
404
|
-
const s = a(
|
|
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
|
|
407
|
-
switch (
|
|
442
|
+
return t.push(`${i.path}.spec must be an object.`), t;
|
|
443
|
+
switch (o.builder) {
|
|
408
444
|
case "semaphor.metric":
|
|
409
|
-
|
|
410
|
-
...v(s,
|
|
411
|
-
...
|
|
412
|
-
...
|
|
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
|
-
...
|
|
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
|
-
|
|
466
|
+
t.push(
|
|
431
467
|
...v(s, be, `${i.path}.spec`),
|
|
432
|
-
...
|
|
433
|
-
...
|
|
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
|
-
...
|
|
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
|
-
...
|
|
484
|
+
...Ne(s, `${i.path}.spec`)
|
|
449
485
|
);
|
|
450
486
|
break;
|
|
451
487
|
case "semaphor.records":
|
|
452
|
-
|
|
488
|
+
t.push(
|
|
453
489
|
...v(s, ye, `${i.path}.spec`),
|
|
454
|
-
...
|
|
455
|
-
...
|
|
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
|
-
|
|
505
|
+
t.push(
|
|
470
506
|
...v(s, ve, `${i.path}.spec`),
|
|
471
507
|
...De(s, i.path),
|
|
472
|
-
...
|
|
508
|
+
...Ke(s.rows, `${i.path}.spec.rows`),
|
|
473
509
|
...Oe(
|
|
474
510
|
s.columns,
|
|
475
511
|
`${i.path}.spec.columns`
|
|
476
512
|
),
|
|
477
|
-
...
|
|
478
|
-
...
|
|
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
|
-
|
|
519
|
+
t.push(
|
|
484
520
|
...v(s, $e, `${i.path}.spec`),
|
|
485
|
-
...
|
|
486
|
-
), ((
|
|
487
|
-
...
|
|
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
|
|
530
|
+
return t;
|
|
495
531
|
}
|
|
496
|
-
function
|
|
497
|
-
const
|
|
498
|
-
if (i.driverMode !== void 0 && !fe.has(i.driverMode) &&
|
|
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
|
-
|
|
537
|
+
t.push(`${o}.calendarContext must be an object.`);
|
|
502
538
|
else {
|
|
503
|
-
s.tz !== void 0 && typeof s.tz != "string" &&
|
|
504
|
-
`${
|
|
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
|
|
507
|
-
if (
|
|
508
|
-
const
|
|
509
|
-
(!
|
|
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
|
|
549
|
+
return t;
|
|
514
550
|
}
|
|
515
|
-
function Te(i,
|
|
551
|
+
function Te(i, o) {
|
|
516
552
|
if (i === void 0)
|
|
517
553
|
return [];
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
520
|
-
return [`${
|
|
554
|
+
const t = a(i);
|
|
555
|
+
if (!t)
|
|
556
|
+
return [`${o} must be an object.`];
|
|
521
557
|
const s = [];
|
|
522
|
-
return
|
|
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
|
-
...
|
|
526
|
-
|
|
527
|
-
`${
|
|
561
|
+
...te(
|
|
562
|
+
n,
|
|
563
|
+
`${o}.measures.${r}`
|
|
528
564
|
)
|
|
529
|
-
), ((l = a(
|
|
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,
|
|
568
|
+
function v(i, o, t) {
|
|
533
569
|
const s = [];
|
|
534
|
-
return Object.keys(i).forEach((
|
|
535
|
-
|
|
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
|
|
539
|
-
return a(i.source) ? w(i.source, `${
|
|
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,
|
|
542
|
-
const
|
|
543
|
-
if (!
|
|
544
|
-
return [`${
|
|
545
|
-
const s = w(i.source, `${
|
|
546
|
-
return
|
|
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
|
|
549
|
-
const
|
|
550
|
-
return Array.isArray(i) && i.forEach((s,
|
|
551
|
-
|
|
552
|
-
}),
|
|
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
|
|
590
|
+
function N(i, o) {
|
|
555
591
|
if (i === void 0)
|
|
556
592
|
return [];
|
|
557
593
|
if (!Array.isArray(i))
|
|
558
|
-
return [`${
|
|
559
|
-
const
|
|
560
|
-
return i.forEach((s,
|
|
561
|
-
|
|
562
|
-
}),
|
|
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,
|
|
600
|
+
function T(i, o) {
|
|
565
601
|
if (i === void 0)
|
|
566
602
|
return [];
|
|
567
|
-
const
|
|
568
|
-
return
|
|
569
|
-
...
|
|
570
|
-
...
|
|
571
|
-
] : [`${
|
|
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
|
|
574
|
-
const
|
|
575
|
-
return Array.isArray(i) && i.forEach((s,
|
|
576
|
-
const
|
|
577
|
-
if (!
|
|
578
|
-
|
|
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
|
-
|
|
582
|
-
...
|
|
617
|
+
t.push(
|
|
618
|
+
...p(r.field, `${o}.${n}.field`)
|
|
583
619
|
);
|
|
584
|
-
}),
|
|
620
|
+
}), t;
|
|
585
621
|
}
|
|
586
|
-
function Oe(i,
|
|
622
|
+
function Oe(i, o) {
|
|
587
623
|
if (i === void 0)
|
|
588
624
|
return [];
|
|
589
|
-
const
|
|
590
|
-
return Array.isArray(i) ? (i.forEach((s,
|
|
591
|
-
const
|
|
592
|
-
if (!
|
|
593
|
-
|
|
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
|
-
|
|
597
|
-
...
|
|
632
|
+
t.push(
|
|
633
|
+
...p(r.field, `${o}.${n}.field`)
|
|
598
634
|
);
|
|
599
|
-
}),
|
|
635
|
+
}), t) : [`${o} must be an array.`];
|
|
600
636
|
}
|
|
601
|
-
function
|
|
602
|
-
const
|
|
603
|
-
return Array.isArray(i) && i.forEach((s,
|
|
604
|
-
const
|
|
605
|
-
if (!
|
|
606
|
-
|
|
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
|
-
|
|
610
|
-
...
|
|
645
|
+
t.push(
|
|
646
|
+
...p(r.field, `${o}.${n}.field`)
|
|
611
647
|
);
|
|
612
|
-
}),
|
|
648
|
+
}), t;
|
|
613
649
|
}
|
|
614
|
-
function
|
|
650
|
+
function Be(i, o) {
|
|
615
651
|
if (i === void 0)
|
|
616
652
|
return [];
|
|
617
653
|
if (!Array.isArray(i))
|
|
618
|
-
return [`${
|
|
619
|
-
const
|
|
620
|
-
return i.forEach((s,
|
|
621
|
-
const
|
|
622
|
-
if (!
|
|
623
|
-
|
|
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
|
-
|
|
627
|
-
...
|
|
628
|
-
...
|
|
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
|
-
}),
|
|
666
|
+
}), t;
|
|
631
667
|
}
|
|
632
|
-
function
|
|
633
|
-
const
|
|
634
|
-
if (!
|
|
635
|
-
return [`${
|
|
636
|
-
switch (
|
|
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
|
|
676
|
+
return p(t.field, `${o}.field`);
|
|
641
677
|
case "value":
|
|
642
|
-
return typeof
|
|
678
|
+
return typeof t.valueId != "string" || !t.valueId.trim() ? [`${o}.valueId is required.`] : [];
|
|
643
679
|
default:
|
|
644
|
-
return [`${
|
|
680
|
+
return [`${o}.kind must be label, field, or value.`];
|
|
645
681
|
}
|
|
646
682
|
}
|
|
647
|
-
function
|
|
648
|
-
return i === "asc" || i === "desc" ? [] : [`${
|
|
683
|
+
function J(i, o) {
|
|
684
|
+
return i === "asc" || i === "desc" ? [] : [`${o} must be asc or desc.`];
|
|
649
685
|
}
|
|
650
|
-
function _(i,
|
|
686
|
+
function _(i, o) {
|
|
651
687
|
if (i === void 0)
|
|
652
688
|
return [];
|
|
653
689
|
if (!Array.isArray(i))
|
|
654
|
-
return [`${
|
|
655
|
-
const
|
|
656
|
-
return i.forEach((s,
|
|
657
|
-
const
|
|
658
|
-
if (!
|
|
659
|
-
|
|
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
|
-
|
|
663
|
-
}),
|
|
698
|
+
t.push(...p(r.field, `${o}.${n}.field`));
|
|
699
|
+
}), t;
|
|
664
700
|
}
|
|
665
|
-
function
|
|
666
|
-
return !Array.isArray(i) || i.length === 0 ? [`${
|
|
701
|
+
function P(i, o) {
|
|
702
|
+
return !Array.isArray(i) || i.length === 0 ? [`${o} must be a non-empty array.`] : [];
|
|
667
703
|
}
|
|
668
|
-
function
|
|
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
|
|
683
|
-
const
|
|
684
|
-
return (
|
|
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
|
|
687
|
-
const
|
|
688
|
-
if (!
|
|
689
|
-
return [`${
|
|
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(
|
|
692
|
-
...
|
|
693
|
-
|
|
694
|
-
`${
|
|
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
|
|
699
|
-
const
|
|
700
|
-
if (!
|
|
701
|
-
return [`${
|
|
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
|
|
704
|
-
...
|
|
705
|
-
...
|
|
706
|
-
...
|
|
707
|
-
...
|
|
708
|
-
), typeof
|
|
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
|
|
711
|
-
const
|
|
712
|
-
if (!
|
|
713
|
-
return [`${
|
|
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
|
|
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
|
|
718
|
-
const
|
|
719
|
-
if (!
|
|
720
|
-
return [`${
|
|
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
|
|
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
|
|
725
|
-
const
|
|
726
|
-
if (!
|
|
727
|
-
return [`${
|
|
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
|
|
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
|
|
732
|
-
const
|
|
733
|
-
if (!
|
|
734
|
-
return [`${
|
|
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
|
|
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
|
-
...
|
|
740
|
-
|
|
741
|
-
`${
|
|
775
|
+
...te(
|
|
776
|
+
n,
|
|
777
|
+
`${o}.measures.${r}`
|
|
742
778
|
)
|
|
743
|
-
), ((l = a(
|
|
744
|
-
}),
|
|
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
|
|
747
|
-
const
|
|
748
|
-
if (!
|
|
749
|
-
return [`${
|
|
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 (
|
|
787
|
+
switch (t.kind) {
|
|
752
788
|
case "server_query":
|
|
753
|
-
$(
|
|
754
|
-
`${
|
|
755
|
-
),
|
|
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
|
|
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
|
|
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(`${
|
|
802
|
+
s.push(`${o}.kind must be a supported computation kind.`);
|
|
767
803
|
}
|
|
768
804
|
return s;
|
|
769
805
|
}
|
|
770
|
-
function
|
|
771
|
-
const
|
|
772
|
-
if (!
|
|
773
|
-
return [`${
|
|
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
|
|
776
|
-
(typeof
|
|
777
|
-
return we.has(
|
|
778
|
-
`${
|
|
779
|
-
),
|
|
780
|
-
...
|
|
781
|
-
|
|
782
|
-
`${
|
|
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
|
-
),
|
|
785
|
-
...
|
|
786
|
-
|
|
787
|
-
`${
|
|
820
|
+
), t.nextRepairAction !== void 0 && s.push(
|
|
821
|
+
...Xe(
|
|
822
|
+
t.nextRepairAction,
|
|
823
|
+
`${o}.nextRepairAction`
|
|
788
824
|
)
|
|
789
825
|
), s;
|
|
790
826
|
}
|
|
791
|
-
function
|
|
792
|
-
const
|
|
793
|
-
if (!
|
|
794
|
-
return [`${
|
|
795
|
-
const s = [],
|
|
796
|
-
return Object.keys(
|
|
797
|
-
|
|
798
|
-
`${
|
|
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
|
-
}),
|
|
801
|
-
`${
|
|
802
|
-
),
|
|
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
|
|
805
|
-
const
|
|
806
|
-
if (!
|
|
807
|
-
return [`${
|
|
808
|
-
const s = [],
|
|
809
|
-
Object.keys(
|
|
810
|
-
|
|
811
|
-
`${
|
|
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
|
-
...
|
|
850
|
+
...H(t.source, `${o}.source`)
|
|
815
851
|
), s.push(
|
|
816
|
-
...
|
|
852
|
+
...H(t.target, `${o}.target`)
|
|
817
853
|
);
|
|
818
|
-
for (const
|
|
819
|
-
const l =
|
|
854
|
+
for (const r of ["sourceFields", "targetFields"]) {
|
|
855
|
+
const l = t[r];
|
|
820
856
|
if (!Array.isArray(l) || l.length === 0) {
|
|
821
|
-
s.push(`${
|
|
857
|
+
s.push(`${o}.${r} must be a non-empty endpoint field array.`);
|
|
822
858
|
continue;
|
|
823
859
|
}
|
|
824
|
-
l.forEach((u,
|
|
860
|
+
l.forEach((u, c) => {
|
|
825
861
|
s.push(
|
|
826
|
-
...
|
|
862
|
+
...et(u, `${o}.${r}.${c}`)
|
|
827
863
|
);
|
|
828
864
|
});
|
|
829
865
|
}
|
|
830
866
|
return s;
|
|
831
867
|
}
|
|
832
|
-
function
|
|
833
|
-
const
|
|
834
|
-
if (!
|
|
835
|
-
return [`${
|
|
836
|
-
const s = [],
|
|
837
|
-
return Object.keys(
|
|
838
|
-
|
|
839
|
-
`${
|
|
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
|
|
842
|
-
|
|
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
|
-
`${
|
|
880
|
+
`${o}.dataType must be string, number, boolean, date, datetime, or unknown.`
|
|
845
881
|
), s;
|
|
846
882
|
}
|
|
847
|
-
function
|
|
848
|
-
const
|
|
849
|
-
if (!
|
|
850
|
-
return [`${
|
|
851
|
-
const s = [],
|
|
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(
|
|
860
|
-
|
|
861
|
-
`${
|
|
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
|
-
}),
|
|
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
|
|
904
|
+
function ee(i) {
|
|
869
905
|
return he.has(i);
|
|
870
906
|
}
|
|
871
|
-
function h(i,
|
|
872
|
-
return i === void 0 ? [] :
|
|
907
|
+
function h(i, o) {
|
|
908
|
+
return i === void 0 ? [] : p(i, o);
|
|
873
909
|
}
|
|
874
|
-
function
|
|
875
|
-
const
|
|
876
|
-
if (!
|
|
877
|
-
return [`${
|
|
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
|
|
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
|
|
882
|
-
const
|
|
883
|
-
if (!
|
|
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 (
|
|
886
|
-
const
|
|
887
|
-
return
|
|
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(`${
|
|
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((
|
|
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),
|
|
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
|
-
]),
|
|
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
|
-
]),
|
|
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
|
-
]),
|
|
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:
|
|
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,
|
|
1006
|
-
return e.object(i).passthrough().superRefine((
|
|
1007
|
-
for (const
|
|
1008
|
-
Object.prototype.hasOwnProperty.call(
|
|
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: [
|
|
1011
|
-
message: `Required field "${
|
|
1046
|
+
path: [n],
|
|
1047
|
+
message: `Required field "${n}" is missing.`
|
|
1012
1048
|
});
|
|
1013
1049
|
});
|
|
1014
1050
|
}
|
|
1015
|
-
const
|
|
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(),
|
|
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(),
|
|
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
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
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:
|
|
1047
|
-
}).passthrough(),
|
|
1082
|
+
aggregate: d.optional()
|
|
1083
|
+
}).passthrough(), it = e.object({
|
|
1048
1084
|
kind: e.literal("field"),
|
|
1049
1085
|
field: y,
|
|
1050
|
-
aggregate:
|
|
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(
|
|
1062
|
-
defaultAggregate:
|
|
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:
|
|
1113
|
+
format: ie.optional(),
|
|
1078
1114
|
tags: e.array(e.string()).optional()
|
|
1079
|
-
}).passthrough(),
|
|
1115
|
+
}).passthrough(), V = y.and(
|
|
1080
1116
|
e.object({
|
|
1081
|
-
semanticAggregate:
|
|
1082
|
-
effectiveAggregate:
|
|
1083
|
-
aggregateSource:
|
|
1117
|
+
semanticAggregate: d.optional(),
|
|
1118
|
+
effectiveAggregate: d.optional(),
|
|
1119
|
+
aggregateSource: se.optional(),
|
|
1084
1120
|
derivedField: re.optional()
|
|
1085
1121
|
}).passthrough()
|
|
1086
|
-
),
|
|
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(),
|
|
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(),
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
]),
|
|
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:
|
|
1111
|
-
aggregate:
|
|
1112
|
-
semanticAggregate:
|
|
1113
|
-
effectiveAggregate:
|
|
1114
|
-
aggregateSource:
|
|
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:
|
|
1158
|
+
aggregate: d.optional(),
|
|
1123
1159
|
source: S.optional(),
|
|
1124
1160
|
derivedField: re.optional()
|
|
1125
|
-
}).passthrough(),
|
|
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(),
|
|
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:
|
|
1140
|
-
}).passthrough(),
|
|
1175
|
+
repairHint: ae.optional()
|
|
1176
|
+
}).passthrough(), le = e.object({
|
|
1141
1177
|
ok: e.boolean(),
|
|
1142
|
-
errors: e.array(
|
|
1143
|
-
warnings: e.array(
|
|
1144
|
-
repairHints: e.array(
|
|
1145
|
-
}).passthrough(),
|
|
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(),
|
|
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:
|
|
1160
|
-
},
|
|
1161
|
-
...
|
|
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(),
|
|
1173
|
-
...
|
|
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(),
|
|
1184
|
-
...
|
|
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(),
|
|
1198
|
-
...
|
|
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(),
|
|
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(),
|
|
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:
|
|
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
|
-
),
|
|
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:
|
|
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
|
-
]),
|
|
1281
|
+
]), bt = e.enum([
|
|
1246
1282
|
"present",
|
|
1247
1283
|
"presentNull",
|
|
1248
1284
|
"missing",
|
|
1249
1285
|
"densified"
|
|
1250
|
-
]),
|
|
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
|
-
]),
|
|
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(), $
|
|
1300
|
+
}).passthrough(), $t = e.union([
|
|
1265
1301
|
e.object({
|
|
1266
1302
|
kind: e.literal("additive"),
|
|
1267
|
-
aggregate:
|
|
1303
|
+
aggregate: d.optional()
|
|
1268
1304
|
}).passthrough(),
|
|
1269
1305
|
e.object({
|
|
1270
1306
|
kind: e.literal("semiAdditive"),
|
|
1271
|
-
aggregate:
|
|
1307
|
+
aggregate: d.optional(),
|
|
1272
1308
|
grain: oe.optional()
|
|
1273
1309
|
}).passthrough(),
|
|
1274
1310
|
e.object({
|
|
1275
1311
|
kind: e.literal("nonAdditive"),
|
|
1276
|
-
aggregate:
|
|
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
|
-
]),
|
|
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:
|
|
1293
|
-
format:
|
|
1294
|
-
totalBehavior:
|
|
1295
|
-
semantics: $
|
|
1296
|
-
}).passthrough(),
|
|
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:
|
|
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(),
|
|
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(),
|
|
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:
|
|
1370
|
+
subtotalFunction: d.optional(),
|
|
1335
1371
|
childCount: e.number().optional(),
|
|
1336
|
-
actions: e.array(
|
|
1372
|
+
actions: e.array(kt).optional()
|
|
1337
1373
|
},
|
|
1338
1374
|
["value"]
|
|
1339
|
-
),
|
|
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(),
|
|
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:
|
|
1387
|
-
role:
|
|
1422
|
+
presence: bt,
|
|
1423
|
+
role: yt,
|
|
1388
1424
|
calculationId: e.string().optional()
|
|
1389
1425
|
},
|
|
1390
1426
|
["value"]
|
|
1391
|
-
),
|
|
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(),
|
|
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:
|
|
1445
|
+
by: ft
|
|
1410
1446
|
},
|
|
1411
1447
|
["by"]
|
|
1412
|
-
),
|
|
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(),
|
|
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(),
|
|
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(
|
|
1429
|
-
}).passthrough(),
|
|
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(),
|
|
1438
|
-
...
|
|
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(),
|
|
1445
|
-
measuresById: e.record(e.string(),
|
|
1446
|
-
calculationsById: e.record(e.string(),
|
|
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:
|
|
1449
|
-
columns:
|
|
1484
|
+
rows: Q,
|
|
1485
|
+
columns: Q
|
|
1450
1486
|
}).passthrough(),
|
|
1451
|
-
nodesById: e.record(e.string(),
|
|
1452
|
-
layout:
|
|
1453
|
-
cells: e.array(
|
|
1454
|
-
totals:
|
|
1455
|
-
sort: e.array(
|
|
1456
|
-
formattingContext:
|
|
1457
|
-
pageInfo:
|
|
1458
|
-
expansion:
|
|
1459
|
-
}).passthrough(),
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
]),
|
|
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(),
|
|
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
|
-
]),
|
|
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(
|
|
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:
|
|
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:
|
|
1565
|
+
reasonCode: Y,
|
|
1530
1566
|
message: e.string(),
|
|
1531
1567
|
recommendedNextStep: e.string().optional()
|
|
1532
1568
|
}).passthrough()
|
|
1533
1569
|
).optional()
|
|
1534
|
-
}).passthrough(),
|
|
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(
|
|
1541
|
-
}).passthrough(),
|
|
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(
|
|
1557
|
-
result:
|
|
1558
|
-
validation:
|
|
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:
|
|
1563
|
-
diagnosticFeedback:
|
|
1564
|
-
population:
|
|
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
|
|
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(
|
|
1608
|
+
return e.array(ut).optional();
|
|
1573
1609
|
case "coverage":
|
|
1574
1610
|
return ce.optional();
|
|
1575
1611
|
case "diagnosticFeedback":
|
|
1576
|
-
return
|
|
1612
|
+
return ue.optional();
|
|
1577
1613
|
case "executionFieldArray":
|
|
1578
|
-
return e.array(
|
|
1614
|
+
return e.array(V).optional();
|
|
1579
1615
|
case "executionResult":
|
|
1580
|
-
return
|
|
1616
|
+
return Dt.optional();
|
|
1581
1617
|
case "number":
|
|
1582
1618
|
return e.number().finite().optional();
|
|
1583
1619
|
case "population":
|
|
1584
|
-
return
|
|
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
|
|
1636
|
+
return le.optional();
|
|
1601
1637
|
}
|
|
1602
1638
|
}
|
|
1603
|
-
const
|
|
1604
|
-
Object.entries(
|
|
1605
|
-
([i,
|
|
1639
|
+
const Ot = Object.fromEntries(
|
|
1640
|
+
Object.entries(B).map(
|
|
1641
|
+
([i, o]) => [i, Kt(o)]
|
|
1606
1642
|
)
|
|
1607
|
-
),
|
|
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:
|
|
1657
|
+
aggregate: d.optional(),
|
|
1622
1658
|
sourceKey: e.string().optional(),
|
|
1623
|
-
source:
|
|
1624
|
-
}).passthrough(),
|
|
1659
|
+
source: L.optional()
|
|
1660
|
+
}).passthrough(), pe = e.object({
|
|
1625
1661
|
id: e.string().optional(),
|
|
1626
1662
|
builder: e.literal("semaphor.inputOptions"),
|
|
1627
|
-
source:
|
|
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(),
|
|
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(),
|
|
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:
|
|
1649
|
-
bindings: e.array(
|
|
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(),
|
|
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(),
|
|
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:
|
|
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(),
|
|
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:
|
|
1693
|
-
bindings: e.array(
|
|
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(),
|
|
1697
|
-
schemaVersion: e.literal(
|
|
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(
|
|
1703
|
-
inputs: e.array(
|
|
1704
|
-
views: e.array(
|
|
1705
|
-
filterContracts: e.array(
|
|
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,
|
|
1735
|
-
const
|
|
1736
|
-
for (const s of
|
|
1737
|
-
|
|
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
|
-
}),
|
|
1742
|
-
Object.keys(
|
|
1777
|
+
}), Gt = new Set(
|
|
1778
|
+
Object.keys(B)
|
|
1743
1779
|
);
|
|
1744
|
-
function
|
|
1780
|
+
function Wt() {
|
|
1745
1781
|
return Object.keys(
|
|
1746
|
-
|
|
1782
|
+
B
|
|
1747
1783
|
);
|
|
1748
1784
|
}
|
|
1749
|
-
function
|
|
1750
|
-
return
|
|
1785
|
+
function Ut(i) {
|
|
1786
|
+
return Gt.has(i);
|
|
1751
1787
|
}
|
|
1752
|
-
function
|
|
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
|
|
1756
|
-
(s) => !
|
|
1791
|
+
const t = Object.keys(i).filter(
|
|
1792
|
+
(s) => !Ut(s)
|
|
1757
1793
|
);
|
|
1758
|
-
if (
|
|
1794
|
+
if (t.length)
|
|
1759
1795
|
throw new Error(
|
|
1760
|
-
`Semaphor analyze result contains unsupported top-level field(s): ${
|
|
1796
|
+
`Semaphor analyze result contains unsupported top-level field(s): ${t.join(", ")}.`
|
|
1761
1797
|
);
|
|
1762
|
-
return
|
|
1798
|
+
return Mt.parse(i);
|
|
1763
1799
|
}
|
|
1764
1800
|
export {
|
|
1765
1801
|
ce as A,
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
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
|
-
|
|
1813
|
+
Wt as g,
|
|
1778
1814
|
y as h,
|
|
1779
|
-
|
|
1815
|
+
Qt as i,
|
|
1780
1816
|
re as j,
|
|
1781
|
-
|
|
1817
|
+
V as k,
|
|
1782
1818
|
O as l,
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
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
|
};
|