react-semaphor 0.1.405 → 0.1.407
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 +2 -2
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/chunks/analyze-result-contract-8nxUOWp8.js +1 -0
- package/dist/chunks/{analyze-result-contract-BUgK3759.js → analyze-result-contract-DPjm6btg.js} +303 -267
- package/dist/chunks/{calendar-preferences-dialog-yyKVESsD.js → calendar-preferences-dialog-BDovl96B.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-kD_eKqZ6.js → calendar-preferences-dialog-BEJunQM-.js} +3 -3
- package/dist/chunks/{dashboard-briefing-launcher-DsFfLdYP.js → dashboard-briefing-launcher-D-G1kXb8.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-puN85iMD.js → dashboard-briefing-launcher-DmybDHiR.js} +4 -4
- package/dist/chunks/{dashboard-controls-CiHRgAaH.js → dashboard-controls-DIPQW6Vj.js} +1 -1
- package/dist/chunks/{dashboard-controls-BjbfKTaU.js → dashboard-controls-DgjlAGWu.js} +5 -5
- package/dist/chunks/{dashboard-json-C2hOm_iP.js → dashboard-json-DUmEB8x3.js} +3 -3
- package/dist/chunks/{dashboard-json-BPPYDVqC.js → dashboard-json-DvW8_MWp.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-Czq-e2AB.js → edit-dashboard-visual-BZnVLA4S.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-C7Wbdde4.js → edit-dashboard-visual-BuwFsoeW.js} +4 -4
- package/dist/chunks/{index-YXD_iY9T.js → index-D7JKnhyA.js} +2 -2
- package/dist/chunks/{index-VIOQ0Poi.js → index-DhkNgPPm.js} +5 -5
- package/dist/chunks/{switch-oim6Xl36.js → switch-DMlqgIx_.js} +1 -1
- package/dist/chunks/{switch-CXMExaSF.js → switch-DgiogS4X.js} +1 -1
- package/dist/chunks/{update-policy-BmtOqvbf.js → update-policy-2M0canB_.js} +1 -1
- package/dist/chunks/{update-policy-KImUg4Od.js → update-policy-Bv3_5LFK.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-Be93UF6S.js → use-create-flow-overlay-state-B8clS9IG.js} +3 -3
- package/dist/chunks/{use-create-flow-overlay-state-CCpI38qK.js → use-create-flow-overlay-state-C9QPAd9_.js} +1 -1
- package/dist/chunks/validators-BCQB11_y.js +1 -0
- package/dist/chunks/{validators-B1Mgdr3T.js → validators-DaBsAUsR.js} +254 -262
- 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 +2 -2
- 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 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +2 -2
- 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 +2 -2
- 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/analytics-protocol.d.ts +0 -5
- package/dist/types/dashboard-assistant.d.ts +0 -5
- package/dist/types/dashboard-authoring.d.ts +0 -5
- package/dist/types/dashboard.d.ts +0 -5
- package/dist/types/data-app-builder.d.ts +0 -5
- package/dist/types/data-app-codegen-node.d.ts +0 -5
- package/dist/types/data-app-codegen.d.ts +0 -5
- package/dist/types/data-app-sdk-adapters.d.ts +0 -5
- package/dist/types/data-app-sdk-validation.d.ts +0 -5
- package/dist/types/data-app-sdk.d.ts +0 -5
- package/dist/types/main.d.ts +0 -5
- package/dist/types/shared.d.ts +0 -5
- package/dist/types/surfboard.d.ts +0 -5
- package/dist/types/types.d.ts +0 -5
- package/package.json +1 -1
- package/src/data-app-sdk/README.md +7 -0
- package/dist/chunks/analyze-result-contract-S8u7CcPL.js +0 -1
- package/dist/chunks/validators-DFOX0tYY.js +0 -1
package/dist/chunks/{analyze-result-contract-BUgK3759.js → analyze-result-contract-DPjm6btg.js}
RENAMED
|
@@ -39,25 +39,25 @@ const B = {
|
|
|
39
39
|
periodRows: "recordArray",
|
|
40
40
|
sql: "unknown",
|
|
41
41
|
omitted: "stringArray"
|
|
42
|
-
},
|
|
42
|
+
}, O = "semaphor-data-app-codegen-summary/v1", Yt = "semaphor-data-app-codegen-summary-validator/v2", he = /* @__PURE__ */ new Set([
|
|
43
43
|
"metric",
|
|
44
44
|
"records",
|
|
45
45
|
"matrix",
|
|
46
46
|
"analysis",
|
|
47
47
|
"sql_fallback"
|
|
48
|
-
]),
|
|
48
|
+
]), fe = /* @__PURE__ */ new Set([
|
|
49
49
|
"semaphor.metric",
|
|
50
50
|
"semaphor.records",
|
|
51
51
|
"semaphor.matrix",
|
|
52
52
|
"semaphor.analysis",
|
|
53
53
|
"semaphor.sql"
|
|
54
|
-
]),
|
|
54
|
+
]), be = /* @__PURE__ */ new Set([
|
|
55
55
|
"absolute_delta",
|
|
56
56
|
"largest_negative",
|
|
57
57
|
"largest_positive",
|
|
58
58
|
"positive_and_negative",
|
|
59
59
|
"all"
|
|
60
|
-
]),
|
|
60
|
+
]), Z = /* @__PURE__ */ new Set([
|
|
61
61
|
"source",
|
|
62
62
|
"id",
|
|
63
63
|
"label",
|
|
@@ -72,8 +72,8 @@ const B = {
|
|
|
72
72
|
"relationshipHint",
|
|
73
73
|
"limit",
|
|
74
74
|
"derivedFields"
|
|
75
|
-
]),
|
|
76
|
-
...
|
|
75
|
+
]), ye = /* @__PURE__ */ new Set([
|
|
76
|
+
...Z,
|
|
77
77
|
"analysis",
|
|
78
78
|
"timeWindow",
|
|
79
79
|
"filters",
|
|
@@ -82,7 +82,7 @@ const B = {
|
|
|
82
82
|
"calendarContext",
|
|
83
83
|
"chartTitle",
|
|
84
84
|
"chartType"
|
|
85
|
-
]),
|
|
85
|
+
]), ve = /* @__PURE__ */ new Set([
|
|
86
86
|
"source",
|
|
87
87
|
"id",
|
|
88
88
|
"label",
|
|
@@ -97,7 +97,7 @@ const B = {
|
|
|
97
97
|
"pagination",
|
|
98
98
|
"totals",
|
|
99
99
|
"derivedFields"
|
|
100
|
-
]),
|
|
100
|
+
]), $e = /* @__PURE__ */ new Set([
|
|
101
101
|
"source",
|
|
102
102
|
"id",
|
|
103
103
|
"label",
|
|
@@ -111,7 +111,7 @@ const B = {
|
|
|
111
111
|
"expansion",
|
|
112
112
|
"layout",
|
|
113
113
|
"displayLimits"
|
|
114
|
-
]),
|
|
114
|
+
]), Se = /* @__PURE__ */ new Set([
|
|
115
115
|
"source",
|
|
116
116
|
"id",
|
|
117
117
|
"label",
|
|
@@ -122,7 +122,7 @@ const B = {
|
|
|
122
122
|
"limit",
|
|
123
123
|
"pagination",
|
|
124
124
|
"rationale"
|
|
125
|
-
]),
|
|
125
|
+
]), we = /* @__PURE__ */ new Set([
|
|
126
126
|
"kpi",
|
|
127
127
|
"line_chart",
|
|
128
128
|
"bar_chart",
|
|
@@ -135,7 +135,7 @@ const B = {
|
|
|
135
135
|
"narrative",
|
|
136
136
|
"text_block",
|
|
137
137
|
"custom"
|
|
138
|
-
]),
|
|
138
|
+
]), ke = /* @__PURE__ */ new Set([
|
|
139
139
|
"missing_measure",
|
|
140
140
|
"missing_dimension",
|
|
141
141
|
"missing_date",
|
|
@@ -150,38 +150,38 @@ const B = {
|
|
|
150
150
|
"requires_sql_escape_hatch",
|
|
151
151
|
"unsupported_sdk_capability"
|
|
152
152
|
]);
|
|
153
|
-
function
|
|
154
|
-
return
|
|
153
|
+
function Wt(i) {
|
|
154
|
+
return X(i).ok;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function X(i) {
|
|
157
157
|
const o = [];
|
|
158
158
|
if (!i || typeof i != "object")
|
|
159
159
|
return { ok: !1, issues: ["Summary must be an object."] };
|
|
160
160
|
const t = i;
|
|
161
|
-
return t.schemaVersion !==
|
|
162
|
-
`schemaVersion must be ${
|
|
161
|
+
return t.schemaVersion !== O && o.push(
|
|
162
|
+
`schemaVersion must be ${O}.`
|
|
163
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
|
-
...
|
|
164
|
+
...Ae(t.implementationChecklist)
|
|
165
165
|
), Array.isArray(t.sources) && t.sources.forEach((s, n) => {
|
|
166
166
|
o.push(...w(s, `sources.${n}`));
|
|
167
167
|
}), Array.isArray(t.inputs) && t.inputs.forEach((s, n) => {
|
|
168
|
-
o.push(...
|
|
168
|
+
o.push(..._e(s, `inputs.${n}`));
|
|
169
169
|
}), Array.isArray(t.views) && t.views.forEach((s, n) => {
|
|
170
|
-
o.push(...
|
|
170
|
+
o.push(...je(s, `views.${n}`));
|
|
171
171
|
}), Array.isArray(t.filterContracts) && t.filterContracts.forEach((s, n) => {
|
|
172
172
|
o.push(
|
|
173
|
-
...
|
|
173
|
+
...Fe(s, `filterContracts.${n}`)
|
|
174
174
|
);
|
|
175
175
|
}), t.unsupportedInsights !== void 0 && (Array.isArray(t.unsupportedInsights) ? t.unsupportedInsights.forEach((s, n) => {
|
|
176
176
|
o.push(
|
|
177
|
-
...
|
|
177
|
+
...Je(
|
|
178
178
|
s,
|
|
179
179
|
`unsupportedInsights.${n}`
|
|
180
180
|
)
|
|
181
181
|
);
|
|
182
|
-
}) : o.push("unsupportedInsights must be an array.")), o.push(...
|
|
182
|
+
}) : o.push("unsupportedInsights must be an array.")), o.push(...Ie(t)), { ok: o.length === 0, issues: o };
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function Ie(i) {
|
|
185
185
|
const o = Array.isArray(i.unsupportedInsights) && i.unsupportedInsights.some(
|
|
186
186
|
(l) => {
|
|
187
187
|
var u;
|
|
@@ -207,7 +207,7 @@ function w(i, o) {
|
|
|
207
207
|
const t = a(i);
|
|
208
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
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ae(i) {
|
|
211
211
|
const o = a(i);
|
|
212
212
|
if (!o)
|
|
213
213
|
return ["implementationChecklist must be an object."];
|
|
@@ -232,12 +232,12 @@ function Ie(i) {
|
|
|
232
232
|
"implementationChecklist.browserSmokeChecks must be an array of strings."
|
|
233
233
|
), t;
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function _e(i, o) {
|
|
236
236
|
const t = a(i);
|
|
237
237
|
if (!t)
|
|
238
238
|
return [`${o} must be an object.`];
|
|
239
239
|
const s = [];
|
|
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(...
|
|
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(...J(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
241
|
const l = a(n);
|
|
242
242
|
if (!l) {
|
|
243
243
|
s.push(`${o}.bindings.${r} must be an object.`);
|
|
@@ -253,12 +253,12 @@ function Ae(i, o) {
|
|
|
253
253
|
);
|
|
254
254
|
}), s;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function je(i, o) {
|
|
257
257
|
const t = a(i);
|
|
258
258
|
if (!t)
|
|
259
259
|
return [`${o} must be an object.`];
|
|
260
260
|
const s = [];
|
|
261
|
-
if ((typeof t.id != "string" || !t.id.trim()) && s.push(`${o}.id is required.`), t.visualSpec !== void 0 && s.push(...
|
|
261
|
+
if ((typeof t.id != "string" || !t.id.trim()) && s.push(`${o}.id is required.`), t.visualSpec !== void 0 && s.push(...ze(t.visualSpec, `${o}.visualSpec`)), t.computation !== void 0 && s.push(...Xe(t.computation, `${o}.computation`)), Ue(t))
|
|
262
262
|
return s.push(...E(t, `${o}`)), t.fields !== void 0 && (Array.isArray(t.fields) ? t.fields.forEach((r, l) => {
|
|
263
263
|
s.push(...p(r, `${o}.fields.${l}`));
|
|
264
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;
|
|
@@ -266,10 +266,10 @@ function _e(i, o) {
|
|
|
266
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
267
|
t.fields.forEach((r, l) => {
|
|
268
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 && !
|
|
269
|
+
}), $(t.queryKind) || s.push(`${o}.queryKind must be a supported codegen query kind.`), t.sdkBuilder !== void 0 && !te(t.sdkBuilder) && s.push(`${o}.sdkBuilder must be a supported SDK builder.`);
|
|
270
270
|
const n = a(t.computation);
|
|
271
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
|
-
...
|
|
272
|
+
...Ne({
|
|
273
273
|
value: t.sdkSpec,
|
|
274
274
|
path: `${o}.sdkSpec`,
|
|
275
275
|
queryKind: typeof t.queryKind == "string" ? t.queryKind : void 0,
|
|
@@ -291,7 +291,7 @@ function E(i, o) {
|
|
|
291
291
|
), !l || l.mode !== "server" ? u.push(
|
|
292
292
|
`${o}.sdkSpec.spec.totals.mode must be server when tableBehavior.totals.mode is server.`
|
|
293
293
|
) : u.push(
|
|
294
|
-
...
|
|
294
|
+
...Re({
|
|
295
295
|
left: c.measures,
|
|
296
296
|
right: l.measures,
|
|
297
297
|
leftPath: `${o}.visualSpec.tableBehavior.totals.measures`,
|
|
@@ -305,7 +305,7 @@ function E(i, o) {
|
|
|
305
305
|
`${o}.sdkSpec.spec.totals is only allowed when tableBehavior.totals.mode is server.`
|
|
306
306
|
), u);
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function Re({
|
|
309
309
|
left: i,
|
|
310
310
|
right: o,
|
|
311
311
|
leftPath: t,
|
|
@@ -315,21 +315,21 @@ function je({
|
|
|
315
315
|
return [`${s} must match ${t}.`];
|
|
316
316
|
const n = [];
|
|
317
317
|
return i.length !== o.length ? (n.push(`${s} must match ${t}.`), n) : (i.forEach((r, l) => {
|
|
318
|
-
|
|
318
|
+
Ce(
|
|
319
319
|
a(r),
|
|
320
320
|
a(o[l])
|
|
321
321
|
) || n.push(`${s}.${l} must match ${t}.${l}.`);
|
|
322
322
|
}), n);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
return !i || !o ? !1 : i.name === o.name && (i.role || "measure") === (o.role || "measure") && U(i) === U(o) &&
|
|
324
|
+
function Ce(i, o) {
|
|
325
|
+
return !i || !o ? !1 : i.name === o.name && (i.role || "measure") === (o.role || "measure") && U(i) === U(o) && qe(i, o);
|
|
326
326
|
}
|
|
327
327
|
function U(i) {
|
|
328
328
|
return typeof i.aggregate == "string" ? i.aggregate.toUpperCase() : "SUM";
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function qe(i, o) {
|
|
331
331
|
const t = a(i.source), s = a(o.source);
|
|
332
|
-
if (
|
|
332
|
+
if (xe(t, s))
|
|
333
333
|
return !1;
|
|
334
334
|
const n = z(i), r = z(o);
|
|
335
335
|
if (n.size > 0 || r.size > 0) {
|
|
@@ -340,7 +340,7 @@ function Ce(i, o) {
|
|
|
340
340
|
}
|
|
341
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;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function xe(i, o) {
|
|
344
344
|
if (!i || !o || i.kind !== "semantic" || o.kind !== "semantic")
|
|
345
345
|
return !1;
|
|
346
346
|
const t = typeof i.datasetId == "string" ? i.datasetId.trim() : "", s = typeof o.datasetId == "string" ? o.datasetId.trim() : "";
|
|
@@ -348,9 +348,9 @@ function qe(i, o) {
|
|
|
348
348
|
}
|
|
349
349
|
function z(i) {
|
|
350
350
|
const o = typeof i.sourceKey == "string" ? i.sourceKey.trim() : "";
|
|
351
|
-
return o ? /* @__PURE__ */ new Set([o]) :
|
|
351
|
+
return o ? /* @__PURE__ */ new Set([o]) : Ee(a(i.source));
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Ee(i) {
|
|
354
354
|
const o = /* @__PURE__ */ new Set();
|
|
355
355
|
if (!i)
|
|
356
356
|
return o;
|
|
@@ -371,7 +371,7 @@ function xe(i) {
|
|
|
371
371
|
}
|
|
372
372
|
return o;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function Fe(i, o) {
|
|
375
375
|
const t = a(i);
|
|
376
376
|
if (!t)
|
|
377
377
|
return [`${o} must be an object.`];
|
|
@@ -379,7 +379,7 @@ function Ee(i, o) {
|
|
|
379
379
|
if (t.fieldRef && s.push(
|
|
380
380
|
...p(t.fieldRef, `${o}.fieldRef`)
|
|
381
381
|
), (typeof t.inputId != "string" || !t.inputId.trim()) && s.push(`${o}.inputId is required.`), s.push(
|
|
382
|
-
...
|
|
382
|
+
...J(t.optionQuery, `${o}.optionQuery`)
|
|
383
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
384
|
s.push(`${o}.bindings must be an array.`);
|
|
385
385
|
else {
|
|
@@ -406,7 +406,7 @@ function Ee(i, o) {
|
|
|
406
406
|
}
|
|
407
407
|
return s;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function J(i, o) {
|
|
410
410
|
if (i === void 0)
|
|
411
411
|
return [];
|
|
412
412
|
const t = a(i);
|
|
@@ -428,22 +428,22 @@ function X(i, o) {
|
|
|
428
428
|
];
|
|
429
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;
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function Ne(i) {
|
|
432
432
|
var n;
|
|
433
433
|
const o = a(i.value);
|
|
434
434
|
if (!o)
|
|
435
435
|
return [`${i.path} is required for executable views.`];
|
|
436
436
|
const t = [];
|
|
437
|
-
if (!
|
|
437
|
+
if (!te(o.builder))
|
|
438
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 !==
|
|
439
|
+
i.sdkBuilder && o.builder !== i.sdkBuilder && t.push(`${i.path}.builder must match sdkBuilder.`), i.queryKind && $(i.queryKind) && o.builder !== Ge(i.queryKind) && t.push(`${i.path}.builder must match queryKind.`);
|
|
440
440
|
const s = a(o.spec);
|
|
441
441
|
if (!s)
|
|
442
442
|
return t.push(`${i.path}.spec must be an object.`), t;
|
|
443
443
|
switch (o.builder) {
|
|
444
444
|
case "semaphor.metric":
|
|
445
445
|
t.push(
|
|
446
|
-
...v(s,
|
|
446
|
+
...v(s, Z, `${i.path}.spec`),
|
|
447
447
|
...A(s, i.path),
|
|
448
448
|
...F(s.measures, `${i.path}.spec.measures`),
|
|
449
449
|
...h(
|
|
@@ -464,7 +464,7 @@ function Fe(i) {
|
|
|
464
464
|
break;
|
|
465
465
|
case "semaphor.analysis":
|
|
466
466
|
t.push(
|
|
467
|
-
...v(s,
|
|
467
|
+
...v(s, ye, `${i.path}.spec`),
|
|
468
468
|
...A(s, i.path),
|
|
469
469
|
...F(s.measures, `${i.path}.spec.measures`),
|
|
470
470
|
...h(
|
|
@@ -481,12 +481,12 @@ function Fe(i) {
|
|
|
481
481
|
),
|
|
482
482
|
...T(s.orderBy, `${i.path}.spec.orderBy`),
|
|
483
483
|
..._(s.filters, `${i.path}.spec.filters`),
|
|
484
|
-
...
|
|
484
|
+
...De(s, `${i.path}.spec`)
|
|
485
485
|
);
|
|
486
486
|
break;
|
|
487
487
|
case "semaphor.records":
|
|
488
488
|
t.push(
|
|
489
|
-
...v(s,
|
|
489
|
+
...v(s, ve, `${i.path}.spec`),
|
|
490
490
|
...A(s, i.path),
|
|
491
491
|
...F(s.fields, `${i.path}.spec.fields`),
|
|
492
492
|
...h(
|
|
@@ -495,7 +495,7 @@ function Fe(i) {
|
|
|
495
495
|
),
|
|
496
496
|
...T(s.orderBy, `${i.path}.spec.orderBy`),
|
|
497
497
|
..._(s.filters, `${i.path}.spec.filters`),
|
|
498
|
-
...
|
|
498
|
+
...Oe(
|
|
499
499
|
s.totals,
|
|
500
500
|
`${i.path}.spec.totals`
|
|
501
501
|
)
|
|
@@ -503,21 +503,25 @@ function Fe(i) {
|
|
|
503
503
|
break;
|
|
504
504
|
case "semaphor.matrix":
|
|
505
505
|
t.push(
|
|
506
|
-
...v(s,
|
|
507
|
-
...
|
|
508
|
-
...
|
|
509
|
-
...
|
|
506
|
+
...v(s, $e, `${i.path}.spec`),
|
|
507
|
+
...Ke(s, i.path),
|
|
508
|
+
...Me(s.rows, `${i.path}.spec.rows`),
|
|
509
|
+
...Be(
|
|
510
510
|
s.columns,
|
|
511
511
|
`${i.path}.spec.columns`
|
|
512
512
|
),
|
|
513
|
-
...
|
|
514
|
-
...
|
|
515
|
-
..._(s.filters, `${i.path}.spec.filters`)
|
|
513
|
+
...Pe(s.values, `${i.path}.spec.values`),
|
|
514
|
+
...Ve(s.sort, `${i.path}.spec.sort`),
|
|
515
|
+
..._(s.filters, `${i.path}.spec.filters`),
|
|
516
|
+
...Te(
|
|
517
|
+
s.displayLimits,
|
|
518
|
+
`${i.path}.spec.displayLimits`
|
|
519
|
+
)
|
|
516
520
|
);
|
|
517
521
|
break;
|
|
518
522
|
case "semaphor.sql":
|
|
519
523
|
t.push(
|
|
520
|
-
...v(s,
|
|
524
|
+
...v(s, Se, `${i.path}.spec`),
|
|
521
525
|
...A(s, i.path)
|
|
522
526
|
), ((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
527
|
...N(
|
|
@@ -529,9 +533,41 @@ function Fe(i) {
|
|
|
529
533
|
}
|
|
530
534
|
return t;
|
|
531
535
|
}
|
|
532
|
-
function
|
|
536
|
+
function Te(i, o) {
|
|
537
|
+
if (i === void 0)
|
|
538
|
+
return [];
|
|
539
|
+
const t = a(i);
|
|
540
|
+
if (!t)
|
|
541
|
+
return [`${o} must be an object.`];
|
|
542
|
+
const s = [];
|
|
543
|
+
s.push(
|
|
544
|
+
...H(t.rows, `${o}.rows`),
|
|
545
|
+
...H(
|
|
546
|
+
t.columns,
|
|
547
|
+
`${o}.columns`
|
|
548
|
+
)
|
|
549
|
+
);
|
|
550
|
+
for (const n of Object.keys(t))
|
|
551
|
+
n === "rows" || n === "columns" || s.push(`${o}.${n} is not supported.`);
|
|
552
|
+
return s;
|
|
553
|
+
}
|
|
554
|
+
function H(i, o) {
|
|
555
|
+
if (i === void 0)
|
|
556
|
+
return [];
|
|
557
|
+
const t = a(i);
|
|
558
|
+
if (!t)
|
|
559
|
+
return [`${o} must be an object.`];
|
|
560
|
+
const s = [];
|
|
561
|
+
(typeof t.limit != "number" || !Number.isInteger(t.limit) || t.limit < 1) && s.push(`${o}.limit must be a positive integer.`);
|
|
562
|
+
for (const n of Object.keys(t))
|
|
563
|
+
n !== "limit" && s.push(
|
|
564
|
+
`${o}.${n} is not supported; matrix display limits are count-only in v1.`
|
|
565
|
+
);
|
|
566
|
+
return s;
|
|
567
|
+
}
|
|
568
|
+
function De(i, o) {
|
|
533
569
|
const t = [];
|
|
534
|
-
if (i.driverMode !== void 0 && !
|
|
570
|
+
if (i.driverMode !== void 0 && !be.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) {
|
|
535
571
|
const s = a(i.calendarContext);
|
|
536
572
|
if (!s)
|
|
537
573
|
t.push(`${o}.calendarContext must be an object.`);
|
|
@@ -548,7 +584,7 @@ function Ne(i, o) {
|
|
|
548
584
|
}
|
|
549
585
|
return t;
|
|
550
586
|
}
|
|
551
|
-
function
|
|
587
|
+
function Oe(i, o) {
|
|
552
588
|
if (i === void 0)
|
|
553
589
|
return [];
|
|
554
590
|
const t = a(i);
|
|
@@ -558,7 +594,7 @@ function Te(i, o) {
|
|
|
558
594
|
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) => {
|
|
559
595
|
var l;
|
|
560
596
|
s.push(
|
|
561
|
-
...
|
|
597
|
+
...oe(
|
|
562
598
|
n,
|
|
563
599
|
`${o}.measures.${r}`
|
|
564
600
|
)
|
|
@@ -574,7 +610,7 @@ function v(i, o, t) {
|
|
|
574
610
|
function A(i, o) {
|
|
575
611
|
return a(i.source) ? w(i.source, `${o}.spec.source`) : [`${o}.spec.source must be an object.`];
|
|
576
612
|
}
|
|
577
|
-
function
|
|
613
|
+
function Ke(i, o) {
|
|
578
614
|
const t = a(i.source);
|
|
579
615
|
if (!t)
|
|
580
616
|
return [`${o}.spec.source must be an object.`];
|
|
@@ -603,10 +639,10 @@ function T(i, o) {
|
|
|
603
639
|
const t = a(i);
|
|
604
640
|
return t ? [
|
|
605
641
|
...p(t.field, `${o}.field`),
|
|
606
|
-
...
|
|
642
|
+
...ee(t.direction, `${o}.direction`)
|
|
607
643
|
] : [`${o} must be an object.`];
|
|
608
644
|
}
|
|
609
|
-
function
|
|
645
|
+
function Me(i, o) {
|
|
610
646
|
const t = P(i, o);
|
|
611
647
|
return Array.isArray(i) && i.forEach((s, n) => {
|
|
612
648
|
const r = a(s);
|
|
@@ -619,7 +655,7 @@ function Ke(i, o) {
|
|
|
619
655
|
);
|
|
620
656
|
}), t;
|
|
621
657
|
}
|
|
622
|
-
function
|
|
658
|
+
function Be(i, o) {
|
|
623
659
|
if (i === void 0)
|
|
624
660
|
return [];
|
|
625
661
|
const t = [];
|
|
@@ -634,7 +670,7 @@ function Oe(i, o) {
|
|
|
634
670
|
);
|
|
635
671
|
}), t) : [`${o} must be an array.`];
|
|
636
672
|
}
|
|
637
|
-
function
|
|
673
|
+
function Pe(i, o) {
|
|
638
674
|
const t = P(i, o);
|
|
639
675
|
return Array.isArray(i) && i.forEach((s, n) => {
|
|
640
676
|
const r = a(s);
|
|
@@ -647,7 +683,7 @@ function Me(i, o) {
|
|
|
647
683
|
);
|
|
648
684
|
}), t;
|
|
649
685
|
}
|
|
650
|
-
function
|
|
686
|
+
function Ve(i, o) {
|
|
651
687
|
if (i === void 0)
|
|
652
688
|
return [];
|
|
653
689
|
if (!Array.isArray(i))
|
|
@@ -660,12 +696,12 @@ function Be(i, o) {
|
|
|
660
696
|
return;
|
|
661
697
|
}
|
|
662
698
|
r.axis !== "row" && r.axis !== "column" && t.push(`${o}.${n}.axis must be row or column.`), t.push(
|
|
663
|
-
...
|
|
664
|
-
...
|
|
699
|
+
...ee(r.direction, `${o}.${n}.direction`),
|
|
700
|
+
...Le(r.by, `${o}.${n}.by`)
|
|
665
701
|
);
|
|
666
702
|
}), t;
|
|
667
703
|
}
|
|
668
|
-
function
|
|
704
|
+
function Le(i, o) {
|
|
669
705
|
const t = a(i);
|
|
670
706
|
if (!t)
|
|
671
707
|
return [`${o} must be an object.`];
|
|
@@ -680,7 +716,7 @@ function Pe(i, o) {
|
|
|
680
716
|
return [`${o}.kind must be label, field, or value.`];
|
|
681
717
|
}
|
|
682
718
|
}
|
|
683
|
-
function
|
|
719
|
+
function ee(i, o) {
|
|
684
720
|
return i === "asc" || i === "desc" ? [] : [`${o} must be asc or desc.`];
|
|
685
721
|
}
|
|
686
722
|
function _(i, o) {
|
|
@@ -701,7 +737,7 @@ function _(i, o) {
|
|
|
701
737
|
function P(i, o) {
|
|
702
738
|
return !Array.isArray(i) || i.length === 0 ? [`${o} must be a non-empty array.`] : [];
|
|
703
739
|
}
|
|
704
|
-
function
|
|
740
|
+
function Ge(i) {
|
|
705
741
|
switch (i) {
|
|
706
742
|
case "metric":
|
|
707
743
|
return "semaphor.metric";
|
|
@@ -715,56 +751,56 @@ function Ve(i) {
|
|
|
715
751
|
return "semaphor.sql";
|
|
716
752
|
}
|
|
717
753
|
}
|
|
718
|
-
function
|
|
754
|
+
function Ue(i) {
|
|
719
755
|
const o = a(i.computation), t = a(i.visualSpec);
|
|
720
756
|
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";
|
|
721
757
|
}
|
|
722
|
-
function
|
|
758
|
+
function ze(i, o) {
|
|
723
759
|
const t = a(i);
|
|
724
760
|
if (!t)
|
|
725
761
|
return [`${o} must be an object.`];
|
|
726
762
|
const s = [];
|
|
727
|
-
return
|
|
728
|
-
...
|
|
763
|
+
return we.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(
|
|
764
|
+
...He(
|
|
729
765
|
t.tableBehavior,
|
|
730
766
|
`${o}.tableBehavior`
|
|
731
767
|
)
|
|
732
768
|
), s;
|
|
733
769
|
}
|
|
734
|
-
function
|
|
770
|
+
function He(i, o) {
|
|
735
771
|
const t = a(i);
|
|
736
772
|
if (!t)
|
|
737
773
|
return [`${o} must be an object.`];
|
|
738
774
|
const s = [];
|
|
739
775
|
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
|
-
...
|
|
741
|
-
...
|
|
742
|
-
...
|
|
743
|
-
...
|
|
776
|
+
...Qe(t.height, `${o}.height`),
|
|
777
|
+
...Ye(t.pagination, `${o}.pagination`),
|
|
778
|
+
...We(t.sorting, `${o}.sorting`),
|
|
779
|
+
...Ze(t.totals, `${o}.totals`)
|
|
744
780
|
), typeof t.serverSideRequired != "boolean" && s.push(`${o}.serverSideRequired must be a boolean.`), s;
|
|
745
781
|
}
|
|
746
|
-
function
|
|
782
|
+
function Qe(i, o) {
|
|
747
783
|
const t = a(i);
|
|
748
784
|
if (!t)
|
|
749
785
|
return [`${o} must be an object.`];
|
|
750
786
|
const s = [];
|
|
751
787
|
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;
|
|
752
788
|
}
|
|
753
|
-
function
|
|
789
|
+
function Ye(i, o) {
|
|
754
790
|
const t = a(i);
|
|
755
791
|
if (!t)
|
|
756
792
|
return [`${o} must be an object.`];
|
|
757
793
|
const s = [];
|
|
758
794
|
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;
|
|
759
795
|
}
|
|
760
|
-
function
|
|
796
|
+
function We(i, o) {
|
|
761
797
|
const t = a(i);
|
|
762
798
|
if (!t)
|
|
763
799
|
return [`${o} must be an object.`];
|
|
764
800
|
const s = [];
|
|
765
801
|
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;
|
|
766
802
|
}
|
|
767
|
-
function
|
|
803
|
+
function Ze(i, o) {
|
|
768
804
|
const t = a(i);
|
|
769
805
|
if (!t)
|
|
770
806
|
return [`${o} must be an object.`];
|
|
@@ -772,14 +808,14 @@ function Ye(i, o) {
|
|
|
772
808
|
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) => {
|
|
773
809
|
var l;
|
|
774
810
|
s.push(
|
|
775
|
-
...
|
|
811
|
+
...oe(
|
|
776
812
|
n,
|
|
777
813
|
`${o}.measures.${r}`
|
|
778
814
|
)
|
|
779
815
|
), ((l = a(n)) == null ? void 0 : l.role) !== "measure" && s.push(`${o}.measures.${r}.role must be measure.`);
|
|
780
816
|
}), 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);
|
|
781
817
|
}
|
|
782
|
-
function
|
|
818
|
+
function Xe(i, o) {
|
|
783
819
|
const t = a(i);
|
|
784
820
|
if (!t)
|
|
785
821
|
return [`${o} must be an object.`];
|
|
@@ -803,28 +839,28 @@ function We(i, o) {
|
|
|
803
839
|
}
|
|
804
840
|
return s;
|
|
805
841
|
}
|
|
806
|
-
function
|
|
842
|
+
function Je(i, o) {
|
|
807
843
|
const t = a(i);
|
|
808
844
|
if (!t)
|
|
809
845
|
return [`${o} must be an object.`];
|
|
810
846
|
const s = [];
|
|
811
847
|
for (const r of ["title", "requestedQuestion", "suggestedModelingFix"])
|
|
812
848
|
(typeof t[r] != "string" || !t[r].trim()) && s.push(`${o}.${r} is required.`);
|
|
813
|
-
return
|
|
849
|
+
return ke.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
850
|
`${o} relationship repair metadata is only valid for missing_relationship unsupported insights.`
|
|
815
851
|
), t.relationshipCandidate !== void 0 && s.push(
|
|
816
|
-
...
|
|
852
|
+
...tt(
|
|
817
853
|
t.relationshipCandidate,
|
|
818
854
|
`${o}.relationshipCandidate`
|
|
819
855
|
)
|
|
820
856
|
), t.nextRepairAction !== void 0 && s.push(
|
|
821
|
-
...
|
|
857
|
+
...et(
|
|
822
858
|
t.nextRepairAction,
|
|
823
859
|
`${o}.nextRepairAction`
|
|
824
860
|
)
|
|
825
861
|
), s;
|
|
826
862
|
}
|
|
827
|
-
function
|
|
863
|
+
function et(i, o) {
|
|
828
864
|
const t = a(i);
|
|
829
865
|
if (!t)
|
|
830
866
|
return [`${o} must be an object.`];
|
|
@@ -837,7 +873,7 @@ function Xe(i, o) {
|
|
|
837
873
|
`${o}.tool must be semaphor_propose_semantic_model_change.`
|
|
838
874
|
), t.reason !== "missing_relationship" && s.push(`${o}.reason must be missing_relationship.`), s;
|
|
839
875
|
}
|
|
840
|
-
function
|
|
876
|
+
function tt(i, o) {
|
|
841
877
|
const t = a(i);
|
|
842
878
|
if (!t)
|
|
843
879
|
return [`${o} must be an object.`];
|
|
@@ -847,9 +883,9 @@ function Je(i, o) {
|
|
|
847
883
|
`${o}.${r} is not supported; relationship candidates support only source, sourceFields, target, and targetFields.`
|
|
848
884
|
);
|
|
849
885
|
}), s.push(
|
|
850
|
-
...
|
|
886
|
+
...Q(t.source, `${o}.source`)
|
|
851
887
|
), s.push(
|
|
852
|
-
...
|
|
888
|
+
...Q(t.target, `${o}.target`)
|
|
853
889
|
);
|
|
854
890
|
for (const r of ["sourceFields", "targetFields"]) {
|
|
855
891
|
const l = t[r];
|
|
@@ -859,13 +895,13 @@ function Je(i, o) {
|
|
|
859
895
|
}
|
|
860
896
|
l.forEach((u, c) => {
|
|
861
897
|
s.push(
|
|
862
|
-
...
|
|
898
|
+
...ot(u, `${o}.${r}.${c}`)
|
|
863
899
|
);
|
|
864
900
|
});
|
|
865
901
|
}
|
|
866
902
|
return s;
|
|
867
903
|
}
|
|
868
|
-
function
|
|
904
|
+
function ot(i, o) {
|
|
869
905
|
const t = a(i);
|
|
870
906
|
if (!t)
|
|
871
907
|
return [`${o} must be an object.`];
|
|
@@ -880,7 +916,7 @@ function et(i, o) {
|
|
|
880
916
|
`${o}.dataType must be string, number, boolean, date, datetime, or unknown.`
|
|
881
917
|
), s;
|
|
882
918
|
}
|
|
883
|
-
function
|
|
919
|
+
function Q(i, o) {
|
|
884
920
|
const t = a(i);
|
|
885
921
|
if (!t)
|
|
886
922
|
return [`${o} must be an object.`];
|
|
@@ -899,11 +935,11 @@ function H(i, o) {
|
|
|
899
935
|
}), 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;
|
|
900
936
|
}
|
|
901
937
|
function $(i) {
|
|
902
|
-
return ge.has(i);
|
|
903
|
-
}
|
|
904
|
-
function ee(i) {
|
|
905
938
|
return he.has(i);
|
|
906
939
|
}
|
|
940
|
+
function te(i) {
|
|
941
|
+
return fe.has(i);
|
|
942
|
+
}
|
|
907
943
|
function h(i, o) {
|
|
908
944
|
return i === void 0 ? [] : p(i, o);
|
|
909
945
|
}
|
|
@@ -914,7 +950,7 @@ function p(i, o) {
|
|
|
914
950
|
const s = [];
|
|
915
951
|
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;
|
|
916
952
|
}
|
|
917
|
-
function
|
|
953
|
+
function oe(i, o) {
|
|
918
954
|
const t = a(i), s = p(i, o);
|
|
919
955
|
if (!t || typeof t.sourceKey == "string" && t.sourceKey.trim())
|
|
920
956
|
return s;
|
|
@@ -949,7 +985,7 @@ const m = e.record(e.string(), e.unknown()), R = e.array(m), d = e.enum([
|
|
|
949
985
|
"duckdb",
|
|
950
986
|
"sqlite",
|
|
951
987
|
"unknown"
|
|
952
|
-
]),
|
|
988
|
+
]), se = e.enum([
|
|
953
989
|
"hour",
|
|
954
990
|
"day",
|
|
955
991
|
"week",
|
|
@@ -969,7 +1005,7 @@ const m = e.record(e.string(), e.unknown()), R = e.array(m), d = e.enum([
|
|
|
969
1005
|
"date",
|
|
970
1006
|
"datetime",
|
|
971
1007
|
"unknown"
|
|
972
|
-
]),
|
|
1008
|
+
]), ie = e.enum([
|
|
973
1009
|
"semantic_model",
|
|
974
1010
|
"caller_override",
|
|
975
1011
|
"default_sum"
|
|
@@ -979,7 +1015,7 @@ const m = e.record(e.string(), e.unknown()), R = e.array(m), d = e.enum([
|
|
|
979
1015
|
"minute",
|
|
980
1016
|
"hour",
|
|
981
1017
|
"day"
|
|
982
|
-
]),
|
|
1018
|
+
]), ne = e.union([
|
|
983
1019
|
e.object({
|
|
984
1020
|
type: e.enum(["number", "currency", "percent", "percentage", "scientific"]),
|
|
985
1021
|
locale: e.string().optional(),
|
|
@@ -1020,7 +1056,7 @@ const m = e.record(e.string(), e.unknown()), R = e.array(m), d = e.enum([
|
|
|
1020
1056
|
prefix: e.string().optional(),
|
|
1021
1057
|
suffix: e.string().optional()
|
|
1022
1058
|
}).passthrough()
|
|
1023
|
-
]),
|
|
1059
|
+
]), st = e.union([
|
|
1024
1060
|
e.object({ kind: e.literal("defaultAggregate") }).passthrough(),
|
|
1025
1061
|
e.object({ kind: e.literal("blank") }).passthrough(),
|
|
1026
1062
|
e.object({
|
|
@@ -1048,14 +1084,14 @@ function k(i, o) {
|
|
|
1048
1084
|
});
|
|
1049
1085
|
});
|
|
1050
1086
|
}
|
|
1051
|
-
const
|
|
1087
|
+
const re = e.object({
|
|
1052
1088
|
kind: e.literal("semantic"),
|
|
1053
1089
|
domainId: e.string(),
|
|
1054
1090
|
datasetName: e.string(),
|
|
1055
1091
|
datasetId: e.string().optional(),
|
|
1056
1092
|
label: e.string().optional(),
|
|
1057
1093
|
connectionId: e.string().optional()
|
|
1058
|
-
}).passthrough(),
|
|
1094
|
+
}).passthrough(), it = e.object({
|
|
1059
1095
|
kind: e.literal("physical"),
|
|
1060
1096
|
connectionId: e.string(),
|
|
1061
1097
|
connectionType: e.string().optional(),
|
|
@@ -1064,15 +1100,15 @@ const ne = e.object({
|
|
|
1064
1100
|
schemaName: e.string().optional(),
|
|
1065
1101
|
label: e.string().optional(),
|
|
1066
1102
|
dialect: C.optional()
|
|
1067
|
-
}).passthrough(),
|
|
1103
|
+
}).passthrough(), nt = e.object({
|
|
1068
1104
|
kind: e.literal("sql"),
|
|
1069
1105
|
connectionId: e.string(),
|
|
1070
1106
|
dialect: C.optional(),
|
|
1071
1107
|
label: e.string().optional()
|
|
1072
1108
|
}).passthrough(), S = e.union([
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1109
|
+
re,
|
|
1110
|
+
it,
|
|
1111
|
+
nt
|
|
1076
1112
|
]), y = e.object({
|
|
1077
1113
|
name: e.string(),
|
|
1078
1114
|
label: e.string().optional(),
|
|
@@ -1080,11 +1116,11 @@ const ne = e.object({
|
|
|
1080
1116
|
dataType: x.optional(),
|
|
1081
1117
|
source: S.optional(),
|
|
1082
1118
|
aggregate: d.optional()
|
|
1083
|
-
}).passthrough(),
|
|
1119
|
+
}).passthrough(), rt = e.object({
|
|
1084
1120
|
kind: e.literal("field"),
|
|
1085
1121
|
field: y,
|
|
1086
1122
|
aggregate: d.optional()
|
|
1087
|
-
}).passthrough(),
|
|
1123
|
+
}).passthrough(), ae = e.object({
|
|
1088
1124
|
kind: e.literal("derived_field"),
|
|
1089
1125
|
name: e.string(),
|
|
1090
1126
|
label: e.string(),
|
|
@@ -1094,7 +1130,7 @@ const ne = e.object({
|
|
|
1094
1130
|
computeStage: e.enum(["row", "aggregate"]),
|
|
1095
1131
|
expression: e.string(),
|
|
1096
1132
|
expressionLanguage: e.literal("semaphor_sql_template").optional(),
|
|
1097
|
-
inputs: e.record(
|
|
1133
|
+
inputs: e.record(rt),
|
|
1098
1134
|
defaultAggregate: d.optional(),
|
|
1099
1135
|
aggregationBehavior: e.enum([
|
|
1100
1136
|
"additive",
|
|
@@ -1110,16 +1146,16 @@ const ne = e.object({
|
|
|
1110
1146
|
"aggregate_then_join",
|
|
1111
1147
|
"weighted"
|
|
1112
1148
|
]).optional(),
|
|
1113
|
-
format:
|
|
1149
|
+
format: ne.optional(),
|
|
1114
1150
|
tags: e.array(e.string()).optional()
|
|
1115
1151
|
}).passthrough(), V = y.and(
|
|
1116
1152
|
e.object({
|
|
1117
1153
|
semanticAggregate: d.optional(),
|
|
1118
1154
|
effectiveAggregate: d.optional(),
|
|
1119
|
-
aggregateSource:
|
|
1120
|
-
derivedField:
|
|
1155
|
+
aggregateSource: ie.optional(),
|
|
1156
|
+
derivedField: ae.optional()
|
|
1121
1157
|
}).passthrough()
|
|
1122
|
-
),
|
|
1158
|
+
), at = re, lt = e.object({
|
|
1123
1159
|
kind: e.literal("physical"),
|
|
1124
1160
|
connectionId: e.string().optional(),
|
|
1125
1161
|
connectionType: e.string().optional(),
|
|
@@ -1128,28 +1164,28 @@ const ne = e.object({
|
|
|
1128
1164
|
schemaName: e.string().optional(),
|
|
1129
1165
|
label: e.string().optional(),
|
|
1130
1166
|
dialect: C.optional()
|
|
1131
|
-
}).passthrough(),
|
|
1167
|
+
}).passthrough(), ut = e.object({
|
|
1132
1168
|
kind: e.literal("sql"),
|
|
1133
1169
|
connectionId: e.string().optional(),
|
|
1134
1170
|
dialect: C.optional(),
|
|
1135
1171
|
label: e.string().optional()
|
|
1136
|
-
}).passthrough(),
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
]),
|
|
1172
|
+
}).passthrough(), dt = e.union([
|
|
1173
|
+
at,
|
|
1174
|
+
lt,
|
|
1175
|
+
ut
|
|
1176
|
+
]), ct = e.object({
|
|
1141
1177
|
key: e.string().optional(),
|
|
1142
1178
|
name: e.string(),
|
|
1143
1179
|
label: e.string().optional(),
|
|
1144
1180
|
role: q.optional(),
|
|
1145
1181
|
dataType: x.optional(),
|
|
1146
|
-
source:
|
|
1182
|
+
source: dt.optional(),
|
|
1147
1183
|
aggregate: d.optional(),
|
|
1148
1184
|
semanticAggregate: d.optional(),
|
|
1149
1185
|
effectiveAggregate: d.optional(),
|
|
1150
|
-
aggregateSource:
|
|
1186
|
+
aggregateSource: ie.optional(),
|
|
1151
1187
|
derivedField: e.never().optional()
|
|
1152
|
-
}).passthrough(),
|
|
1188
|
+
}).passthrough(), K = e.object({
|
|
1153
1189
|
key: e.string(),
|
|
1154
1190
|
name: e.string(),
|
|
1155
1191
|
label: e.string(),
|
|
@@ -1157,8 +1193,8 @@ const ne = e.object({
|
|
|
1157
1193
|
dataType: x.optional(),
|
|
1158
1194
|
aggregate: d.optional(),
|
|
1159
1195
|
source: S.optional(),
|
|
1160
|
-
derivedField:
|
|
1161
|
-
}).passthrough(),
|
|
1196
|
+
derivedField: ae.optional()
|
|
1197
|
+
}).passthrough(), le = e.object({
|
|
1162
1198
|
code: e.string(),
|
|
1163
1199
|
message: e.string().optional(),
|
|
1164
1200
|
invalidField: e.string().optional(),
|
|
@@ -1172,13 +1208,13 @@ const ne = e.object({
|
|
|
1172
1208
|
message: e.string(),
|
|
1173
1209
|
path: e.string().optional(),
|
|
1174
1210
|
fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
|
|
1175
|
-
repairHint:
|
|
1176
|
-
}).passthrough(),
|
|
1211
|
+
repairHint: le.optional()
|
|
1212
|
+
}).passthrough(), ue = e.object({
|
|
1177
1213
|
ok: e.boolean(),
|
|
1178
1214
|
errors: e.array(M),
|
|
1179
1215
|
warnings: e.array(M),
|
|
1180
|
-
repairHints: e.array(
|
|
1181
|
-
}).passthrough(),
|
|
1216
|
+
repairHints: e.array(le)
|
|
1217
|
+
}).passthrough(), pt = e.object({
|
|
1182
1218
|
page: e.number(),
|
|
1183
1219
|
pageSize: e.number(),
|
|
1184
1220
|
pageCount: e.number(),
|
|
@@ -1192,8 +1228,8 @@ const ne = e.object({
|
|
|
1192
1228
|
rowCount: e.number().optional(),
|
|
1193
1229
|
rowLimitExceeded: e.boolean().optional(),
|
|
1194
1230
|
limit: e.number().optional(),
|
|
1195
|
-
pagination:
|
|
1196
|
-
},
|
|
1231
|
+
pagination: pt.optional()
|
|
1232
|
+
}, mt = e.object({
|
|
1197
1233
|
...I,
|
|
1198
1234
|
kind: e.literal("metric"),
|
|
1199
1235
|
value: j,
|
|
@@ -1205,18 +1241,18 @@ const ne = e.object({
|
|
|
1205
1241
|
deltaPercent: e.union([e.number(), e.null()]).optional()
|
|
1206
1242
|
}).passthrough().optional(),
|
|
1207
1243
|
records: R.optional()
|
|
1208
|
-
}).passthrough(),
|
|
1244
|
+
}).passthrough(), gt = e.object({
|
|
1209
1245
|
...I,
|
|
1210
1246
|
kind: e.literal("records"),
|
|
1211
|
-
columns: e.array(
|
|
1247
|
+
columns: e.array(K),
|
|
1212
1248
|
records: R,
|
|
1213
1249
|
totals: e.object({
|
|
1214
1250
|
mode: e.literal("server"),
|
|
1215
1251
|
scope: e.literal("filtered_result"),
|
|
1216
1252
|
row: e.record(e.string(), e.unknown()),
|
|
1217
|
-
columns: e.array(
|
|
1253
|
+
columns: e.array(K).optional()
|
|
1218
1254
|
}).passthrough().optional()
|
|
1219
|
-
}).passthrough(),
|
|
1255
|
+
}).passthrough(), ht = e.object({
|
|
1220
1256
|
...I,
|
|
1221
1257
|
kind: e.literal("inputOptions"),
|
|
1222
1258
|
options: e.array(
|
|
@@ -1230,21 +1266,21 @@ const ne = e.object({
|
|
|
1230
1266
|
["value"]
|
|
1231
1267
|
)
|
|
1232
1268
|
)
|
|
1233
|
-
}).passthrough(),
|
|
1269
|
+
}).passthrough(), ft = e.object({
|
|
1234
1270
|
...I,
|
|
1235
1271
|
kind: e.literal("sql"),
|
|
1236
|
-
columns: e.array(
|
|
1272
|
+
columns: e.array(K),
|
|
1237
1273
|
records: R,
|
|
1238
1274
|
sqlShape: e.object({
|
|
1239
1275
|
statementType: e.string().optional(),
|
|
1240
1276
|
explicitLimit: e.number().optional(),
|
|
1241
1277
|
hasPythonCode: e.boolean().optional()
|
|
1242
1278
|
}).passthrough().optional()
|
|
1243
|
-
}).passthrough(),
|
|
1279
|
+
}).passthrough(), bt = e.object({
|
|
1244
1280
|
enabled: e.boolean().optional(),
|
|
1245
1281
|
position: e.enum(["before", "after"]).optional(),
|
|
1246
1282
|
label: e.string().optional()
|
|
1247
|
-
}).passthrough(),
|
|
1283
|
+
}).passthrough(), Y = e.object({
|
|
1248
1284
|
id: e.enum(["rows", "columns"]),
|
|
1249
1285
|
levels: e.array(
|
|
1250
1286
|
e.object({
|
|
@@ -1252,8 +1288,8 @@ const ne = e.object({
|
|
|
1252
1288
|
fieldKey: e.string(),
|
|
1253
1289
|
label: e.string(),
|
|
1254
1290
|
field: y,
|
|
1255
|
-
grain:
|
|
1256
|
-
subtotal:
|
|
1291
|
+
grain: se.optional(),
|
|
1292
|
+
subtotal: bt.optional()
|
|
1257
1293
|
}).passthrough()
|
|
1258
1294
|
),
|
|
1259
1295
|
nodeIds: e.array(e.string())
|
|
@@ -1265,7 +1301,7 @@ const ne = e.object({
|
|
|
1265
1301
|
label: e.string()
|
|
1266
1302
|
},
|
|
1267
1303
|
["value"]
|
|
1268
|
-
),
|
|
1304
|
+
), yt = e.union([
|
|
1269
1305
|
e.object({ kind: e.literal("label") }).passthrough(),
|
|
1270
1306
|
e.object({
|
|
1271
1307
|
kind: e.literal("field"),
|
|
@@ -1278,12 +1314,12 @@ const ne = e.object({
|
|
|
1278
1314
|
rowPath: e.array(b).optional(),
|
|
1279
1315
|
columnPath: e.array(b).optional()
|
|
1280
1316
|
}).passthrough()
|
|
1281
|
-
]),
|
|
1317
|
+
]), vt = e.enum([
|
|
1282
1318
|
"present",
|
|
1283
1319
|
"presentNull",
|
|
1284
1320
|
"missing",
|
|
1285
1321
|
"densified"
|
|
1286
|
-
]),
|
|
1322
|
+
]), $t = e.enum([
|
|
1287
1323
|
"value",
|
|
1288
1324
|
"rowSubtotal",
|
|
1289
1325
|
"columnSubtotal",
|
|
@@ -1291,13 +1327,13 @@ const ne = e.object({
|
|
|
1291
1327
|
"rowGrandTotal",
|
|
1292
1328
|
"columnGrandTotal",
|
|
1293
1329
|
"matrixGrandTotal"
|
|
1294
|
-
]),
|
|
1330
|
+
]), St = e.object({
|
|
1295
1331
|
instanceId: e.string(),
|
|
1296
1332
|
fieldKey: e.string(),
|
|
1297
1333
|
field: y,
|
|
1298
1334
|
role: e.enum(["row", "column", "measure", "sort", "filter"]),
|
|
1299
1335
|
label: e.string().optional()
|
|
1300
|
-
}).passthrough(),
|
|
1336
|
+
}).passthrough(), wt = e.union([
|
|
1301
1337
|
e.object({
|
|
1302
1338
|
kind: e.literal("additive"),
|
|
1303
1339
|
aggregate: d.optional()
|
|
@@ -1305,7 +1341,7 @@ const ne = e.object({
|
|
|
1305
1341
|
e.object({
|
|
1306
1342
|
kind: e.literal("semiAdditive"),
|
|
1307
1343
|
aggregate: d.optional(),
|
|
1308
|
-
grain:
|
|
1344
|
+
grain: se.optional()
|
|
1309
1345
|
}).passthrough(),
|
|
1310
1346
|
e.object({
|
|
1311
1347
|
kind: e.literal("nonAdditive"),
|
|
@@ -1320,16 +1356,16 @@ const ne = e.object({
|
|
|
1320
1356
|
kind: e.literal("custom"),
|
|
1321
1357
|
expressionId: e.string().optional()
|
|
1322
1358
|
}).passthrough()
|
|
1323
|
-
]),
|
|
1359
|
+
]), kt = e.object({
|
|
1324
1360
|
instanceId: e.string(),
|
|
1325
1361
|
fieldKey: e.string(),
|
|
1326
1362
|
label: e.string(),
|
|
1327
1363
|
field: y,
|
|
1328
1364
|
aggregate: d.optional(),
|
|
1329
|
-
format:
|
|
1330
|
-
totalBehavior:
|
|
1331
|
-
semantics:
|
|
1332
|
-
}).passthrough(),
|
|
1365
|
+
format: ne.optional(),
|
|
1366
|
+
totalBehavior: st.optional(),
|
|
1367
|
+
semantics: wt
|
|
1368
|
+
}).passthrough(), It = e.object({
|
|
1333
1369
|
id: e.string(),
|
|
1334
1370
|
measureId: e.string(),
|
|
1335
1371
|
aggregate: d.optional(),
|
|
@@ -1350,11 +1386,11 @@ const ne = e.object({
|
|
|
1350
1386
|
rowNodeId: e.string().optional(),
|
|
1351
1387
|
columnNodeId: e.string().optional()
|
|
1352
1388
|
}).passthrough().optional()
|
|
1353
|
-
}).passthrough(),
|
|
1389
|
+
}).passthrough(), At = e.object({
|
|
1354
1390
|
kind: e.string(),
|
|
1355
1391
|
label: e.string().optional(),
|
|
1356
1392
|
payload: e.record(e.string(), e.unknown()).optional()
|
|
1357
|
-
}).passthrough(),
|
|
1393
|
+
}).passthrough(), _t = k(
|
|
1358
1394
|
{
|
|
1359
1395
|
id: e.string(),
|
|
1360
1396
|
axis: e.enum(["row", "column"]),
|
|
@@ -1369,10 +1405,10 @@ const ne = e.object({
|
|
|
1369
1405
|
isGrandTotal: e.boolean().optional(),
|
|
1370
1406
|
subtotalFunction: d.optional(),
|
|
1371
1407
|
childCount: e.number().optional(),
|
|
1372
|
-
actions: e.array(
|
|
1408
|
+
actions: e.array(At).optional()
|
|
1373
1409
|
},
|
|
1374
1410
|
["value"]
|
|
1375
|
-
),
|
|
1411
|
+
), jt = e.object({
|
|
1376
1412
|
rowHeaderLevels: e.array(
|
|
1377
1413
|
e.object({
|
|
1378
1414
|
id: e.string(),
|
|
@@ -1412,19 +1448,19 @@ const ne = e.object({
|
|
|
1412
1448
|
role: e.enum(["value", "columnSubtotal", "columnGrandTotal"])
|
|
1413
1449
|
}).passthrough()
|
|
1414
1450
|
)
|
|
1415
|
-
}).passthrough(),
|
|
1451
|
+
}).passthrough(), Rt = k(
|
|
1416
1452
|
{
|
|
1417
1453
|
rowId: e.string(),
|
|
1418
1454
|
columnId: e.string().optional(),
|
|
1419
1455
|
measureId: e.string(),
|
|
1420
1456
|
value: e.unknown(),
|
|
1421
1457
|
formattedValue: e.string().optional(),
|
|
1422
|
-
presence:
|
|
1423
|
-
role:
|
|
1458
|
+
presence: vt,
|
|
1459
|
+
role: $t,
|
|
1424
1460
|
calculationId: e.string().optional()
|
|
1425
1461
|
},
|
|
1426
1462
|
["value"]
|
|
1427
|
-
),
|
|
1463
|
+
), Ct = e.object({
|
|
1428
1464
|
rows: e.boolean().optional(),
|
|
1429
1465
|
columns: e.boolean().optional(),
|
|
1430
1466
|
grandTotal: e.union([
|
|
@@ -1434,7 +1470,7 @@ const ne = e.object({
|
|
|
1434
1470
|
columns: e.boolean().optional()
|
|
1435
1471
|
}).passthrough()
|
|
1436
1472
|
]).optional()
|
|
1437
|
-
}).passthrough(),
|
|
1473
|
+
}).passthrough(), qt = k(
|
|
1438
1474
|
{
|
|
1439
1475
|
id: e.string(),
|
|
1440
1476
|
axis: e.enum(["row", "column"]),
|
|
@@ -1442,27 +1478,27 @@ const ne = e.object({
|
|
|
1442
1478
|
direction: e.enum(["asc", "desc"]),
|
|
1443
1479
|
nulls: e.enum(["warehouseDefault", "first", "last"]).optional(),
|
|
1444
1480
|
scope: e.enum(["global", "withinParent"]).optional(),
|
|
1445
|
-
by:
|
|
1481
|
+
by: yt
|
|
1446
1482
|
},
|
|
1447
1483
|
["by"]
|
|
1448
|
-
),
|
|
1484
|
+
), xt = e.object({
|
|
1449
1485
|
rowOffset: e.number().optional(),
|
|
1450
1486
|
rowLimit: e.number().optional(),
|
|
1451
1487
|
columnOffset: e.number().optional(),
|
|
1452
1488
|
columnLimit: e.number().optional(),
|
|
1453
1489
|
hasMoreRows: e.boolean().optional(),
|
|
1454
1490
|
hasMoreColumns: e.boolean().optional()
|
|
1455
|
-
}).passthrough(),
|
|
1491
|
+
}).passthrough(), Et = e.object({
|
|
1456
1492
|
axis: e.enum(["row", "column"]),
|
|
1457
1493
|
path: e.array(b),
|
|
1458
1494
|
depth: e.number().optional()
|
|
1459
|
-
}).passthrough(),
|
|
1495
|
+
}).passthrough(), Ft = e.object({
|
|
1460
1496
|
rowLazyLoading: e.boolean().optional(),
|
|
1461
1497
|
columnLazyLoading: e.boolean().optional(),
|
|
1462
1498
|
expandableRowNodeIds: e.array(e.string()).optional(),
|
|
1463
1499
|
expandableColumnNodeIds: e.array(e.string()).optional(),
|
|
1464
|
-
nextRequests: e.array(
|
|
1465
|
-
}).passthrough(),
|
|
1500
|
+
nextRequests: e.array(Et).optional()
|
|
1501
|
+
}).passthrough(), Nt = e.object({
|
|
1466
1502
|
domains: e.record(
|
|
1467
1503
|
e.object({
|
|
1468
1504
|
min: e.number().optional(),
|
|
@@ -1470,35 +1506,35 @@ const ne = e.object({
|
|
|
1470
1506
|
}).passthrough()
|
|
1471
1507
|
).optional(),
|
|
1472
1508
|
rules: e.array(e.record(e.string(), e.unknown())).optional()
|
|
1473
|
-
}).passthrough(),
|
|
1509
|
+
}).passthrough(), Tt = e.object({
|
|
1474
1510
|
...I,
|
|
1475
1511
|
kind: e.literal("matrix"),
|
|
1476
1512
|
schemaVersion: e.literal(1),
|
|
1477
1513
|
shape: e.enum(["hierarchical", "pivot"]),
|
|
1478
1514
|
capabilities: e.array(e.string()),
|
|
1479
1515
|
executionMetadata: e.record(e.string(), e.unknown()),
|
|
1480
|
-
fieldsById: e.record(e.string(),
|
|
1481
|
-
measuresById: e.record(e.string(),
|
|
1482
|
-
calculationsById: e.record(e.string(),
|
|
1516
|
+
fieldsById: e.record(e.string(), St),
|
|
1517
|
+
measuresById: e.record(e.string(), kt),
|
|
1518
|
+
calculationsById: e.record(e.string(), It).optional(),
|
|
1483
1519
|
axes: e.object({
|
|
1484
|
-
rows:
|
|
1485
|
-
columns:
|
|
1520
|
+
rows: Y,
|
|
1521
|
+
columns: Y
|
|
1486
1522
|
}).passthrough(),
|
|
1487
|
-
nodesById: e.record(e.string(),
|
|
1488
|
-
layout:
|
|
1489
|
-
cells: e.array(
|
|
1490
|
-
totals:
|
|
1491
|
-
sort: e.array(
|
|
1492
|
-
formattingContext:
|
|
1493
|
-
pageInfo:
|
|
1494
|
-
expansion:
|
|
1495
|
-
}).passthrough(),
|
|
1496
|
-
ct,
|
|
1497
|
-
pt,
|
|
1523
|
+
nodesById: e.record(e.string(), _t),
|
|
1524
|
+
layout: jt,
|
|
1525
|
+
cells: e.array(Rt),
|
|
1526
|
+
totals: Ct,
|
|
1527
|
+
sort: e.array(qt),
|
|
1528
|
+
formattingContext: Nt,
|
|
1529
|
+
pageInfo: xt.optional(),
|
|
1530
|
+
expansion: Ft.optional()
|
|
1531
|
+
}).passthrough(), Dt = e.union([
|
|
1498
1532
|
mt,
|
|
1499
1533
|
gt,
|
|
1500
|
-
|
|
1501
|
-
|
|
1534
|
+
ht,
|
|
1535
|
+
ft,
|
|
1536
|
+
Tt
|
|
1537
|
+
]), Ot = e.object({
|
|
1502
1538
|
status: e.enum([
|
|
1503
1539
|
"not_required",
|
|
1504
1540
|
"resolved",
|
|
@@ -1522,7 +1558,7 @@ const ne = e.object({
|
|
|
1522
1558
|
status: e.enum(["none", "warning", "error", "unknown"]),
|
|
1523
1559
|
message: e.string().optional()
|
|
1524
1560
|
}).passthrough().optional()
|
|
1525
|
-
}).passthrough(),
|
|
1561
|
+
}).passthrough(), W = e.enum([
|
|
1526
1562
|
"ambiguous_fields",
|
|
1527
1563
|
"empty_result",
|
|
1528
1564
|
"missing_grounded_fields",
|
|
@@ -1532,7 +1568,7 @@ const ne = e.object({
|
|
|
1532
1568
|
"presentation_incomplete",
|
|
1533
1569
|
"query_validation_failed",
|
|
1534
1570
|
"unsafe_join"
|
|
1535
|
-
]),
|
|
1571
|
+
]), de = e.object({
|
|
1536
1572
|
version: e.literal(1),
|
|
1537
1573
|
status: e.enum(["answered", "partial", "blocked"]),
|
|
1538
1574
|
summary: e.string(),
|
|
@@ -1549,7 +1585,7 @@ const ne = e.object({
|
|
|
1549
1585
|
e.object({
|
|
1550
1586
|
slotId: e.string().optional(),
|
|
1551
1587
|
queryId: e.string().optional(),
|
|
1552
|
-
reasonCode:
|
|
1588
|
+
reasonCode: W,
|
|
1553
1589
|
message: e.string(),
|
|
1554
1590
|
missingFields: e.array(e.string()).optional(),
|
|
1555
1591
|
availableFields: e.array(e.string()).optional(),
|
|
@@ -1562,19 +1598,19 @@ const ne = e.object({
|
|
|
1562
1598
|
),
|
|
1563
1599
|
semanticModelRecommendations: e.array(
|
|
1564
1600
|
e.object({
|
|
1565
|
-
reasonCode:
|
|
1601
|
+
reasonCode: W,
|
|
1566
1602
|
message: e.string(),
|
|
1567
1603
|
recommendedNextStep: e.string().optional()
|
|
1568
1604
|
}).passthrough()
|
|
1569
1605
|
).optional()
|
|
1570
|
-
}).passthrough(),
|
|
1606
|
+
}).passthrough(), ce = e.object({
|
|
1571
1607
|
scope: e.literal("filtered_query"),
|
|
1572
1608
|
measures: e.record(j)
|
|
1573
|
-
}).passthrough(),
|
|
1609
|
+
}).passthrough(), pe = e.object({
|
|
1574
1610
|
answeredObligations: e.array(e.string()),
|
|
1575
1611
|
missingObligations: e.array(e.string()),
|
|
1576
1612
|
warnings: e.array(M).optional()
|
|
1577
|
-
}).passthrough(),
|
|
1613
|
+
}).passthrough(), Kt = e.object({
|
|
1578
1614
|
intentId: e.string().optional(),
|
|
1579
1615
|
queryId: e.string().optional(),
|
|
1580
1616
|
status: e.enum(["answered", "partial", "failed"]),
|
|
@@ -1590,34 +1626,34 @@ const ne = e.object({
|
|
|
1590
1626
|
intent: e.unknown().optional(),
|
|
1591
1627
|
compiledQuery: e.unknown().optional(),
|
|
1592
1628
|
fieldsUsed: e.array(V).optional(),
|
|
1593
|
-
result:
|
|
1594
|
-
validation:
|
|
1595
|
-
coverage:
|
|
1629
|
+
result: Dt.optional(),
|
|
1630
|
+
validation: ue,
|
|
1631
|
+
coverage: pe.optional(),
|
|
1596
1632
|
missingFields: e.array(e.string()).optional(),
|
|
1597
1633
|
warnings: e.array(e.string()).optional(),
|
|
1598
|
-
relationshipDiagnostics:
|
|
1599
|
-
diagnosticFeedback:
|
|
1600
|
-
population:
|
|
1634
|
+
relationshipDiagnostics: Ot.optional(),
|
|
1635
|
+
diagnosticFeedback: de.optional(),
|
|
1636
|
+
population: ce.optional(),
|
|
1601
1637
|
metadata: e.record(e.string(), e.unknown()).optional()
|
|
1602
1638
|
}).passthrough();
|
|
1603
|
-
function
|
|
1639
|
+
function Mt(i) {
|
|
1604
1640
|
switch (i) {
|
|
1605
1641
|
case "boolean":
|
|
1606
1642
|
return e.boolean().optional();
|
|
1607
1643
|
case "compactExecutionFieldArray":
|
|
1608
|
-
return e.array(
|
|
1644
|
+
return e.array(ct).optional();
|
|
1609
1645
|
case "coverage":
|
|
1610
|
-
return
|
|
1646
|
+
return pe.optional();
|
|
1611
1647
|
case "diagnosticFeedback":
|
|
1612
|
-
return
|
|
1648
|
+
return de.optional();
|
|
1613
1649
|
case "executionFieldArray":
|
|
1614
1650
|
return e.array(V).optional();
|
|
1615
1651
|
case "executionResult":
|
|
1616
|
-
return
|
|
1652
|
+
return Kt.optional();
|
|
1617
1653
|
case "number":
|
|
1618
1654
|
return e.number().finite().optional();
|
|
1619
1655
|
case "population":
|
|
1620
|
-
return
|
|
1656
|
+
return ce.optional();
|
|
1621
1657
|
case "record":
|
|
1622
1658
|
return m.optional();
|
|
1623
1659
|
case "recordArray":
|
|
@@ -1633,14 +1669,14 @@ function Kt(i) {
|
|
|
1633
1669
|
case "unknownArray":
|
|
1634
1670
|
return e.array(e.unknown()).optional();
|
|
1635
1671
|
case "validationResult":
|
|
1636
|
-
return
|
|
1672
|
+
return ue.optional();
|
|
1637
1673
|
}
|
|
1638
1674
|
}
|
|
1639
|
-
const
|
|
1675
|
+
const Bt = Object.fromEntries(
|
|
1640
1676
|
Object.entries(B).map(
|
|
1641
|
-
([i, o]) => [i,
|
|
1677
|
+
([i, o]) => [i, Mt(o)]
|
|
1642
1678
|
)
|
|
1643
|
-
),
|
|
1679
|
+
), Pt = e.object(Bt).strict(), L = e.object({
|
|
1644
1680
|
sourceKey: e.string().optional(),
|
|
1645
1681
|
kind: e.enum(["semantic", "physical", "sql"]).optional(),
|
|
1646
1682
|
domainId: e.string().optional(),
|
|
@@ -1657,7 +1693,7 @@ const Ot = Object.fromEntries(
|
|
|
1657
1693
|
aggregate: d.optional(),
|
|
1658
1694
|
sourceKey: e.string().optional(),
|
|
1659
1695
|
source: L.optional()
|
|
1660
|
-
}).passthrough(),
|
|
1696
|
+
}).passthrough(), me = e.object({
|
|
1661
1697
|
id: e.string().optional(),
|
|
1662
1698
|
builder: e.literal("semaphor.inputOptions"),
|
|
1663
1699
|
source: L.optional(),
|
|
@@ -1669,24 +1705,24 @@ const Ot = Object.fromEntries(
|
|
|
1669
1705
|
dependencies: e.unknown().optional(),
|
|
1670
1706
|
limit: e.number().int().positive().optional(),
|
|
1671
1707
|
spec: m.optional()
|
|
1672
|
-
}).passthrough(),
|
|
1708
|
+
}).passthrough(), ge = e.object({
|
|
1673
1709
|
appliesToViewIds: e.array(e.string()).optional(),
|
|
1674
1710
|
viewId: e.string().optional(),
|
|
1675
1711
|
fieldRef: f,
|
|
1676
1712
|
relationshipHint: e.unknown().optional(),
|
|
1677
1713
|
relationshipsUsed: e.array(m).optional()
|
|
1678
|
-
}).passthrough(),
|
|
1714
|
+
}).passthrough(), Vt = e.object({
|
|
1679
1715
|
id: e.string(),
|
|
1680
1716
|
label: e.string().optional(),
|
|
1681
1717
|
type: e.string().optional(),
|
|
1682
1718
|
serverSide: e.boolean().optional(),
|
|
1683
1719
|
fieldRef: f.optional(),
|
|
1684
|
-
optionQuery:
|
|
1685
|
-
bindings: e.array(
|
|
1720
|
+
optionQuery: me.optional(),
|
|
1721
|
+
bindings: e.array(ge).optional(),
|
|
1686
1722
|
appliesToViewIds: e.array(e.string()),
|
|
1687
1723
|
relationshipHint: e.unknown().optional(),
|
|
1688
1724
|
relationshipsUsed: e.array(m).optional()
|
|
1689
|
-
}).passthrough(),
|
|
1725
|
+
}).passthrough(), Lt = e.object({
|
|
1690
1726
|
builder: e.enum([
|
|
1691
1727
|
"semaphor.metric",
|
|
1692
1728
|
"semaphor.records",
|
|
@@ -1696,7 +1732,7 @@ const Ot = Object.fromEntries(
|
|
|
1696
1732
|
]),
|
|
1697
1733
|
spec: m,
|
|
1698
1734
|
fallbackReason: m.optional()
|
|
1699
|
-
}).passthrough(),
|
|
1735
|
+
}).passthrough(), Gt = e.object({
|
|
1700
1736
|
id: e.string(),
|
|
1701
1737
|
title: e.string().optional(),
|
|
1702
1738
|
purpose: e.string().optional(),
|
|
@@ -1714,31 +1750,31 @@ const Ot = Object.fromEntries(
|
|
|
1714
1750
|
"semaphor.analysis",
|
|
1715
1751
|
"semaphor.sql"
|
|
1716
1752
|
]).optional(),
|
|
1717
|
-
sdkSpec:
|
|
1753
|
+
sdkSpec: Lt.optional(),
|
|
1718
1754
|
fields: e.array(f).optional(),
|
|
1719
1755
|
computation: m.optional(),
|
|
1720
1756
|
uxExpectations: e.array(e.string()).optional(),
|
|
1721
1757
|
validation: m.optional()
|
|
1722
|
-
}).passthrough(),
|
|
1758
|
+
}).passthrough(), Ut = e.object({
|
|
1723
1759
|
inputId: e.string(),
|
|
1724
1760
|
label: e.string().optional(),
|
|
1725
1761
|
type: e.string().optional(),
|
|
1726
1762
|
serverSide: e.boolean().optional(),
|
|
1727
1763
|
fieldRef: f.optional(),
|
|
1728
|
-
optionQuery:
|
|
1729
|
-
bindings: e.array(
|
|
1764
|
+
optionQuery: me.optional(),
|
|
1765
|
+
bindings: e.array(ge),
|
|
1730
1766
|
appliesToViewIds: e.array(e.string()),
|
|
1731
1767
|
notAppliedToViewIds: e.array(e.string())
|
|
1732
|
-
}).passthrough(),
|
|
1733
|
-
schemaVersion: e.literal(
|
|
1768
|
+
}).passthrough(), Zt = e.object({
|
|
1769
|
+
schemaVersion: e.literal(O),
|
|
1734
1770
|
title: e.string(),
|
|
1735
1771
|
purpose: e.string().optional(),
|
|
1736
1772
|
userGoal: e.string().optional(),
|
|
1737
1773
|
nextStep: e.string().optional(),
|
|
1738
1774
|
sources: e.array(L),
|
|
1739
|
-
inputs: e.array(
|
|
1740
|
-
views: e.array(
|
|
1741
|
-
filterContracts: e.array(
|
|
1775
|
+
inputs: e.array(Vt),
|
|
1776
|
+
views: e.array(Gt),
|
|
1777
|
+
filterContracts: e.array(Ut),
|
|
1742
1778
|
implementationChecklist: e.object({
|
|
1743
1779
|
schemaVersion: e.string().optional(),
|
|
1744
1780
|
requiredDevtools: e.object({
|
|
@@ -1768,66 +1804,66 @@ const Ot = Object.fromEntries(
|
|
|
1768
1804
|
assumptions: e.array(e.string()).optional(),
|
|
1769
1805
|
validation: m.optional()
|
|
1770
1806
|
}).passthrough().superRefine((i, o) => {
|
|
1771
|
-
const t =
|
|
1807
|
+
const t = X(i);
|
|
1772
1808
|
for (const s of t.issues)
|
|
1773
1809
|
o.addIssue({
|
|
1774
1810
|
code: e.ZodIssueCode.custom,
|
|
1775
1811
|
message: s
|
|
1776
1812
|
});
|
|
1777
|
-
}),
|
|
1813
|
+
}), zt = new Set(
|
|
1778
1814
|
Object.keys(B)
|
|
1779
1815
|
);
|
|
1780
|
-
function
|
|
1816
|
+
function Xt() {
|
|
1781
1817
|
return Object.keys(
|
|
1782
1818
|
B
|
|
1783
1819
|
);
|
|
1784
1820
|
}
|
|
1785
|
-
function
|
|
1786
|
-
return
|
|
1821
|
+
function Ht(i) {
|
|
1822
|
+
return zt.has(i);
|
|
1787
1823
|
}
|
|
1788
|
-
function
|
|
1824
|
+
function Jt(i) {
|
|
1789
1825
|
if (!i || typeof i != "object" || Array.isArray(i))
|
|
1790
1826
|
throw new Error("Semaphor analyze result must be an object.");
|
|
1791
1827
|
const t = Object.keys(i).filter(
|
|
1792
|
-
(s) => !
|
|
1828
|
+
(s) => !Ht(s)
|
|
1793
1829
|
);
|
|
1794
1830
|
if (t.length)
|
|
1795
1831
|
throw new Error(
|
|
1796
1832
|
`Semaphor analyze result contains unsupported top-level field(s): ${t.join(", ")}.`
|
|
1797
1833
|
);
|
|
1798
|
-
return
|
|
1834
|
+
return Pt.parse(i);
|
|
1799
1835
|
}
|
|
1800
1836
|
export {
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1837
|
+
pe as A,
|
|
1838
|
+
Kt as B,
|
|
1839
|
+
Bt as C,
|
|
1840
|
+
Pt as D,
|
|
1841
|
+
Zt as E,
|
|
1842
|
+
O as S,
|
|
1843
|
+
Yt as a,
|
|
1844
|
+
Ht as b,
|
|
1809
1845
|
B as c,
|
|
1810
|
-
|
|
1811
|
-
|
|
1846
|
+
it as d,
|
|
1847
|
+
nt as e,
|
|
1812
1848
|
S as f,
|
|
1813
|
-
|
|
1849
|
+
Xt as g,
|
|
1814
1850
|
y as h,
|
|
1815
|
-
|
|
1816
|
-
|
|
1851
|
+
Wt as i,
|
|
1852
|
+
ae as j,
|
|
1817
1853
|
V as k,
|
|
1818
|
-
|
|
1854
|
+
K as l,
|
|
1819
1855
|
M as m,
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1856
|
+
ue as n,
|
|
1857
|
+
mt as o,
|
|
1858
|
+
Jt as p,
|
|
1859
|
+
gt as q,
|
|
1860
|
+
ht as r,
|
|
1861
|
+
re as s,
|
|
1862
|
+
ft as t,
|
|
1863
|
+
Tt as u,
|
|
1864
|
+
X as v,
|
|
1865
|
+
Dt as w,
|
|
1866
|
+
Ot as x,
|
|
1867
|
+
de as y,
|
|
1868
|
+
ce as z
|
|
1833
1869
|
};
|