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