react-semaphor 0.1.370 → 0.1.372
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 +40 -38
- package/dist/chunks/{calendar-preferences-dialog-6q51A6XC.js → calendar-preferences-dialog-ClBAkMmF.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-CUGzkNcE.js → calendar-preferences-dialog-Dn6o2r2Y.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BEZnvIla.js → dashboard-briefing-launcher-BO-kXtEd.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-ptERmNJr.js → dashboard-briefing-launcher-D3Xfc_26.js} +3 -3
- package/dist/chunks/{dashboard-controls-CqKC5oEk.js → dashboard-controls-B3sdy_Zx.js} +3 -3
- package/dist/chunks/{dashboard-controls-CGt6_hMf.js → dashboard-controls-DcXMFgGR.js} +1 -1
- package/dist/chunks/{dashboard-json-6SgPm_QW.js → dashboard-json-BWfkEy48.js} +1 -1
- package/dist/chunks/{dashboard-json-CYSbOdmE.js → dashboard-json-CFURS_OR.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-w6hKbjlw.js → edit-dashboard-visual-BD2AJLiT.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-ByQx_M2i.js → edit-dashboard-visual-DjdhKiP2.js} +3 -3
- package/dist/chunks/{index-CPyEi9gS.js → index-C0Qnfr_7.js} +5 -4
- package/dist/chunks/{index-BtqYNH_S.js → index-DlLvzmJF.js} +2 -2
- package/dist/chunks/{resource-management-panel-Bf8-3eUf.js → resource-management-panel-DytUMSGA.js} +1 -1
- package/dist/chunks/{resource-management-panel-mJ84NxzC.js → resource-management-panel-YvIfaphX.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-BfoXDDrd.js → use-create-flow-overlay-state-BETXykC9.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-c6rCm36x.js → use-create-flow-overlay-state-CwIG1Ekp.js} +1 -1
- package/dist/chunks/{use-visual-utils-NN0e3fBP.js → use-visual-utils-Bk135OgA.js} +1 -1
- package/dist/chunks/{use-visual-utils-C_c-aiqi.js → use-visual-utils-BzFjIykb.js} +1 -1
- package/dist/chunks/{validation-PPSpYtVf.js → validation-CQFpcSSP.js} +295 -192
- package/dist/chunks/validation-D4Zz6WPD.js +1 -0
- package/dist/chunks/{validators-DBNa-eb1.js → validators-CuKnUZFO.js} +717 -345
- package/dist/chunks/validators-DHee9kM2.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +1 -1
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +56 -49
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +5 -4
- package/dist/index.cjs +1 -1
- package/dist/index.js +5 -5
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +91 -0
- package/dist/types/dashboard-assistant.d.ts +60 -2
- package/dist/types/dashboard-authoring.d.ts +58 -2
- package/dist/types/dashboard.d.ts +67 -2
- package/dist/types/data-app-builder.d.ts +41 -0
- package/dist/types/data-app-sdk-validation.d.ts +50 -3
- package/dist/types/data-app-sdk.d.ts +53 -3
- package/dist/types/main.d.ts +59 -2
- package/dist/types/shared.d.ts +66 -2
- package/dist/types/surfboard.d.ts +67 -2
- package/dist/types/types.d.ts +67 -2
- package/package.json +1 -1
- package/dist/chunks/validation-DYL3ArlL.js +0 -1
- package/dist/chunks/validators-CgxWT8UX.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { b as z } from "./source-identity-Dj3dryN9.js";
|
|
2
|
-
function
|
|
3
|
-
const i =
|
|
4
|
-
return
|
|
2
|
+
function Ee(e) {
|
|
3
|
+
const i = Q(e);
|
|
4
|
+
return B(i) ? i : void 0;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function Q(e) {
|
|
7
7
|
if (typeof e != "string" || e.trim().length === 0)
|
|
8
8
|
return;
|
|
9
9
|
const i = e.trim().toLowerCase().replace(/_/g, " ");
|
|
@@ -41,41 +41,41 @@ function V(e) {
|
|
|
41
41
|
case "is not null":
|
|
42
42
|
return "is_not_null";
|
|
43
43
|
default:
|
|
44
|
-
return
|
|
44
|
+
return K(e) ? e : void 0;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function B(e) {
|
|
48
48
|
return e === "=" || e === "!=" || e === "in" || e === "not_in" || e === "contains" || e === "not_contains" || e === "between" || e === "not_between" || e === ">" || e === ">=" || e === "<" || e === "<=";
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
50
|
+
function K(e) {
|
|
51
|
+
return B(e) || e === "not_contains" || e === "is_null" || e === "is_not_null";
|
|
52
52
|
}
|
|
53
53
|
function a(e, i, t) {
|
|
54
54
|
return t ? { code: e, message: i, path: t } : { code: e, message: i };
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Y(e) {
|
|
57
57
|
for (let i = 0; i < e.length; i += 1) {
|
|
58
58
|
const t = e[i];
|
|
59
59
|
if (e.some(
|
|
60
|
-
(s, n) => n !== i &&
|
|
60
|
+
(s, n) => n !== i && j(s, t)
|
|
61
61
|
))
|
|
62
62
|
return !1;
|
|
63
63
|
}
|
|
64
64
|
return !0;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function O(e, i) {
|
|
67
67
|
return z(e, i);
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
69
|
+
function j(e, i) {
|
|
70
|
+
return O(e, i) && v(e) === v(i);
|
|
71
71
|
}
|
|
72
72
|
function X(e) {
|
|
73
|
-
return `Metric intent has duplicate metric "${e.name}" with the same aggregate (${
|
|
73
|
+
return `Metric intent has duplicate metric "${e.name}" with the same aggregate (${v(e)}). Use different aggregates to request both, or remove one entry.`;
|
|
74
74
|
}
|
|
75
75
|
function I(e) {
|
|
76
76
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Z(e, i, t) {
|
|
79
79
|
if (e !== void 0) {
|
|
80
80
|
if (!e || typeof e != "object" || Array.isArray(e)) {
|
|
81
81
|
t.push(
|
|
@@ -108,73 +108,111 @@ function Y(e, i, t) {
|
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function J(e, i) {
|
|
112
112
|
return A(e, i).length === 1;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function W(e, i) {
|
|
115
115
|
return A(e, i).length === 1;
|
|
116
116
|
}
|
|
117
117
|
function A(e, i) {
|
|
118
118
|
return i.filter(
|
|
119
|
-
(s) =>
|
|
119
|
+
(s) => ee(e, s)
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
122
|
+
function ee(e, i) {
|
|
123
|
+
return ie(e, i) ? e.source ? O(i, e) : !0 : !1;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
return !(i.name !== e.name || e.role !== void 0 && i.role !== void 0 && i.role !== e.role ||
|
|
125
|
+
function ie(e, i) {
|
|
126
|
+
return !(i.name !== e.name || e.role !== void 0 && i.role !== void 0 && i.role !== e.role || te(e, i) && v(i) !== v(e));
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function te(e, i) {
|
|
129
129
|
return e.role === "measure" || i.role === "measure" || e.aggregate !== void 0 || i.aggregate !== void 0;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function v(e) {
|
|
132
132
|
return (e.aggregate || "SUM").toUpperCase();
|
|
133
133
|
}
|
|
134
|
-
const
|
|
135
|
-
function
|
|
134
|
+
const ae = /^(\d{4})-(\d{2})-(\d{2})$/, se = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;
|
|
135
|
+
function R(e) {
|
|
136
136
|
if (typeof e != "string")
|
|
137
137
|
return null;
|
|
138
|
-
const i = e.trim(), t =
|
|
138
|
+
const i = e.trim(), t = ae.exec(i);
|
|
139
139
|
if (t) {
|
|
140
|
-
const [,
|
|
141
|
-
return
|
|
140
|
+
const [, y, k, S] = t;
|
|
141
|
+
return D(y, k, S) ? new Date(Date.UTC(Number(y), Number(k) - 1, Number(S))) : null;
|
|
142
142
|
}
|
|
143
|
-
const s =
|
|
143
|
+
const s = se.exec(i);
|
|
144
144
|
if (!s)
|
|
145
145
|
return null;
|
|
146
|
-
const [, n, o,
|
|
147
|
-
if (!
|
|
146
|
+
const [, n, r, o, u, d, f = "00", , p] = s;
|
|
147
|
+
if (!D(n, r, o) || !g(u, 0, 23) || !g(d, 0, 59) || !g(f, 0, 59) || !ne(p))
|
|
148
148
|
return null;
|
|
149
|
-
const
|
|
150
|
-
return Number.isFinite(
|
|
149
|
+
const b = new Date(i);
|
|
150
|
+
return Number.isFinite(b.getTime()) ? b : null;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
const s = Number(e), n = Number(i),
|
|
154
|
-
if (!Number.isInteger(s) || !Number.isInteger(n) || !Number.isInteger(
|
|
152
|
+
function D(e, i, t) {
|
|
153
|
+
const s = Number(e), n = Number(i), r = Number(t);
|
|
154
|
+
if (!Number.isInteger(s) || !Number.isInteger(n) || !Number.isInteger(r) || n < 1 || n > 12)
|
|
155
155
|
return !1;
|
|
156
|
-
const
|
|
157
|
-
return
|
|
156
|
+
const o = new Date(Date.UTC(s, n - 1, r));
|
|
157
|
+
return o.getUTCFullYear() === s && o.getUTCMonth() === n - 1 && o.getUTCDate() === r;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function g(e, i, t) {
|
|
160
160
|
const s = Number(e);
|
|
161
161
|
return Number.isInteger(s) && s >= i && s <= t;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function ne(e) {
|
|
164
164
|
if (e === "Z")
|
|
165
165
|
return !0;
|
|
166
166
|
const i = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
167
|
-
return !!(i &&
|
|
167
|
+
return !!(i && g(i[2], 0, 23) && g(i[3], 0, 59));
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function l(e) {
|
|
170
170
|
return typeof e == "string" && e.trim().length > 0;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function re(e) {
|
|
173
|
+
const i = /* @__PURE__ */ new Set();
|
|
174
|
+
let t = 0;
|
|
175
|
+
for (; t < e.length; ) {
|
|
176
|
+
const s = e[t];
|
|
177
|
+
if (s === "'" || s === '"') {
|
|
178
|
+
t = oe(e, t);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
if (s === "{") {
|
|
182
|
+
const n = e.indexOf("}", t + 1);
|
|
183
|
+
if (n === -1) {
|
|
184
|
+
t += 1;
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
const r = e.slice(t + 1, n);
|
|
188
|
+
/^[A-Za-z_][A-Za-z0-9_]*$/.test(r) && i.add(r), t = n + 1;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
t += 1;
|
|
192
|
+
}
|
|
193
|
+
return Array.from(i);
|
|
194
|
+
}
|
|
195
|
+
function oe(e, i) {
|
|
196
|
+
const t = e[i];
|
|
197
|
+
let s = i + 1;
|
|
198
|
+
for (; s < e.length; ) {
|
|
199
|
+
if (e[s] === t) {
|
|
200
|
+
if (e[s + 1] === t) {
|
|
201
|
+
s += 2;
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
return s + 1;
|
|
205
|
+
}
|
|
206
|
+
s += 1;
|
|
207
|
+
}
|
|
208
|
+
return e.length;
|
|
209
|
+
}
|
|
210
|
+
function c(e) {
|
|
173
211
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
174
212
|
}
|
|
175
|
-
function
|
|
213
|
+
function P(e, i, t) {
|
|
176
214
|
if (e !== void 0) {
|
|
177
|
-
if (!
|
|
215
|
+
if (!c(e)) {
|
|
178
216
|
t.push(
|
|
179
217
|
a(
|
|
180
218
|
"invalid_pagination",
|
|
@@ -199,7 +237,7 @@ function q(e, i, t) {
|
|
|
199
237
|
);
|
|
200
238
|
}
|
|
201
239
|
}
|
|
202
|
-
function
|
|
240
|
+
function w(e) {
|
|
203
241
|
const i = /* @__PURE__ */ new Set();
|
|
204
242
|
for (const t of e) {
|
|
205
243
|
if (i.has(t))
|
|
@@ -208,9 +246,9 @@ function x(e) {
|
|
|
208
246
|
}
|
|
209
247
|
return null;
|
|
210
248
|
}
|
|
211
|
-
function
|
|
212
|
-
|
|
213
|
-
e.filter((
|
|
249
|
+
function x(e, i, t, s) {
|
|
250
|
+
w(
|
|
251
|
+
e.filter((r) => l(r))
|
|
214
252
|
) && s.push(
|
|
215
253
|
a(
|
|
216
254
|
"duplicate_matrix_public_id",
|
|
@@ -219,7 +257,7 @@ function g(e, i, t, s) {
|
|
|
219
257
|
)
|
|
220
258
|
);
|
|
221
259
|
}
|
|
222
|
-
const
|
|
260
|
+
const de = /* @__PURE__ */ new Set([
|
|
223
261
|
"SUM",
|
|
224
262
|
"COUNT",
|
|
225
263
|
"AVG",
|
|
@@ -236,13 +274,13 @@ function F(e, i, t) {
|
|
|
236
274
|
return;
|
|
237
275
|
}
|
|
238
276
|
if (e.kind === "semantic") {
|
|
239
|
-
|
|
277
|
+
l(e.domainId) || t.push(
|
|
240
278
|
a(
|
|
241
279
|
"missing_semantic_domain",
|
|
242
280
|
"Semantic source needs a domainId.",
|
|
243
281
|
`${i}.domainId`
|
|
244
282
|
)
|
|
245
|
-
),
|
|
283
|
+
), l(e.datasetName) || t.push(
|
|
246
284
|
a(
|
|
247
285
|
"missing_dataset_name",
|
|
248
286
|
"Semantic source needs a datasetName.",
|
|
@@ -252,13 +290,13 @@ function F(e, i, t) {
|
|
|
252
290
|
return;
|
|
253
291
|
}
|
|
254
292
|
if (e.kind === "physical") {
|
|
255
|
-
|
|
293
|
+
l(e.connectionId) || t.push(
|
|
256
294
|
a(
|
|
257
295
|
"missing_connection_id",
|
|
258
296
|
"Physical source needs a connectionId.",
|
|
259
297
|
`${i}.connectionId`
|
|
260
298
|
)
|
|
261
|
-
),
|
|
299
|
+
), l(e.tableName) || t.push(
|
|
262
300
|
a(
|
|
263
301
|
"missing_table_name",
|
|
264
302
|
"Physical source needs a tableName.",
|
|
@@ -268,7 +306,7 @@ function F(e, i, t) {
|
|
|
268
306
|
return;
|
|
269
307
|
}
|
|
270
308
|
if (e.kind === "sql") {
|
|
271
|
-
|
|
309
|
+
l(e.connectionId) || t.push(
|
|
272
310
|
a(
|
|
273
311
|
"missing_connection_id",
|
|
274
312
|
"SQL source needs a connectionId.",
|
|
@@ -281,23 +319,23 @@ function F(e, i, t) {
|
|
|
281
319
|
a("invalid_source_kind", "Source kind is not supported.", i)
|
|
282
320
|
);
|
|
283
321
|
}
|
|
284
|
-
function
|
|
285
|
-
if (!e || !
|
|
322
|
+
function m(e, i, t, s = {}) {
|
|
323
|
+
if (!e || !c(e)) {
|
|
286
324
|
s.required && t.push(
|
|
287
325
|
a("missing_field_ref", "Field reference needs a name.", i)
|
|
288
326
|
);
|
|
289
327
|
return;
|
|
290
328
|
}
|
|
291
|
-
|
|
329
|
+
l(e.name) || t.push(
|
|
292
330
|
a(
|
|
293
331
|
"missing_field_ref",
|
|
294
332
|
"Field reference needs a name.",
|
|
295
333
|
`${i}.name`
|
|
296
334
|
)
|
|
297
|
-
), e.source !== void 0 && F(e.source, `${i}.source`, t),
|
|
335
|
+
), e.source !== void 0 && F(e.source, `${i}.source`, t), _(e.aggregate, `${i}.aggregate`, t);
|
|
298
336
|
}
|
|
299
|
-
function
|
|
300
|
-
e !== void 0 && (typeof e != "string" || !
|
|
337
|
+
function _(e, i, t) {
|
|
338
|
+
e !== void 0 && (typeof e != "string" || !de.has(e)) && t.push(
|
|
301
339
|
a(
|
|
302
340
|
"invalid_aggregate",
|
|
303
341
|
"Field aggregate must be SUM, COUNT, AVG, MIN, MAX, MEDIAN, or DISTINCT.",
|
|
@@ -305,7 +343,119 @@ function y(e, i, t) {
|
|
|
305
343
|
)
|
|
306
344
|
);
|
|
307
345
|
}
|
|
308
|
-
|
|
346
|
+
const le = /* @__PURE__ */ new Set([
|
|
347
|
+
"measure",
|
|
348
|
+
"group",
|
|
349
|
+
"date",
|
|
350
|
+
"id",
|
|
351
|
+
"filter"
|
|
352
|
+
]), ue = /* @__PURE__ */ new Set(["row", "aggregate"]), C = /* @__PURE__ */ new Set([
|
|
353
|
+
"string",
|
|
354
|
+
"number",
|
|
355
|
+
"boolean",
|
|
356
|
+
"date",
|
|
357
|
+
"datetime",
|
|
358
|
+
"unknown"
|
|
359
|
+
]), ce = /* @__PURE__ */ new Set([
|
|
360
|
+
"additive",
|
|
361
|
+
"non_additive",
|
|
362
|
+
"ratio_of_sums",
|
|
363
|
+
"weighted",
|
|
364
|
+
"pre_aggregated",
|
|
365
|
+
"snapshot"
|
|
366
|
+
]), fe = /* @__PURE__ */ new Set([
|
|
367
|
+
"default",
|
|
368
|
+
"symmetric_aggregate",
|
|
369
|
+
"aggregate_then_join",
|
|
370
|
+
"weighted"
|
|
371
|
+
]);
|
|
372
|
+
function me(e, i, t) {
|
|
373
|
+
if (!e || !c(e)) {
|
|
374
|
+
t.push(
|
|
375
|
+
a(
|
|
376
|
+
"invalid_derived_field_input",
|
|
377
|
+
"Derived field inputs must be structured input references.",
|
|
378
|
+
i
|
|
379
|
+
)
|
|
380
|
+
);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if (e.kind === "field") {
|
|
384
|
+
m(e.field, `${i}.field`, t, { required: !0 }), _(e.aggregate, `${i}.aggregate`, t);
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
if (e.kind === "metric") {
|
|
388
|
+
m(e.metric, `${i}.metric`, t, {
|
|
389
|
+
required: !0
|
|
390
|
+
});
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
if (e.kind === "dimension") {
|
|
394
|
+
m(e.dimension, `${i}.dimension`, t, {
|
|
395
|
+
required: !0
|
|
396
|
+
});
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
t.push(
|
|
400
|
+
a(
|
|
401
|
+
"invalid_derived_field_input",
|
|
402
|
+
"Derived field input kind must be field, metric, or dimension.",
|
|
403
|
+
`${i}.kind`
|
|
404
|
+
)
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
function T(e, i, t) {
|
|
408
|
+
if (!c(e)) {
|
|
409
|
+
t.push(
|
|
410
|
+
a(
|
|
411
|
+
"invalid_result_column_ref",
|
|
412
|
+
"Result calculation references must use columnKey or field.",
|
|
413
|
+
i
|
|
414
|
+
)
|
|
415
|
+
);
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const s = l(e.columnKey), n = c(e.field);
|
|
419
|
+
if (s === n) {
|
|
420
|
+
t.push(
|
|
421
|
+
a(
|
|
422
|
+
"invalid_result_column_ref",
|
|
423
|
+
"Result calculation references must identify exactly one of columnKey or field.",
|
|
424
|
+
i
|
|
425
|
+
)
|
|
426
|
+
);
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
n && m(e.field, `${i}.field`, t, {
|
|
430
|
+
required: !0
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
function pe(e, i, t) {
|
|
434
|
+
if (!c(e)) {
|
|
435
|
+
t.push(
|
|
436
|
+
a(
|
|
437
|
+
"invalid_result_calculation_output",
|
|
438
|
+
"Result calculation output must be a structured object.",
|
|
439
|
+
i
|
|
440
|
+
)
|
|
441
|
+
);
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
l(e.key) || t.push(
|
|
445
|
+
a(
|
|
446
|
+
"invalid_result_calculation_output",
|
|
447
|
+
"Result calculation output needs a stable key.",
|
|
448
|
+
`${i}.key`
|
|
449
|
+
)
|
|
450
|
+
), e.dataType !== void 0 && (typeof e.dataType != "string" || !C.has(e.dataType)) && t.push(
|
|
451
|
+
a(
|
|
452
|
+
"invalid_result_calculation_output",
|
|
453
|
+
"Result calculation output dataType must be string, number, boolean, date, datetime, or unknown.",
|
|
454
|
+
`${i}.dataType`
|
|
455
|
+
)
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
function _e(e, i, t) {
|
|
309
459
|
e !== void 0 && e !== "hour" && e !== "day" && e !== "week" && e !== "month" && e !== "quarter" && e !== "year" && t.push(
|
|
310
460
|
a(
|
|
311
461
|
"invalid_time_grain",
|
|
@@ -314,10 +464,10 @@ function se(e, i, t) {
|
|
|
314
464
|
)
|
|
315
465
|
);
|
|
316
466
|
}
|
|
317
|
-
function
|
|
467
|
+
function L(e, i, t, s) {
|
|
318
468
|
e !== "asc" && e !== "desc" && t.push(a(s, "Sort direction must be asc or desc.", i));
|
|
319
469
|
}
|
|
320
|
-
function
|
|
470
|
+
function H(e, i, t, s) {
|
|
321
471
|
e !== void 0 && e !== "warehouseDefault" && e !== "first" && e !== "last" && t.push(
|
|
322
472
|
a(
|
|
323
473
|
s,
|
|
@@ -326,12 +476,12 @@ function C(e, i, t, s) {
|
|
|
326
476
|
)
|
|
327
477
|
);
|
|
328
478
|
}
|
|
329
|
-
function
|
|
479
|
+
function U(e, i, t, s) {
|
|
330
480
|
e !== void 0 && e !== "global" && e !== "withinParent" && t.push(
|
|
331
481
|
a(s, "Sort scope must be global or withinParent.", i)
|
|
332
482
|
);
|
|
333
483
|
}
|
|
334
|
-
function
|
|
484
|
+
function ge(e, i, t) {
|
|
335
485
|
e.enabled !== void 0 && typeof e.enabled != "boolean" && t.push(
|
|
336
486
|
a(
|
|
337
487
|
"invalid_matrix_subtotal",
|
|
@@ -352,23 +502,23 @@ function re(e, i, t) {
|
|
|
352
502
|
)
|
|
353
503
|
);
|
|
354
504
|
}
|
|
355
|
-
function
|
|
356
|
-
if (
|
|
505
|
+
function ve(e, i, t) {
|
|
506
|
+
if (L(
|
|
357
507
|
e.direction,
|
|
358
508
|
`${i}.direction`,
|
|
359
509
|
t,
|
|
360
510
|
"invalid_matrix_sort_direction"
|
|
361
|
-
),
|
|
511
|
+
), H(
|
|
362
512
|
e.nulls,
|
|
363
513
|
`${i}.nulls`,
|
|
364
514
|
t,
|
|
365
515
|
"invalid_matrix_sort_nulls"
|
|
366
|
-
),
|
|
516
|
+
), U(
|
|
367
517
|
e.scope,
|
|
368
518
|
`${i}.scope`,
|
|
369
519
|
t,
|
|
370
520
|
"invalid_matrix_sort_scope"
|
|
371
|
-
), !
|
|
521
|
+
), !c(e.by)) {
|
|
372
522
|
t.push(
|
|
373
523
|
a(
|
|
374
524
|
"invalid_matrix_sort_by",
|
|
@@ -380,9 +530,9 @@ function oe(e, i, t) {
|
|
|
380
530
|
}
|
|
381
531
|
if (e.by.kind !== "label") {
|
|
382
532
|
if (e.by.kind === "field") {
|
|
383
|
-
|
|
533
|
+
m(e.by.field, `${i}.by.field`, t, {
|
|
384
534
|
required: !0
|
|
385
|
-
}),
|
|
535
|
+
}), _(e.by.aggregate, `${i}.by.aggregate`, t);
|
|
386
536
|
return;
|
|
387
537
|
}
|
|
388
538
|
t.push(
|
|
@@ -394,7 +544,7 @@ function oe(e, i, t) {
|
|
|
394
544
|
);
|
|
395
545
|
}
|
|
396
546
|
}
|
|
397
|
-
function
|
|
547
|
+
function E(e, i, t, s) {
|
|
398
548
|
if (!Array.isArray(e))
|
|
399
549
|
return s.required ? t.push(
|
|
400
550
|
a(
|
|
@@ -417,58 +567,58 @@ function B(e, i, t, s) {
|
|
|
417
567
|
)
|
|
418
568
|
);
|
|
419
569
|
const n = [];
|
|
420
|
-
return e.forEach((
|
|
421
|
-
const
|
|
422
|
-
if (!
|
|
570
|
+
return e.forEach((r, o) => {
|
|
571
|
+
const u = `${i}.${o}`;
|
|
572
|
+
if (!c(r)) {
|
|
423
573
|
t.push(
|
|
424
574
|
a(
|
|
425
575
|
"invalid_matrix_axis_level",
|
|
426
576
|
"Matrix axis levels must be structured objects.",
|
|
427
|
-
|
|
577
|
+
u
|
|
428
578
|
)
|
|
429
579
|
);
|
|
430
580
|
return;
|
|
431
581
|
}
|
|
432
|
-
const
|
|
433
|
-
n.push(
|
|
582
|
+
const d = r;
|
|
583
|
+
n.push(d), d.id !== void 0 && !l(d.id) && t.push(
|
|
434
584
|
a(
|
|
435
585
|
"invalid_matrix_axis_level_id",
|
|
436
586
|
"Matrix axis level id must be a non-empty string.",
|
|
437
|
-
`${
|
|
587
|
+
`${u}.id`
|
|
438
588
|
)
|
|
439
|
-
),
|
|
589
|
+
), m(d.field, `${u}.field`, t, {
|
|
440
590
|
required: !0
|
|
441
|
-
}),
|
|
591
|
+
}), _e(d.grain, `${u}.grain`, t), d.label !== void 0 && typeof d.label != "string" && t.push(
|
|
442
592
|
a(
|
|
443
593
|
"invalid_matrix_axis_label",
|
|
444
594
|
"Matrix axis level label must be a string.",
|
|
445
|
-
`${
|
|
595
|
+
`${u}.label`
|
|
446
596
|
)
|
|
447
|
-
),
|
|
448
|
-
|
|
449
|
-
`${
|
|
597
|
+
), d.subtotal !== void 0 && typeof d.subtotal != "boolean" && (c(d.subtotal) ? ge(
|
|
598
|
+
d.subtotal,
|
|
599
|
+
`${u}.subtotal`,
|
|
450
600
|
t
|
|
451
601
|
) : t.push(
|
|
452
602
|
a(
|
|
453
603
|
"invalid_matrix_subtotal",
|
|
454
604
|
"Matrix subtotal must be a boolean or structured options object.",
|
|
455
|
-
`${
|
|
605
|
+
`${u}.subtotal`
|
|
456
606
|
)
|
|
457
|
-
)),
|
|
458
|
-
|
|
459
|
-
`${
|
|
607
|
+
)), d.sortBy !== void 0 && (c(d.sortBy) ? ve(
|
|
608
|
+
d.sortBy,
|
|
609
|
+
`${u}.sortBy`,
|
|
460
610
|
t
|
|
461
611
|
) : t.push(
|
|
462
612
|
a(
|
|
463
613
|
"invalid_matrix_sort_by",
|
|
464
614
|
"Matrix axis sortBy must be a structured object.",
|
|
465
|
-
`${
|
|
615
|
+
`${u}.sortBy`
|
|
466
616
|
)
|
|
467
617
|
));
|
|
468
618
|
}), n;
|
|
469
619
|
}
|
|
470
|
-
function
|
|
471
|
-
if (!
|
|
620
|
+
function be(e, i, t) {
|
|
621
|
+
if (!c(e)) {
|
|
472
622
|
t.push(
|
|
473
623
|
a(
|
|
474
624
|
"invalid_matrix_total_behavior",
|
|
@@ -488,13 +638,13 @@ function le(e, i, t) {
|
|
|
488
638
|
);
|
|
489
639
|
return;
|
|
490
640
|
}
|
|
491
|
-
e.kind === "customAggregate" && (Object.prototype.hasOwnProperty.call(e, "aggregate") ?
|
|
641
|
+
e.kind === "customAggregate" && (Object.prototype.hasOwnProperty.call(e, "aggregate") ? _(e.aggregate, `${i}.aggregate`, t) : t.push(
|
|
492
642
|
a(
|
|
493
643
|
"invalid_matrix_total_behavior",
|
|
494
644
|
"Custom matrix total behavior needs an aggregate.",
|
|
495
645
|
`${i}.aggregate`
|
|
496
646
|
)
|
|
497
|
-
)), e.kind === "customExpression" && !
|
|
647
|
+
)), e.kind === "customExpression" && !l(e.expressionId) && t.push(
|
|
498
648
|
a(
|
|
499
649
|
"invalid_matrix_total_behavior",
|
|
500
650
|
"Custom matrix total behavior needs an expressionId.",
|
|
@@ -508,7 +658,7 @@ function le(e, i, t) {
|
|
|
508
658
|
)
|
|
509
659
|
);
|
|
510
660
|
}
|
|
511
|
-
function
|
|
661
|
+
function ye(e, i, t) {
|
|
512
662
|
if (!Array.isArray(e) || e.length === 0)
|
|
513
663
|
return t.push(
|
|
514
664
|
a(
|
|
@@ -518,46 +668,46 @@ function de(e, i, t) {
|
|
|
518
668
|
)
|
|
519
669
|
), [];
|
|
520
670
|
const s = [];
|
|
521
|
-
return e.forEach((n,
|
|
522
|
-
const
|
|
523
|
-
if (!
|
|
671
|
+
return e.forEach((n, r) => {
|
|
672
|
+
const o = `${i}.${r}`;
|
|
673
|
+
if (!c(n)) {
|
|
524
674
|
t.push(
|
|
525
675
|
a(
|
|
526
676
|
"invalid_matrix_value",
|
|
527
677
|
"Matrix values must be structured objects.",
|
|
528
|
-
|
|
678
|
+
o
|
|
529
679
|
)
|
|
530
680
|
);
|
|
531
681
|
return;
|
|
532
682
|
}
|
|
533
|
-
const
|
|
534
|
-
s.push(
|
|
683
|
+
const u = n;
|
|
684
|
+
s.push(u), u.id !== void 0 && !l(u.id) && t.push(
|
|
535
685
|
a(
|
|
536
686
|
"invalid_matrix_value_id",
|
|
537
687
|
"Matrix value id must be a non-empty string.",
|
|
538
|
-
`${
|
|
688
|
+
`${o}.id`
|
|
539
689
|
)
|
|
540
|
-
),
|
|
690
|
+
), m(u.field, `${o}.field`, t, {
|
|
541
691
|
required: !0
|
|
542
|
-
}),
|
|
543
|
-
|
|
544
|
-
`${
|
|
692
|
+
}), _(
|
|
693
|
+
u.aggregate,
|
|
694
|
+
`${o}.aggregate`,
|
|
545
695
|
t
|
|
546
|
-
),
|
|
696
|
+
), u.label !== void 0 && typeof u.label != "string" && t.push(
|
|
547
697
|
a(
|
|
548
698
|
"invalid_matrix_value_label",
|
|
549
699
|
"Matrix value label must be a string.",
|
|
550
|
-
`${
|
|
700
|
+
`${o}.label`
|
|
551
701
|
)
|
|
552
|
-
),
|
|
553
|
-
|
|
554
|
-
`${
|
|
702
|
+
), u.totalBehavior !== void 0 && be(
|
|
703
|
+
u.totalBehavior,
|
|
704
|
+
`${o}.totalBehavior`,
|
|
555
705
|
t
|
|
556
706
|
);
|
|
557
707
|
}), s;
|
|
558
708
|
}
|
|
559
|
-
function
|
|
560
|
-
if (!
|
|
709
|
+
function he(e, i, t) {
|
|
710
|
+
if (!c(e)) {
|
|
561
711
|
t.push(
|
|
562
712
|
a(
|
|
563
713
|
"invalid_matrix_totals",
|
|
@@ -578,7 +728,7 @@ function ue(e, i, t) {
|
|
|
578
728
|
);
|
|
579
729
|
}
|
|
580
730
|
if (e.grandTotal !== void 0 && typeof e.grandTotal != "boolean")
|
|
581
|
-
if (!
|
|
731
|
+
if (!c(e.grandTotal))
|
|
582
732
|
t.push(
|
|
583
733
|
a(
|
|
584
734
|
"invalid_matrix_totals",
|
|
@@ -611,7 +761,7 @@ function ue(e, i, t) {
|
|
|
611
761
|
)
|
|
612
762
|
);
|
|
613
763
|
}
|
|
614
|
-
function
|
|
764
|
+
function $(e, i, t, s) {
|
|
615
765
|
if (!Array.isArray(e)) {
|
|
616
766
|
s.push(
|
|
617
767
|
a(
|
|
@@ -622,25 +772,25 @@ function w(e, i, t, s) {
|
|
|
622
772
|
);
|
|
623
773
|
return;
|
|
624
774
|
}
|
|
625
|
-
e.forEach((n,
|
|
626
|
-
const
|
|
627
|
-
if (!
|
|
775
|
+
e.forEach((n, r) => {
|
|
776
|
+
const o = `${i}.${r}`;
|
|
777
|
+
if (!c(n)) {
|
|
628
778
|
s.push(
|
|
629
779
|
a(
|
|
630
780
|
"invalid_matrix_path",
|
|
631
781
|
"Matrix path segment must be a structured object.",
|
|
632
|
-
|
|
782
|
+
o
|
|
633
783
|
)
|
|
634
784
|
);
|
|
635
785
|
return;
|
|
636
786
|
}
|
|
637
|
-
const
|
|
638
|
-
if (!
|
|
787
|
+
const u = n;
|
|
788
|
+
if (!l(u.levelId)) {
|
|
639
789
|
s.push(
|
|
640
790
|
a(
|
|
641
791
|
"stable_id_required",
|
|
642
792
|
"Matrix path segments must reference an explicit public axis level id.",
|
|
643
|
-
`${
|
|
793
|
+
`${o}.levelId`
|
|
644
794
|
)
|
|
645
795
|
);
|
|
646
796
|
return;
|
|
@@ -649,19 +799,19 @@ function w(e, i, t, s) {
|
|
|
649
799
|
a(
|
|
650
800
|
"invalid_matrix_path",
|
|
651
801
|
"Matrix path segments must include a value property; use explicit null for null members.",
|
|
652
|
-
`${
|
|
802
|
+
`${o}.value`
|
|
653
803
|
)
|
|
654
|
-
), t.has(
|
|
804
|
+
), t.has(u.levelId) || s.push(
|
|
655
805
|
a(
|
|
656
806
|
"stable_id_required",
|
|
657
807
|
"Matrix path segment levelId must match an explicit public axis level id.",
|
|
658
|
-
`${
|
|
808
|
+
`${o}.levelId`
|
|
659
809
|
)
|
|
660
810
|
);
|
|
661
811
|
});
|
|
662
812
|
}
|
|
663
|
-
function
|
|
664
|
-
if (!
|
|
813
|
+
function N(e, i, t, s) {
|
|
814
|
+
if (!c(e)) {
|
|
665
815
|
s.push(
|
|
666
816
|
a(
|
|
667
817
|
"invalid_matrix_expansion",
|
|
@@ -683,10 +833,10 @@ function T(e, i, t, s) {
|
|
|
683
833
|
"Matrix expansion lazy must be a boolean.",
|
|
684
834
|
`${i}.lazy`
|
|
685
835
|
)
|
|
686
|
-
), e.expandedPaths !== void 0 && (Array.isArray(e.expandedPaths) ? e.expandedPaths.forEach((n,
|
|
687
|
-
|
|
836
|
+
), e.expandedPaths !== void 0 && (Array.isArray(e.expandedPaths) ? e.expandedPaths.forEach((n, r) => {
|
|
837
|
+
$(
|
|
688
838
|
n,
|
|
689
|
-
`${i}.expandedPaths.${
|
|
839
|
+
`${i}.expandedPaths.${r}`,
|
|
690
840
|
t,
|
|
691
841
|
s
|
|
692
842
|
);
|
|
@@ -698,9 +848,9 @@ function T(e, i, t, s) {
|
|
|
698
848
|
)
|
|
699
849
|
));
|
|
700
850
|
}
|
|
701
|
-
function
|
|
851
|
+
function xe(e, i, t, s) {
|
|
702
852
|
if (e !== void 0) {
|
|
703
|
-
if (!
|
|
853
|
+
if (!c(e)) {
|
|
704
854
|
s.push(
|
|
705
855
|
a(
|
|
706
856
|
"invalid_matrix_expansion",
|
|
@@ -710,12 +860,12 @@ function ce(e, i, t, s) {
|
|
|
710
860
|
);
|
|
711
861
|
return;
|
|
712
862
|
}
|
|
713
|
-
e.rows !== void 0 &&
|
|
863
|
+
e.rows !== void 0 && N(
|
|
714
864
|
e.rows,
|
|
715
865
|
"expansion.rows",
|
|
716
866
|
i,
|
|
717
867
|
s
|
|
718
|
-
), e.columns !== void 0 &&
|
|
868
|
+
), e.columns !== void 0 && N(
|
|
719
869
|
e.columns,
|
|
720
870
|
"expansion.columns",
|
|
721
871
|
t,
|
|
@@ -723,7 +873,7 @@ function ce(e, i, t, s) {
|
|
|
723
873
|
);
|
|
724
874
|
}
|
|
725
875
|
}
|
|
726
|
-
function
|
|
876
|
+
function we(e, i, t, s, n) {
|
|
727
877
|
if (e !== void 0) {
|
|
728
878
|
if (!Array.isArray(e)) {
|
|
729
879
|
n.push(
|
|
@@ -735,84 +885,84 @@ function me(e, i, t, s, n) {
|
|
|
735
885
|
);
|
|
736
886
|
return;
|
|
737
887
|
}
|
|
738
|
-
e.forEach((
|
|
739
|
-
const
|
|
740
|
-
if (!
|
|
888
|
+
e.forEach((r, o) => {
|
|
889
|
+
const u = `sort.${o}`;
|
|
890
|
+
if (!c(r)) {
|
|
741
891
|
n.push(
|
|
742
892
|
a(
|
|
743
893
|
"invalid_matrix_sort",
|
|
744
894
|
"Matrix sort rule must be a structured object.",
|
|
745
|
-
|
|
895
|
+
u
|
|
746
896
|
)
|
|
747
897
|
);
|
|
748
898
|
return;
|
|
749
899
|
}
|
|
750
|
-
const
|
|
751
|
-
|
|
900
|
+
const d = r;
|
|
901
|
+
d.axis !== "row" && d.axis !== "column" && n.push(
|
|
752
902
|
a(
|
|
753
903
|
"invalid_matrix_sort",
|
|
754
904
|
"Matrix sort axis must be row or column.",
|
|
755
|
-
`${
|
|
905
|
+
`${u}.axis`
|
|
756
906
|
)
|
|
757
907
|
);
|
|
758
|
-
const
|
|
759
|
-
if (
|
|
908
|
+
const f = d.axis === "column" ? t : i;
|
|
909
|
+
if (d.targetId !== void 0 && !f.has(d.targetId) && n.push(
|
|
760
910
|
a(
|
|
761
911
|
"stable_id_required",
|
|
762
912
|
"Matrix sort targetId must reference an explicit public axis level id.",
|
|
763
|
-
`${
|
|
913
|
+
`${u}.targetId`
|
|
764
914
|
)
|
|
765
|
-
),
|
|
766
|
-
|
|
767
|
-
`${
|
|
915
|
+
), L(
|
|
916
|
+
d.direction,
|
|
917
|
+
`${u}.direction`,
|
|
768
918
|
n,
|
|
769
919
|
"invalid_matrix_sort_direction"
|
|
770
|
-
),
|
|
771
|
-
|
|
772
|
-
`${
|
|
920
|
+
), H(
|
|
921
|
+
d.nulls,
|
|
922
|
+
`${u}.nulls`,
|
|
773
923
|
n,
|
|
774
924
|
"invalid_matrix_sort_nulls"
|
|
775
|
-
),
|
|
776
|
-
|
|
777
|
-
`${
|
|
925
|
+
), U(
|
|
926
|
+
d.scope,
|
|
927
|
+
`${u}.scope`,
|
|
778
928
|
n,
|
|
779
929
|
"invalid_matrix_sort_scope"
|
|
780
|
-
), !
|
|
930
|
+
), !c(d.by)) {
|
|
781
931
|
n.push(
|
|
782
932
|
a(
|
|
783
933
|
"invalid_matrix_sort_by",
|
|
784
934
|
"Matrix sort by must be a structured object.",
|
|
785
|
-
`${
|
|
935
|
+
`${u}.by`
|
|
786
936
|
)
|
|
787
937
|
);
|
|
788
938
|
return;
|
|
789
939
|
}
|
|
790
|
-
if (
|
|
791
|
-
if (
|
|
792
|
-
|
|
940
|
+
if (d.by.kind !== "label") {
|
|
941
|
+
if (d.by.kind === "field") {
|
|
942
|
+
m(d.by.field, `${u}.by.field`, n, {
|
|
793
943
|
required: !0
|
|
794
|
-
}),
|
|
795
|
-
|
|
796
|
-
`${
|
|
944
|
+
}), _(
|
|
945
|
+
d.by.aggregate,
|
|
946
|
+
`${u}.by.aggregate`,
|
|
797
947
|
n
|
|
798
948
|
);
|
|
799
949
|
return;
|
|
800
950
|
}
|
|
801
|
-
if (
|
|
802
|
-
(!
|
|
951
|
+
if (d.by.kind === "value") {
|
|
952
|
+
(!l(d.by.valueId) || !s.has(d.by.valueId)) && n.push(
|
|
803
953
|
a(
|
|
804
954
|
"stable_id_required",
|
|
805
955
|
"Matrix value sort must reference an explicit public value id.",
|
|
806
|
-
`${
|
|
956
|
+
`${u}.by.valueId`
|
|
807
957
|
)
|
|
808
|
-
),
|
|
809
|
-
|
|
810
|
-
`${
|
|
958
|
+
), d.by.rowPath !== void 0 && $(
|
|
959
|
+
d.by.rowPath,
|
|
960
|
+
`${u}.by.rowPath`,
|
|
811
961
|
i,
|
|
812
962
|
n
|
|
813
|
-
),
|
|
814
|
-
|
|
815
|
-
`${
|
|
963
|
+
), d.by.columnPath !== void 0 && $(
|
|
964
|
+
d.by.columnPath,
|
|
965
|
+
`${u}.by.columnPath`,
|
|
816
966
|
t,
|
|
817
967
|
n
|
|
818
968
|
);
|
|
@@ -822,16 +972,16 @@ function me(e, i, t, s, n) {
|
|
|
822
972
|
a(
|
|
823
973
|
"invalid_matrix_sort_by",
|
|
824
974
|
"Matrix sort by must be label, field, or value.",
|
|
825
|
-
`${
|
|
975
|
+
`${u}.by.kind`
|
|
826
976
|
)
|
|
827
977
|
);
|
|
828
978
|
}
|
|
829
979
|
});
|
|
830
980
|
}
|
|
831
981
|
}
|
|
832
|
-
function
|
|
982
|
+
function $e(e, i) {
|
|
833
983
|
if (e !== void 0) {
|
|
834
|
-
if (!
|
|
984
|
+
if (!c(e)) {
|
|
835
985
|
i.push(
|
|
836
986
|
a(
|
|
837
987
|
"invalid_matrix_layout",
|
|
@@ -868,8 +1018,8 @@ function fe(e, i) {
|
|
|
868
1018
|
);
|
|
869
1019
|
}
|
|
870
1020
|
}
|
|
871
|
-
function
|
|
872
|
-
if (!
|
|
1021
|
+
function q(e, i, t) {
|
|
1022
|
+
if (!c(e)) {
|
|
873
1023
|
t.push(
|
|
874
1024
|
a(
|
|
875
1025
|
"invalid_matrix_display_limits",
|
|
@@ -897,7 +1047,7 @@ function j(e, i, t) {
|
|
|
897
1047
|
"Matrix display limit direction must be top or bottom.",
|
|
898
1048
|
`${i}.direction`
|
|
899
1049
|
)
|
|
900
|
-
), e.others !== void 0 && typeof e.others != "boolean" && (
|
|
1050
|
+
), e.others !== void 0 && typeof e.others != "boolean" && (c(e.others) ? e.others.label !== void 0 && typeof e.others.label != "string" && t.push(
|
|
901
1051
|
a(
|
|
902
1052
|
"invalid_matrix_display_limits",
|
|
903
1053
|
"Matrix display limit others label must be a string.",
|
|
@@ -911,9 +1061,9 @@ function j(e, i, t) {
|
|
|
911
1061
|
)
|
|
912
1062
|
));
|
|
913
1063
|
}
|
|
914
|
-
function
|
|
1064
|
+
function Me(e, i) {
|
|
915
1065
|
if (e !== void 0) {
|
|
916
|
-
if (!
|
|
1066
|
+
if (!c(e)) {
|
|
917
1067
|
i.push(
|
|
918
1068
|
a(
|
|
919
1069
|
"invalid_matrix_display_limits",
|
|
@@ -923,71 +1073,71 @@ function pe(e, i) {
|
|
|
923
1073
|
);
|
|
924
1074
|
return;
|
|
925
1075
|
}
|
|
926
|
-
e.rows !== void 0 &&
|
|
1076
|
+
e.rows !== void 0 && q(
|
|
927
1077
|
e.rows,
|
|
928
1078
|
"displayLimits.rows",
|
|
929
1079
|
i
|
|
930
|
-
), e.columns !== void 0 &&
|
|
1080
|
+
), e.columns !== void 0 && q(
|
|
931
1081
|
e.columns,
|
|
932
1082
|
"displayLimits.columns",
|
|
933
1083
|
i
|
|
934
1084
|
);
|
|
935
1085
|
}
|
|
936
1086
|
}
|
|
937
|
-
function
|
|
938
|
-
var
|
|
939
|
-
((
|
|
1087
|
+
function Ae(e, i) {
|
|
1088
|
+
var d;
|
|
1089
|
+
((d = e.source) == null ? void 0 : d.kind) === "sql" && i.push(
|
|
940
1090
|
a(
|
|
941
1091
|
"unsupported_matrix_sql_source",
|
|
942
1092
|
"Matrix analytics intent does not support raw SQL sources.",
|
|
943
1093
|
"source.kind"
|
|
944
1094
|
)
|
|
945
1095
|
);
|
|
946
|
-
const t =
|
|
1096
|
+
const t = E(e.rows, "rows", i, {
|
|
947
1097
|
required: !0
|
|
948
|
-
}), s =
|
|
1098
|
+
}), s = E(e.columns, "columns", i, {
|
|
949
1099
|
required: !1
|
|
950
|
-
}), n =
|
|
951
|
-
|
|
952
|
-
t.map((
|
|
1100
|
+
}), n = ye(e.values, "values", i);
|
|
1101
|
+
h(e.filters, "filters", i), e.totals !== void 0 && he(e.totals, "totals", i), x(
|
|
1102
|
+
t.map((f) => f.id),
|
|
953
1103
|
"rows",
|
|
954
1104
|
"row axis level",
|
|
955
1105
|
i
|
|
956
|
-
),
|
|
957
|
-
s.map((
|
|
1106
|
+
), x(
|
|
1107
|
+
s.map((f) => f.id),
|
|
958
1108
|
"columns",
|
|
959
1109
|
"column axis level",
|
|
960
1110
|
i
|
|
961
|
-
),
|
|
962
|
-
n.map((
|
|
1111
|
+
), x(
|
|
1112
|
+
n.map((f) => f.id),
|
|
963
1113
|
"values",
|
|
964
1114
|
"value",
|
|
965
1115
|
i
|
|
966
1116
|
);
|
|
967
|
-
const
|
|
968
|
-
t.map((
|
|
969
|
-
),
|
|
970
|
-
s.map((
|
|
971
|
-
),
|
|
972
|
-
n.map((
|
|
1117
|
+
const r = new Set(
|
|
1118
|
+
t.map((f) => f.id).filter((f) => l(f))
|
|
1119
|
+
), o = new Set(
|
|
1120
|
+
s.map((f) => f.id).filter((f) => l(f))
|
|
1121
|
+
), u = new Set(
|
|
1122
|
+
n.map((f) => f.id).filter((f) => l(f))
|
|
973
1123
|
);
|
|
974
|
-
|
|
1124
|
+
we(
|
|
975
1125
|
e.sort,
|
|
976
|
-
o,
|
|
977
1126
|
r,
|
|
978
|
-
|
|
1127
|
+
o,
|
|
1128
|
+
u,
|
|
979
1129
|
i
|
|
980
|
-
),
|
|
1130
|
+
), xe(
|
|
981
1131
|
e.expansion,
|
|
982
|
-
o,
|
|
983
1132
|
r,
|
|
1133
|
+
o,
|
|
984
1134
|
i
|
|
985
|
-
),
|
|
1135
|
+
), $e(e.layout, i), Me(e.displayLimits, i);
|
|
986
1136
|
}
|
|
987
|
-
function
|
|
1137
|
+
function ke(e, i) {
|
|
988
1138
|
if (e.analysis === void 0)
|
|
989
1139
|
return;
|
|
990
|
-
if (!
|
|
1140
|
+
if (!c(e.analysis)) {
|
|
991
1141
|
i.push(
|
|
992
1142
|
a(
|
|
993
1143
|
"invalid_metric_analysis",
|
|
@@ -1027,10 +1177,10 @@ function be(e, i) {
|
|
|
1027
1177
|
)
|
|
1028
1178
|
);
|
|
1029
1179
|
const { timeWindow: t } = e.analysis;
|
|
1030
|
-
t !== void 0 &&
|
|
1180
|
+
t !== void 0 && M(t, "analysis.timeWindow", i);
|
|
1031
1181
|
}
|
|
1032
|
-
function
|
|
1033
|
-
if (!
|
|
1182
|
+
function M(e, i, t) {
|
|
1183
|
+
if (!c(e)) {
|
|
1034
1184
|
t.push(
|
|
1035
1185
|
a(
|
|
1036
1186
|
"invalid_time_window",
|
|
@@ -1047,20 +1197,20 @@ function $(e, i, t) {
|
|
|
1047
1197
|
`${i}.kind`
|
|
1048
1198
|
)
|
|
1049
1199
|
), e.kind === "absolute") {
|
|
1050
|
-
if (
|
|
1200
|
+
if (l(e.start) || t.push(
|
|
1051
1201
|
a(
|
|
1052
1202
|
"invalid_time_window",
|
|
1053
1203
|
"Absolute time window start must be a non-empty ISO date or timestamp string.",
|
|
1054
1204
|
`${i}.start`
|
|
1055
1205
|
)
|
|
1056
|
-
),
|
|
1206
|
+
), l(e.end) || t.push(
|
|
1057
1207
|
a(
|
|
1058
1208
|
"invalid_time_window",
|
|
1059
1209
|
"Absolute time window end must be a non-empty ISO date or timestamp string.",
|
|
1060
1210
|
`${i}.end`
|
|
1061
1211
|
)
|
|
1062
|
-
),
|
|
1063
|
-
const s =
|
|
1212
|
+
), l(e.start) && l(e.end)) {
|
|
1213
|
+
const s = R(e.start), n = R(e.end);
|
|
1064
1214
|
s || t.push(
|
|
1065
1215
|
a(
|
|
1066
1216
|
"invalid_time_window",
|
|
@@ -1109,7 +1259,7 @@ function $(e, i, t) {
|
|
|
1109
1259
|
)
|
|
1110
1260
|
);
|
|
1111
1261
|
}
|
|
1112
|
-
function
|
|
1262
|
+
function h(e, i, t) {
|
|
1113
1263
|
if (e !== void 0) {
|
|
1114
1264
|
if (!Array.isArray(e)) {
|
|
1115
1265
|
t.push(
|
|
@@ -1122,91 +1272,287 @@ function M(e, i, t) {
|
|
|
1122
1272
|
return;
|
|
1123
1273
|
}
|
|
1124
1274
|
e.forEach((s, n) => {
|
|
1125
|
-
var
|
|
1126
|
-
const
|
|
1127
|
-
if (!
|
|
1275
|
+
var d;
|
|
1276
|
+
const r = `${i}.${n}`;
|
|
1277
|
+
if (!c(s)) {
|
|
1128
1278
|
t.push(
|
|
1129
1279
|
a(
|
|
1130
1280
|
"invalid_analytics_filter",
|
|
1131
1281
|
"Analytics filter must be a structured object.",
|
|
1132
|
-
|
|
1282
|
+
r
|
|
1133
1283
|
)
|
|
1134
1284
|
);
|
|
1135
1285
|
return;
|
|
1136
1286
|
}
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1287
|
+
const o = s;
|
|
1288
|
+
m(o.field, `${r}.field`, t, {
|
|
1139
1289
|
required: !0
|
|
1140
|
-
}),
|
|
1290
|
+
}), o.scope !== void 0 && o.scope !== "row" && o.scope !== "aggregate" && t.push(
|
|
1141
1291
|
a(
|
|
1142
1292
|
"invalid_analytics_filter_scope",
|
|
1143
1293
|
"Analytics filter scope must be row or aggregate.",
|
|
1144
|
-
`${
|
|
1294
|
+
`${r}.scope`
|
|
1145
1295
|
)
|
|
1146
|
-
),
|
|
1296
|
+
), o.scope === "aggregate" && ((d = o.field) == null ? void 0 : d.role) !== void 0 && o.field.role !== "measure" && t.push(
|
|
1147
1297
|
a(
|
|
1148
1298
|
"invalid_analytics_filter_scope",
|
|
1149
1299
|
"Aggregate-scope analytics filters must target a measure field.",
|
|
1150
|
-
`${
|
|
1300
|
+
`${r}.scope`
|
|
1151
1301
|
)
|
|
1152
1302
|
);
|
|
1153
|
-
const
|
|
1154
|
-
if (
|
|
1303
|
+
const u = o.operator === "is_null" || o.operator === "is_not_null";
|
|
1304
|
+
if (o.operator !== void 0 && o.operator !== "=" && o.operator !== "!=" && o.operator !== "in" && o.operator !== "not_in" && o.operator !== "contains" && o.operator !== "not_contains" && o.operator !== "between" && o.operator !== "not_between" && o.operator !== ">" && o.operator !== ">=" && o.operator !== "<" && o.operator !== "<=" && o.operator !== "is_null" && o.operator !== "is_not_null" && t.push(
|
|
1155
1305
|
a(
|
|
1156
1306
|
"invalid_analytics_filter_operator",
|
|
1157
1307
|
"Analytics filter operator is not supported.",
|
|
1158
|
-
`${
|
|
1308
|
+
`${r}.operator`
|
|
1159
1309
|
)
|
|
1160
|
-
),
|
|
1310
|
+
), o.values === void 0 && !u && t.push(
|
|
1161
1311
|
a(
|
|
1162
1312
|
"missing_analytics_filter_value",
|
|
1163
1313
|
"Analytics filter needs values unless it is a null check.",
|
|
1164
|
-
|
|
1314
|
+
r
|
|
1165
1315
|
)
|
|
1166
|
-
),
|
|
1316
|
+
), u && o.values !== void 0) {
|
|
1167
1317
|
t.push(
|
|
1168
1318
|
a(
|
|
1169
1319
|
"invalid_analytics_filter_values",
|
|
1170
1320
|
"Null-check analytics filters must not include values.",
|
|
1171
|
-
`${
|
|
1321
|
+
`${r}.values`
|
|
1172
1322
|
)
|
|
1173
1323
|
);
|
|
1174
1324
|
return;
|
|
1175
1325
|
}
|
|
1176
|
-
if (
|
|
1326
|
+
if (o.values !== void 0 && !Array.isArray(o.values)) {
|
|
1177
1327
|
t.push(
|
|
1178
1328
|
a(
|
|
1179
1329
|
"invalid_analytics_filter_values",
|
|
1180
1330
|
"Analytics filter values must be an array when provided.",
|
|
1181
|
-
`${
|
|
1331
|
+
`${r}.values`
|
|
1182
1332
|
)
|
|
1183
1333
|
);
|
|
1184
1334
|
return;
|
|
1185
1335
|
}
|
|
1186
|
-
if (
|
|
1187
|
-
const
|
|
1188
|
-
if (
|
|
1189
|
-
|
|
1336
|
+
if (o.values !== void 0) {
|
|
1337
|
+
const f = o.values.length;
|
|
1338
|
+
if (o.operator === "between" || o.operator === "not_between") {
|
|
1339
|
+
f !== 2 && t.push(
|
|
1190
1340
|
a(
|
|
1191
1341
|
"invalid_analytics_filter_values",
|
|
1192
1342
|
"Between analytics filters must include exactly two values.",
|
|
1193
|
-
`${
|
|
1343
|
+
`${r}.values`
|
|
1194
1344
|
)
|
|
1195
1345
|
);
|
|
1196
1346
|
return;
|
|
1197
1347
|
}
|
|
1198
|
-
(
|
|
1348
|
+
(o.operator === "contains" || o.operator === "not_contains" || o.operator === "=" || o.operator === "!=" || o.operator === ">" || o.operator === ">=" || o.operator === "<" || o.operator === "<=" || o.operator === void 0) && f !== 1 && t.push(
|
|
1199
1349
|
a(
|
|
1200
1350
|
"invalid_analytics_filter_values",
|
|
1201
1351
|
"Scalar analytics filters must include exactly one value. Use in/not_in for multiple values.",
|
|
1202
|
-
`${
|
|
1352
|
+
`${r}.values`
|
|
1203
1353
|
)
|
|
1204
1354
|
);
|
|
1205
1355
|
}
|
|
1206
1356
|
});
|
|
1207
1357
|
}
|
|
1208
1358
|
}
|
|
1209
|
-
function
|
|
1359
|
+
function Se(e) {
|
|
1360
|
+
const i = [];
|
|
1361
|
+
if (!c(e))
|
|
1362
|
+
return i.push(
|
|
1363
|
+
a(
|
|
1364
|
+
"invalid_derived_field",
|
|
1365
|
+
"Derived field definition must be a structured object."
|
|
1366
|
+
)
|
|
1367
|
+
), { ok: !1, errors: i, warnings: [] };
|
|
1368
|
+
if (e.kind !== "derived_field" && i.push(
|
|
1369
|
+
a(
|
|
1370
|
+
"invalid_derived_field_kind",
|
|
1371
|
+
"Derived field kind must be derived_field.",
|
|
1372
|
+
"kind"
|
|
1373
|
+
)
|
|
1374
|
+
), l(e.name) || i.push(
|
|
1375
|
+
a("invalid_derived_field_name", "Derived field needs a name.", "name")
|
|
1376
|
+
), l(e.label) || i.push(
|
|
1377
|
+
a(
|
|
1378
|
+
"invalid_derived_field_label",
|
|
1379
|
+
"Derived field needs a label.",
|
|
1380
|
+
"label"
|
|
1381
|
+
)
|
|
1382
|
+
), le.has(e.resultRole) || i.push(
|
|
1383
|
+
a(
|
|
1384
|
+
"invalid_derived_field_role",
|
|
1385
|
+
"Derived field resultRole must be measure, group, date, id, or filter.",
|
|
1386
|
+
"resultRole"
|
|
1387
|
+
)
|
|
1388
|
+
), C.has(e.dataType) || i.push(
|
|
1389
|
+
a(
|
|
1390
|
+
"invalid_derived_field_data_type",
|
|
1391
|
+
"Derived field dataType must be string, number, boolean, date, datetime, or unknown.",
|
|
1392
|
+
"dataType"
|
|
1393
|
+
)
|
|
1394
|
+
), ue.has(e.computeStage) || i.push(
|
|
1395
|
+
a(
|
|
1396
|
+
"invalid_derived_field_compute_stage",
|
|
1397
|
+
"Derived field computeStage must be row or aggregate.",
|
|
1398
|
+
"computeStage"
|
|
1399
|
+
)
|
|
1400
|
+
), e.computeStage === "aggregate" && e.resultRole !== "measure" && i.push(
|
|
1401
|
+
a(
|
|
1402
|
+
"invalid_derived_field_compute_stage",
|
|
1403
|
+
"Aggregate-stage derived fields must have resultRole measure.",
|
|
1404
|
+
"computeStage"
|
|
1405
|
+
)
|
|
1406
|
+
), e.resultRole !== "measure" && e.defaultAggregate !== void 0 && i.push(
|
|
1407
|
+
a(
|
|
1408
|
+
"invalid_derived_field_aggregate",
|
|
1409
|
+
"Only measure derived fields may declare defaultAggregate.",
|
|
1410
|
+
"defaultAggregate"
|
|
1411
|
+
)
|
|
1412
|
+
), e.computeStage === "row" && e.resultRole === "measure" && e.defaultAggregate === void 0 && i.push(
|
|
1413
|
+
a(
|
|
1414
|
+
"missing_derived_field_default_aggregate",
|
|
1415
|
+
"Row-stage measure derived fields must declare defaultAggregate so row results have explicit rollup semantics.",
|
|
1416
|
+
"defaultAggregate"
|
|
1417
|
+
)
|
|
1418
|
+
), _(
|
|
1419
|
+
e.defaultAggregate,
|
|
1420
|
+
"defaultAggregate",
|
|
1421
|
+
i
|
|
1422
|
+
), e.aggregationBehavior !== void 0 && !ce.has(
|
|
1423
|
+
e.aggregationBehavior
|
|
1424
|
+
) && i.push(
|
|
1425
|
+
a(
|
|
1426
|
+
"invalid_derived_field_aggregation_behavior",
|
|
1427
|
+
"Derived field aggregationBehavior is not supported.",
|
|
1428
|
+
"aggregationBehavior"
|
|
1429
|
+
)
|
|
1430
|
+
), e.aggregationStrategy !== void 0 && !fe.has(
|
|
1431
|
+
e.aggregationStrategy
|
|
1432
|
+
) && i.push(
|
|
1433
|
+
a(
|
|
1434
|
+
"invalid_derived_field_aggregation_strategy",
|
|
1435
|
+
"Derived field aggregationStrategy is not supported.",
|
|
1436
|
+
"aggregationStrategy"
|
|
1437
|
+
)
|
|
1438
|
+
), l(e.expression) || i.push(
|
|
1439
|
+
a(
|
|
1440
|
+
"invalid_derived_field_expression",
|
|
1441
|
+
"Derived field needs a named-token expression.",
|
|
1442
|
+
"expression"
|
|
1443
|
+
)
|
|
1444
|
+
), e.expressionLanguage !== void 0 && e.expressionLanguage !== "semaphor_sql_template" && i.push(
|
|
1445
|
+
a(
|
|
1446
|
+
"invalid_derived_field_expression_language",
|
|
1447
|
+
"Derived field expressionLanguage must be semaphor_sql_template.",
|
|
1448
|
+
"expressionLanguage"
|
|
1449
|
+
)
|
|
1450
|
+
), !c(e.inputs) || Object.keys(e.inputs).length === 0 ? i.push(
|
|
1451
|
+
a(
|
|
1452
|
+
"invalid_derived_field_inputs",
|
|
1453
|
+
"Derived field needs at least one typed input.",
|
|
1454
|
+
"inputs"
|
|
1455
|
+
)
|
|
1456
|
+
) : Object.entries(e.inputs).forEach(([t, s]) => {
|
|
1457
|
+
if (!l(t)) {
|
|
1458
|
+
i.push(
|
|
1459
|
+
a(
|
|
1460
|
+
"invalid_derived_field_input_name",
|
|
1461
|
+
"Derived field input names must be non-empty strings.",
|
|
1462
|
+
"inputs"
|
|
1463
|
+
)
|
|
1464
|
+
);
|
|
1465
|
+
return;
|
|
1466
|
+
}
|
|
1467
|
+
me(
|
|
1468
|
+
s,
|
|
1469
|
+
`inputs.${t}`,
|
|
1470
|
+
i
|
|
1471
|
+
);
|
|
1472
|
+
}), l(e.expression) && c(e.inputs)) {
|
|
1473
|
+
const t = re(e.expression), s = new Set(t), n = Object.keys(e.inputs).filter(
|
|
1474
|
+
(r) => l(r)
|
|
1475
|
+
);
|
|
1476
|
+
t.forEach((r) => {
|
|
1477
|
+
Object.prototype.hasOwnProperty.call(e.inputs, r) || i.push(
|
|
1478
|
+
a(
|
|
1479
|
+
"invalid_derived_field_expression_token",
|
|
1480
|
+
`Derived field expression token "{${r}}" needs a matching inputs.${r} entry.`,
|
|
1481
|
+
"expression"
|
|
1482
|
+
)
|
|
1483
|
+
);
|
|
1484
|
+
}), n.forEach((r) => {
|
|
1485
|
+
s.has(r) || i.push(
|
|
1486
|
+
a(
|
|
1487
|
+
"unused_derived_field_input",
|
|
1488
|
+
`Derived field input "${r}" is not referenced by expression.`,
|
|
1489
|
+
`inputs.${r}`
|
|
1490
|
+
)
|
|
1491
|
+
);
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
return e.tags !== void 0 && (!Array.isArray(e.tags) || e.tags.some((t) => !l(t))) && i.push(
|
|
1495
|
+
a(
|
|
1496
|
+
"invalid_derived_field_tags",
|
|
1497
|
+
"Derived field tags must be non-empty strings.",
|
|
1498
|
+
"tags"
|
|
1499
|
+
)
|
|
1500
|
+
), { ok: i.length === 0, errors: i, warnings: [] };
|
|
1501
|
+
}
|
|
1502
|
+
function Ne(e) {
|
|
1503
|
+
const i = [];
|
|
1504
|
+
if (!c(e))
|
|
1505
|
+
return i.push(
|
|
1506
|
+
a(
|
|
1507
|
+
"invalid_result_calculation",
|
|
1508
|
+
"Result calculation must be a structured object."
|
|
1509
|
+
)
|
|
1510
|
+
), { ok: !1, errors: i, warnings: [] };
|
|
1511
|
+
if (l(e.id) || i.push(
|
|
1512
|
+
a("invalid_result_calculation_id", "Result calculation needs an id.", "id")
|
|
1513
|
+
), l(e.label) || i.push(
|
|
1514
|
+
a(
|
|
1515
|
+
"invalid_result_calculation_label",
|
|
1516
|
+
"Result calculation needs a label.",
|
|
1517
|
+
"label"
|
|
1518
|
+
)
|
|
1519
|
+
), e.kind !== "percent_of_total" && e.kind !== "rank" && e.kind !== "running_total" && e.kind !== "previous_row_delta" && i.push(
|
|
1520
|
+
a(
|
|
1521
|
+
"invalid_result_calculation_kind",
|
|
1522
|
+
"Result calculation kind must be percent_of_total, rank, running_total, or previous_row_delta.",
|
|
1523
|
+
"kind"
|
|
1524
|
+
)
|
|
1525
|
+
), T(e.input, "input", i), pe(e.output, "output", i), e.kind === "percent_of_total") {
|
|
1526
|
+
const t = e.denominator;
|
|
1527
|
+
t !== void 0 && (c(t) ? t.scope === "population" ? (m(t.metric, "denominator.metric", i, {
|
|
1528
|
+
required: !0
|
|
1529
|
+
}), h(
|
|
1530
|
+
t.filters,
|
|
1531
|
+
"denominator.filters",
|
|
1532
|
+
i
|
|
1533
|
+
)) : t.scope !== "returned_result" && i.push(
|
|
1534
|
+
a(
|
|
1535
|
+
"invalid_result_calculation_denominator",
|
|
1536
|
+
"Percent-of-total denominator scope must be returned_result or population.",
|
|
1537
|
+
"denominator.scope"
|
|
1538
|
+
)
|
|
1539
|
+
) : i.push(
|
|
1540
|
+
a(
|
|
1541
|
+
"invalid_result_calculation_denominator",
|
|
1542
|
+
"Percent-of-total denominator must be a structured object.",
|
|
1543
|
+
"denominator"
|
|
1544
|
+
)
|
|
1545
|
+
));
|
|
1546
|
+
}
|
|
1547
|
+
return e.kind === "rank" && e.order !== void 0 && e.order !== "asc" && e.order !== "desc" && i.push(
|
|
1548
|
+
a(
|
|
1549
|
+
"invalid_result_calculation_order",
|
|
1550
|
+
"Rank result calculation order must be asc or desc.",
|
|
1551
|
+
"order"
|
|
1552
|
+
)
|
|
1553
|
+
), (e.kind === "running_total" || e.kind === "previous_row_delta") && e.orderBy !== void 0 && T(e.orderBy, "orderBy", i), { ok: i.length === 0, errors: i, warnings: [] };
|
|
1554
|
+
}
|
|
1555
|
+
function G(e) {
|
|
1210
1556
|
var s;
|
|
1211
1557
|
const i = [], t = [];
|
|
1212
1558
|
if (!e || typeof e != "object")
|
|
@@ -1232,9 +1578,9 @@ function U(e) {
|
|
|
1232
1578
|
"Analytics intent version must be 1.",
|
|
1233
1579
|
"version"
|
|
1234
1580
|
)
|
|
1235
|
-
), F(e.source, "source", i), e.kind === "metric") {
|
|
1581
|
+
), F(e.source, "source", i), Ie(e, i), e.kind === "metric") {
|
|
1236
1582
|
const n = Array.isArray(e.metrics) ? e.metrics.filter(
|
|
1237
|
-
(
|
|
1583
|
+
(r) => c(r) && l(r.name)
|
|
1238
1584
|
) : [];
|
|
1239
1585
|
if (!Array.isArray(e.metrics) || e.metrics.length === 0 ? i.push(
|
|
1240
1586
|
a(
|
|
@@ -1243,32 +1589,32 @@ function U(e) {
|
|
|
1243
1589
|
"metrics"
|
|
1244
1590
|
)
|
|
1245
1591
|
) : e.metrics.some(
|
|
1246
|
-
(
|
|
1592
|
+
(r) => !c(r) || !l(r.name)
|
|
1247
1593
|
) && i.push(
|
|
1248
1594
|
a(
|
|
1249
1595
|
"invalid_metric_list",
|
|
1250
1596
|
"Metric intent metrics must be an array of field references with names.",
|
|
1251
1597
|
"metrics"
|
|
1252
1598
|
)
|
|
1253
|
-
), n.forEach((
|
|
1254
|
-
|
|
1599
|
+
), n.forEach((r, o) => {
|
|
1600
|
+
m(r, `metrics.${o}`, i, {
|
|
1255
1601
|
required: !0
|
|
1256
1602
|
});
|
|
1257
|
-
}), n.length > 0 && !
|
|
1258
|
-
const
|
|
1259
|
-
(
|
|
1260
|
-
(
|
|
1603
|
+
}), n.length > 0 && !Y(n)) {
|
|
1604
|
+
const r = n.find(
|
|
1605
|
+
(o, u) => n.some(
|
|
1606
|
+
(d, f) => f !== u && j(d, o)
|
|
1261
1607
|
)
|
|
1262
1608
|
);
|
|
1263
|
-
|
|
1609
|
+
r && i.push(
|
|
1264
1610
|
a(
|
|
1265
1611
|
"duplicate_metric",
|
|
1266
|
-
X(
|
|
1612
|
+
X(r),
|
|
1267
1613
|
"metrics"
|
|
1268
1614
|
)
|
|
1269
1615
|
);
|
|
1270
1616
|
}
|
|
1271
|
-
if (
|
|
1617
|
+
if (c(e.primaryMetric) && l(e.primaryMetric.name) && A(
|
|
1272
1618
|
e.primaryMetric,
|
|
1273
1619
|
n
|
|
1274
1620
|
).length > 1 && i.push(
|
|
@@ -1277,9 +1623,9 @@ function U(e) {
|
|
|
1277
1623
|
"Metric intent primaryMetric must identify exactly one selected metric.",
|
|
1278
1624
|
"primaryMetric"
|
|
1279
1625
|
)
|
|
1280
|
-
), e.primaryMetric !== void 0 && (
|
|
1626
|
+
), e.primaryMetric !== void 0 && (m(e.primaryMetric, "primaryMetric", i, {
|
|
1281
1627
|
required: !0
|
|
1282
|
-
}),
|
|
1628
|
+
}), c(e.primaryMetric) && l(e.primaryMetric.name) && n.length > 0 && !J(
|
|
1283
1629
|
e.primaryMetric,
|
|
1284
1630
|
n
|
|
1285
1631
|
) && i.push(
|
|
@@ -1295,23 +1641,23 @@ function U(e) {
|
|
|
1295
1641
|
"dimensions"
|
|
1296
1642
|
)
|
|
1297
1643
|
) : Array.isArray(e.dimensions) && e.dimensions.some(
|
|
1298
|
-
(
|
|
1644
|
+
(r) => !c(r) || !l(r.name)
|
|
1299
1645
|
) && i.push(
|
|
1300
1646
|
a(
|
|
1301
1647
|
"invalid_metric_dimensions",
|
|
1302
1648
|
"Metric intent dimensions must be an array of field references with names.",
|
|
1303
1649
|
"dimensions"
|
|
1304
1650
|
)
|
|
1305
|
-
), e.dateField !== void 0 &&
|
|
1651
|
+
), e.dateField !== void 0 && m(e.dateField, "dateField", i), e.timeWindow !== void 0 && (M(e.timeWindow, "timeWindow", i), e.dateField || i.push(
|
|
1306
1652
|
a(
|
|
1307
1653
|
"missing_time_window_date_field",
|
|
1308
1654
|
"Metric timeWindow needs a dateField.",
|
|
1309
1655
|
"dateField"
|
|
1310
1656
|
)
|
|
1311
|
-
)),
|
|
1312
|
-
|
|
1657
|
+
)), h(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((r, o) => {
|
|
1658
|
+
m(r, `dimensions.${o}`, i);
|
|
1313
1659
|
}), e.orderBy !== void 0) {
|
|
1314
|
-
if (!
|
|
1660
|
+
if (!c(e.orderBy))
|
|
1315
1661
|
i.push(
|
|
1316
1662
|
a(
|
|
1317
1663
|
"invalid_metric_order_by",
|
|
@@ -1319,7 +1665,7 @@ function U(e) {
|
|
|
1319
1665
|
"orderBy"
|
|
1320
1666
|
)
|
|
1321
1667
|
);
|
|
1322
|
-
else if (
|
|
1668
|
+
else if (m(e.orderBy.field, "orderBy.field", i, {
|
|
1323
1669
|
required: !0
|
|
1324
1670
|
}), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
|
|
1325
1671
|
a(
|
|
@@ -1327,17 +1673,17 @@ function U(e) {
|
|
|
1327
1673
|
"Metric intent orderBy direction must be asc or desc.",
|
|
1328
1674
|
"orderBy.direction"
|
|
1329
1675
|
)
|
|
1330
|
-
),
|
|
1331
|
-
const
|
|
1676
|
+
), c(e.orderBy.field) && l(e.orderBy.field.name)) {
|
|
1677
|
+
const r = [
|
|
1332
1678
|
...n,
|
|
1333
|
-
...e.timeGrain && e.dateField &&
|
|
1679
|
+
...e.timeGrain && e.dateField && c(e.dateField) ? [e.dateField] : [],
|
|
1334
1680
|
...Array.isArray(e.dimensions) ? e.dimensions.filter(
|
|
1335
|
-
(
|
|
1681
|
+
(o) => c(o) && l(o.name)
|
|
1336
1682
|
) : []
|
|
1337
1683
|
];
|
|
1338
|
-
|
|
1684
|
+
r.length > 0 && !W(
|
|
1339
1685
|
e.orderBy.field,
|
|
1340
|
-
|
|
1686
|
+
r
|
|
1341
1687
|
) && i.push(
|
|
1342
1688
|
a(
|
|
1343
1689
|
"invalid_metric_order_by",
|
|
@@ -1347,7 +1693,7 @@ function U(e) {
|
|
|
1347
1693
|
);
|
|
1348
1694
|
}
|
|
1349
1695
|
}
|
|
1350
|
-
|
|
1696
|
+
ke(e, i);
|
|
1351
1697
|
} else e.kind === "records" ? (!Array.isArray(e.fields) || e.fields.length === 0 ? i.push(
|
|
1352
1698
|
a(
|
|
1353
1699
|
"missing_record_fields",
|
|
@@ -1355,30 +1701,30 @@ function U(e) {
|
|
|
1355
1701
|
"fields"
|
|
1356
1702
|
)
|
|
1357
1703
|
) : e.fields.some(
|
|
1358
|
-
(n) => !
|
|
1704
|
+
(n) => !c(n) || !l(n.name)
|
|
1359
1705
|
) && i.push(
|
|
1360
1706
|
a(
|
|
1361
1707
|
"invalid_record_fields",
|
|
1362
1708
|
"Records intent fields must be field references with names.",
|
|
1363
1709
|
"fields"
|
|
1364
1710
|
)
|
|
1365
|
-
), Array.isArray(e.fields) && e.fields.forEach((n,
|
|
1366
|
-
|
|
1367
|
-
}), e.dateField !== void 0 &&
|
|
1711
|
+
), Array.isArray(e.fields) && e.fields.forEach((n, r) => {
|
|
1712
|
+
m(n, `fields.${r}`, i);
|
|
1713
|
+
}), e.dateField !== void 0 && m(e.dateField, "dateField", i), P(e.pagination, "pagination", i), e.timeWindow !== void 0 && (M(e.timeWindow, "timeWindow", i), e.dateField || i.push(
|
|
1368
1714
|
a(
|
|
1369
1715
|
"missing_time_window_date_field",
|
|
1370
1716
|
"Records timeWindow needs a dateField.",
|
|
1371
1717
|
"dateField"
|
|
1372
1718
|
)
|
|
1373
|
-
)),
|
|
1374
|
-
|
|
1719
|
+
)), h(e.filters, "filters", i), Array.isArray(e.filters) && e.filters.forEach((n, r) => {
|
|
1720
|
+
c(n) && n.scope === "aggregate" && i.push(
|
|
1375
1721
|
a(
|
|
1376
1722
|
"unsupported_record_filter_scope",
|
|
1377
1723
|
"Records intents support row-scope filters only. Use a metric intent for aggregate-scope filters.",
|
|
1378
|
-
`filters.${
|
|
1724
|
+
`filters.${r}.scope`
|
|
1379
1725
|
)
|
|
1380
1726
|
);
|
|
1381
|
-
}), e.orderBy !== void 0 && (
|
|
1727
|
+
}), e.orderBy !== void 0 && (c(e.orderBy) ? (m(e.orderBy.field, "orderBy.field", i, {
|
|
1382
1728
|
required: !0
|
|
1383
1729
|
}), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
|
|
1384
1730
|
a(
|
|
@@ -1392,27 +1738,27 @@ function U(e) {
|
|
|
1392
1738
|
"Records intent orderBy must be a structured object.",
|
|
1393
1739
|
"orderBy"
|
|
1394
1740
|
)
|
|
1395
|
-
))) : e.kind === "inputOptions" ? ((!e.field || !
|
|
1741
|
+
))) : e.kind === "inputOptions" ? ((!e.field || !l(e.field.name)) && i.push(
|
|
1396
1742
|
a(
|
|
1397
1743
|
"missing_input_options_field",
|
|
1398
1744
|
"Input options intent needs a field.",
|
|
1399
1745
|
"field"
|
|
1400
1746
|
)
|
|
1401
|
-
),
|
|
1747
|
+
), m(e.field, "field", i, { required: !0 })) : e.kind === "matrix" ? Ae(e, i) : e.kind === "sql" ? (((s = e.source) == null ? void 0 : s.kind) !== "sql" && i.push(
|
|
1402
1748
|
a(
|
|
1403
1749
|
"invalid_sql_source",
|
|
1404
1750
|
"SQL analytics intent must use a SQL execution source.",
|
|
1405
1751
|
"source"
|
|
1406
1752
|
)
|
|
1407
|
-
),
|
|
1753
|
+
), l(e.sql) || i.push(
|
|
1408
1754
|
a("missing_sql", "SQL analytics intent needs SQL text.", "sql")
|
|
1409
|
-
),
|
|
1755
|
+
), Z(
|
|
1410
1756
|
e.defaultParameters,
|
|
1411
1757
|
"defaultParameters",
|
|
1412
1758
|
i
|
|
1413
|
-
), Array.isArray(e.fields) && e.fields.forEach((n,
|
|
1414
|
-
|
|
1415
|
-
}),
|
|
1759
|
+
), Array.isArray(e.fields) && e.fields.forEach((n, r) => {
|
|
1760
|
+
m(n, `fields.${r}`, i);
|
|
1761
|
+
}), P(e.pagination, "pagination", i)) : i.push(
|
|
1416
1762
|
a(
|
|
1417
1763
|
"invalid_analytics_kind",
|
|
1418
1764
|
"Analytics kind is not supported.",
|
|
@@ -1423,10 +1769,34 @@ function U(e) {
|
|
|
1423
1769
|
ok: i.length === 0,
|
|
1424
1770
|
errors: i,
|
|
1425
1771
|
warnings: t,
|
|
1426
|
-
repairHints:
|
|
1772
|
+
repairHints: De(i)
|
|
1427
1773
|
};
|
|
1428
1774
|
}
|
|
1429
|
-
function
|
|
1775
|
+
function Ie(e, i) {
|
|
1776
|
+
if (!(!("derivedFields" in e) || e.derivedFields === void 0)) {
|
|
1777
|
+
if (!Array.isArray(e.derivedFields)) {
|
|
1778
|
+
i.push(
|
|
1779
|
+
a(
|
|
1780
|
+
"invalid_derived_fields",
|
|
1781
|
+
"Analytics intent derivedFields must be an array of derived field definitions.",
|
|
1782
|
+
"derivedFields"
|
|
1783
|
+
)
|
|
1784
|
+
);
|
|
1785
|
+
return;
|
|
1786
|
+
}
|
|
1787
|
+
e.derivedFields.forEach((t, s) => {
|
|
1788
|
+
Se(
|
|
1789
|
+
t
|
|
1790
|
+
).errors.forEach((r) => {
|
|
1791
|
+
i.push({
|
|
1792
|
+
...r,
|
|
1793
|
+
path: r.path ? `derivedFields.${s}.${r.path}` : `derivedFields.${s}`
|
|
1794
|
+
});
|
|
1795
|
+
});
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
function Re(e) {
|
|
1430
1800
|
const i = [], t = [];
|
|
1431
1801
|
if (!e || typeof e != "object")
|
|
1432
1802
|
return {
|
|
@@ -1459,13 +1829,13 @@ function ye(e) {
|
|
|
1459
1829
|
"obligations"
|
|
1460
1830
|
)
|
|
1461
1831
|
) : e.obligations.forEach((s, n) => {
|
|
1462
|
-
|
|
1832
|
+
l(s.id) || i.push(
|
|
1463
1833
|
a(
|
|
1464
1834
|
"missing_obligation_id",
|
|
1465
1835
|
"Each analytics obligation needs an id.",
|
|
1466
1836
|
`obligations.${n}.id`
|
|
1467
1837
|
)
|
|
1468
|
-
),
|
|
1838
|
+
), l(s.prompt) || i.push(
|
|
1469
1839
|
a(
|
|
1470
1840
|
"missing_obligation_prompt",
|
|
1471
1841
|
"Each analytics obligation needs a prompt.",
|
|
@@ -1474,14 +1844,14 @@ function ye(e) {
|
|
|
1474
1844
|
);
|
|
1475
1845
|
});
|
|
1476
1846
|
else if (e.kind === "dashboard_change" || e.kind === "data_app_change") {
|
|
1477
|
-
if (
|
|
1847
|
+
if (l(e.instruction) || i.push(
|
|
1478
1848
|
a(
|
|
1479
1849
|
"missing_instruction",
|
|
1480
1850
|
"Change operation intent needs an instruction.",
|
|
1481
1851
|
"instruction"
|
|
1482
1852
|
)
|
|
1483
1853
|
), e.analyticsIntent) {
|
|
1484
|
-
const s =
|
|
1854
|
+
const s = G(
|
|
1485
1855
|
e.analyticsIntent
|
|
1486
1856
|
);
|
|
1487
1857
|
i.push(...s.errors), t.push(...s.warnings);
|
|
@@ -1498,10 +1868,10 @@ function ye(e) {
|
|
|
1498
1868
|
ok: i.length === 0,
|
|
1499
1869
|
errors: i,
|
|
1500
1870
|
warnings: t,
|
|
1501
|
-
repairHints:
|
|
1871
|
+
repairHints: V(i)
|
|
1502
1872
|
};
|
|
1503
1873
|
}
|
|
1504
|
-
function
|
|
1874
|
+
function qe(e) {
|
|
1505
1875
|
const i = [], t = [];
|
|
1506
1876
|
if (!e || typeof e != "object")
|
|
1507
1877
|
return {
|
|
@@ -1529,7 +1899,7 @@ function we(e) {
|
|
|
1529
1899
|
"kind"
|
|
1530
1900
|
)
|
|
1531
1901
|
);
|
|
1532
|
-
const s =
|
|
1902
|
+
const s = Re(
|
|
1533
1903
|
e.operationIntent
|
|
1534
1904
|
);
|
|
1535
1905
|
return i.push(...s.errors), t.push(...s.warnings), Array.isArray(e.plannedToolCalls) || i.push(
|
|
@@ -1542,16 +1912,16 @@ function we(e) {
|
|
|
1542
1912
|
ok: i.length === 0,
|
|
1543
1913
|
errors: i,
|
|
1544
1914
|
warnings: t,
|
|
1545
|
-
repairHints:
|
|
1915
|
+
repairHints: V(i)
|
|
1546
1916
|
};
|
|
1547
1917
|
}
|
|
1548
|
-
function
|
|
1918
|
+
function V(e) {
|
|
1549
1919
|
return e.map((i) => ({
|
|
1550
1920
|
code: i.code,
|
|
1551
1921
|
recommendedNextStep: i.code === "missing_obligations" ? "Normalize the user request into one or more typed analytics obligations before recovery planning." : "Correct the operation/recovery contract shape before planning execution."
|
|
1552
1922
|
}));
|
|
1553
1923
|
}
|
|
1554
|
-
function
|
|
1924
|
+
function De(e) {
|
|
1555
1925
|
return e.map((i) => {
|
|
1556
1926
|
switch (i.code) {
|
|
1557
1927
|
case "missing_source":
|
|
@@ -1622,14 +1992,14 @@ function ve(e) {
|
|
|
1622
1992
|
}
|
|
1623
1993
|
}).filter((i) => !!i);
|
|
1624
1994
|
}
|
|
1625
|
-
function
|
|
1995
|
+
function Pe(e, i, t, s) {
|
|
1626
1996
|
if (!e || typeof e != "object") {
|
|
1627
1997
|
t.push(
|
|
1628
1998
|
a("invalid_view", "Dashboard view must be an object.", i)
|
|
1629
1999
|
);
|
|
1630
2000
|
return;
|
|
1631
2001
|
}
|
|
1632
|
-
if (
|
|
2002
|
+
if (l(e.title) || t.push(
|
|
1633
2003
|
a("missing_view_title", "Dashboard view needs a title.", i)
|
|
1634
2004
|
), !e.presentation || typeof e.presentation != "object") {
|
|
1635
2005
|
t.push(
|
|
@@ -1642,7 +2012,7 @@ function he(e, i, t, s) {
|
|
|
1642
2012
|
return;
|
|
1643
2013
|
}
|
|
1644
2014
|
if (e.presentation.kind === "text") {
|
|
1645
|
-
|
|
2015
|
+
l(e.text) || s.push(
|
|
1646
2016
|
a(
|
|
1647
2017
|
"missing_text_content",
|
|
1648
2018
|
"Text views should include text content.",
|
|
@@ -1668,25 +2038,25 @@ function he(e, i, t, s) {
|
|
|
1668
2038
|
`${i}.analytics.kind`
|
|
1669
2039
|
)
|
|
1670
2040
|
);
|
|
1671
|
-
const n =
|
|
1672
|
-
for (const
|
|
2041
|
+
const n = G(e.analytics);
|
|
2042
|
+
for (const r of n.errors)
|
|
1673
2043
|
t.push(
|
|
1674
2044
|
a(
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
`${i}.analytics${
|
|
2045
|
+
r.code,
|
|
2046
|
+
r.message,
|
|
2047
|
+
`${i}.analytics${r.path ? `.${r.path}` : ""}`
|
|
1678
2048
|
)
|
|
1679
2049
|
);
|
|
1680
|
-
for (const
|
|
2050
|
+
for (const r of n.warnings)
|
|
1681
2051
|
s.push(
|
|
1682
2052
|
a(
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
`${i}.analytics${
|
|
2053
|
+
r.code,
|
|
2054
|
+
r.message,
|
|
2055
|
+
`${i}.analytics${r.path ? `.${r.path}` : ""}`
|
|
1686
2056
|
)
|
|
1687
2057
|
);
|
|
1688
2058
|
}
|
|
1689
|
-
function
|
|
2059
|
+
function Be(e) {
|
|
1690
2060
|
const i = [], t = [];
|
|
1691
2061
|
if (!e || typeof e != "object")
|
|
1692
2062
|
return {
|
|
@@ -1703,11 +2073,11 @@ function $e(e) {
|
|
|
1703
2073
|
a("invalid_version", "Dashboard intent version must be 1.")
|
|
1704
2074
|
), e.kind !== "dashboard" && i.push(
|
|
1705
2075
|
a("invalid_kind", "Experience intent kind must be dashboard.")
|
|
1706
|
-
),
|
|
2076
|
+
), l(e.title) || i.push(
|
|
1707
2077
|
a("missing_title", "Dashboard intent needs a title.", "title")
|
|
1708
2078
|
);
|
|
1709
|
-
const s = Array.isArray(e.inputs) ? e.inputs : [], n =
|
|
1710
|
-
s.filter(
|
|
2079
|
+
const s = Array.isArray(e.inputs) ? e.inputs : [], n = w(
|
|
2080
|
+
s.filter(c).map((d) => d.id).filter((d) => typeof d == "string")
|
|
1711
2081
|
);
|
|
1712
2082
|
n && i.push(
|
|
1713
2083
|
a(
|
|
@@ -1716,43 +2086,43 @@ function $e(e) {
|
|
|
1716
2086
|
"inputs"
|
|
1717
2087
|
)
|
|
1718
2088
|
);
|
|
1719
|
-
for (const [
|
|
1720
|
-
const p = `inputs.${
|
|
1721
|
-
if (!
|
|
2089
|
+
for (const [d, f] of s.entries()) {
|
|
2090
|
+
const p = `inputs.${d}`;
|
|
2091
|
+
if (!c(f)) {
|
|
1722
2092
|
i.push(
|
|
1723
2093
|
a("invalid_input", "Dashboard input must be an object.", p)
|
|
1724
2094
|
);
|
|
1725
2095
|
continue;
|
|
1726
2096
|
}
|
|
1727
|
-
|
|
2097
|
+
l(f.id) || i.push(
|
|
1728
2098
|
a("missing_input_id", "Input needs an id.", `${p}.id`)
|
|
1729
|
-
),
|
|
2099
|
+
), l(f.label) || i.push(
|
|
1730
2100
|
a("missing_input_label", "Input needs a label.", `${p}.label`)
|
|
1731
|
-
), !
|
|
2101
|
+
), !f.field || !l(f.field.name) ? i.push(
|
|
1732
2102
|
a("missing_input_field", "Input needs a field.", `${p}.field`)
|
|
1733
|
-
) : f
|
|
2103
|
+
) : m(f.field, `${p}.field`, i);
|
|
1734
2104
|
}
|
|
1735
|
-
const
|
|
1736
|
-
|
|
2105
|
+
const r = Array.isArray(e.sections) ? e.sections : [];
|
|
2106
|
+
r.length === 0 && i.push(
|
|
1737
2107
|
a(
|
|
1738
2108
|
"missing_sections",
|
|
1739
2109
|
"Dashboard intent needs at least one section.",
|
|
1740
2110
|
"sections"
|
|
1741
2111
|
)
|
|
1742
2112
|
);
|
|
1743
|
-
const
|
|
1744
|
-
(
|
|
1745
|
-
),
|
|
1746
|
-
|
|
2113
|
+
const o = r.flatMap(
|
|
2114
|
+
(d) => d && typeof d == "object" && Array.isArray(d.views) ? d.views.filter(c).map((f) => f.id).filter((f) => !!f) : []
|
|
2115
|
+
), u = w(o);
|
|
2116
|
+
u && i.push(
|
|
1747
2117
|
a(
|
|
1748
2118
|
"duplicate_view_id",
|
|
1749
|
-
`Duplicate dashboard view id: ${
|
|
2119
|
+
`Duplicate dashboard view id: ${u}.`,
|
|
1750
2120
|
"sections"
|
|
1751
2121
|
)
|
|
1752
2122
|
);
|
|
1753
|
-
for (const [
|
|
1754
|
-
const p = `sections.${
|
|
1755
|
-
if (!
|
|
2123
|
+
for (const [d, f] of r.entries()) {
|
|
2124
|
+
const p = `sections.${d}`;
|
|
2125
|
+
if (!f || typeof f != "object") {
|
|
1756
2126
|
i.push(
|
|
1757
2127
|
a(
|
|
1758
2128
|
"invalid_section",
|
|
@@ -1762,13 +2132,13 @@ function $e(e) {
|
|
|
1762
2132
|
);
|
|
1763
2133
|
continue;
|
|
1764
2134
|
}
|
|
1765
|
-
if (
|
|
2135
|
+
if (l(f.title) || i.push(
|
|
1766
2136
|
a(
|
|
1767
2137
|
"missing_section_title",
|
|
1768
2138
|
"Dashboard section needs a title.",
|
|
1769
2139
|
p
|
|
1770
2140
|
)
|
|
1771
|
-
), !Array.isArray(
|
|
2141
|
+
), !Array.isArray(f.views) || f.views.length === 0) {
|
|
1772
2142
|
i.push(
|
|
1773
2143
|
a(
|
|
1774
2144
|
"missing_section_views",
|
|
@@ -1778,10 +2148,10 @@ function $e(e) {
|
|
|
1778
2148
|
);
|
|
1779
2149
|
continue;
|
|
1780
2150
|
}
|
|
1781
|
-
for (const [
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
`${p}.views.${
|
|
2151
|
+
for (const [b, y] of f.views.entries())
|
|
2152
|
+
Pe(
|
|
2153
|
+
y,
|
|
2154
|
+
`${p}.views.${b}`,
|
|
1785
2155
|
i,
|
|
1786
2156
|
t
|
|
1787
2157
|
);
|
|
@@ -1789,11 +2159,13 @@ function $e(e) {
|
|
|
1789
2159
|
return { ok: i.length === 0, errors: i, warnings: t };
|
|
1790
2160
|
}
|
|
1791
2161
|
export {
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
2162
|
+
Q as a,
|
|
2163
|
+
Ne as b,
|
|
2164
|
+
G as c,
|
|
2165
|
+
Re as d,
|
|
2166
|
+
qe as e,
|
|
2167
|
+
Be as f,
|
|
2168
|
+
Ee as n,
|
|
2169
|
+
R as p,
|
|
2170
|
+
Se as v
|
|
1799
2171
|
};
|