react-semaphor 0.1.365 → 0.1.367
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 +26 -24
- package/dist/chunks/{calendar-preferences-dialog-CgBwWqfY.js → calendar-preferences-dialog-BOFlzOJg.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CK_6KGFV.js → dashboard-briefing-launcher-D2lBFqAd.js} +3 -3
- package/dist/chunks/{dashboard-controls-CsIEj0Vm.js → dashboard-controls-BIk094Ah.js} +3 -3
- package/dist/chunks/{dashboard-json-OhYs9GOx.js → dashboard-json-DImOf512.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-q_XG4oWg.js → edit-dashboard-visual-DTxkV6Fl.js} +3 -3
- package/dist/chunks/{index-Ds3_EAla.js → index-BVEIk-rB.js} +5 -5
- package/dist/chunks/{resource-management-panel-CYXyE2js.js → resource-management-panel-BOfbSf48.js} +2 -2
- package/dist/chunks/{source-identity-qAmkNtEK.js → source-identity-Dj3dryN9.js} +3 -3
- package/dist/chunks/{use-create-flow-overlay-state-CRQcqLs3.js → use-create-flow-overlay-state-B5FygfQL.js} +2 -2
- package/dist/chunks/{use-visual-utils-CpZplRpR.js → use-visual-utils-CszWnFBW.js} +1 -1
- package/dist/chunks/{validation-B4_hBuYu.js → validation-CrUjNWby.js} +115 -94
- package/dist/chunks/validation-DGl8wnTt.js +1 -0
- package/dist/chunks/validators-Dq5X4mp0.js +1 -0
- package/dist/chunks/{validators-BnLhuIhd.js → validators-L0xEXtjf.js} +279 -212
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +288 -280
- 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 +400 -271
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +3 -3
- package/dist/index.js +5 -5
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +12 -2
- package/dist/types/dashboard-assistant.d.ts +3 -1
- package/dist/types/dashboard-authoring.d.ts +8 -2
- package/dist/types/data-app-builder.d.ts +3 -1
- package/dist/types/data-app-sdk-validation.d.ts +5 -1
- package/dist/types/data-app-sdk.d.ts +25 -6
- package/dist/types/main.d.ts +3 -1
- package/package.json +1 -1
- package/dist/chunks/validation-CsK42Vbq.js +0 -1
- package/dist/chunks/validators-Cu_w8ZEP.js +0 -1
|
@@ -1,81 +1,132 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
|
|
1
|
+
import { b as T } from "./source-identity-Dj3dryN9.js";
|
|
2
|
+
function W(e) {
|
|
3
|
+
const i = D(e);
|
|
4
|
+
return k(i) ? i : void 0;
|
|
4
5
|
}
|
|
5
|
-
function
|
|
6
|
+
function D(e) {
|
|
7
|
+
if (typeof e != "string" || e.trim().length === 0)
|
|
8
|
+
return;
|
|
9
|
+
const i = e.trim().toLowerCase().replace(/_/g, " ");
|
|
10
|
+
switch (i) {
|
|
11
|
+
case "eq":
|
|
12
|
+
case "equals":
|
|
13
|
+
case "=":
|
|
14
|
+
return "=";
|
|
15
|
+
case "neq":
|
|
16
|
+
case "not equals":
|
|
17
|
+
case "not equal":
|
|
18
|
+
case "!=":
|
|
19
|
+
return "!=";
|
|
20
|
+
case "in":
|
|
21
|
+
return "in";
|
|
22
|
+
case "not in":
|
|
23
|
+
return "not_in";
|
|
24
|
+
case "contains":
|
|
25
|
+
case "like":
|
|
26
|
+
return "contains";
|
|
27
|
+
case "not contains":
|
|
28
|
+
case "not like":
|
|
29
|
+
return "not_contains";
|
|
30
|
+
case "between":
|
|
31
|
+
return "between";
|
|
32
|
+
case "not between":
|
|
33
|
+
return "not_between";
|
|
34
|
+
case ">":
|
|
35
|
+
case ">=":
|
|
36
|
+
case "<":
|
|
37
|
+
case "<=":
|
|
38
|
+
return i;
|
|
39
|
+
case "is null":
|
|
40
|
+
return "is_null";
|
|
41
|
+
case "is not null":
|
|
42
|
+
return "is_not_null";
|
|
43
|
+
default:
|
|
44
|
+
return O(e) ? e : void 0;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function k(e) {
|
|
48
|
+
return e === "=" || e === "!=" || e === "in" || e === "not_in" || e === "contains" || e === "not_contains" || e === "between" || e === "not_between" || e === ">" || e === ">=" || e === "<" || e === "<=";
|
|
49
|
+
}
|
|
50
|
+
function O(e) {
|
|
51
|
+
return k(e) || e === "not_contains" || e === "is_null" || e === "is_not_null";
|
|
52
|
+
}
|
|
53
|
+
function t(e, i, n) {
|
|
54
|
+
return n ? { code: e, message: i, path: n } : { code: e, message: i };
|
|
55
|
+
}
|
|
56
|
+
function q(e) {
|
|
6
57
|
for (let i = 0; i < e.length; i += 1) {
|
|
7
|
-
const
|
|
58
|
+
const n = e[i];
|
|
8
59
|
if (e.some(
|
|
9
|
-
(
|
|
60
|
+
(o, a) => a !== i && B(o, n)
|
|
10
61
|
))
|
|
11
62
|
return !1;
|
|
12
63
|
}
|
|
13
64
|
return !0;
|
|
14
65
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
66
|
+
function N(e, i) {
|
|
67
|
+
return T(e, i);
|
|
17
68
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
69
|
+
function B(e, i) {
|
|
70
|
+
return N(e, i) && y(e) === y(i);
|
|
20
71
|
}
|
|
21
|
-
function
|
|
72
|
+
function j(e) {
|
|
22
73
|
return `Metric intent has duplicate metric "${e.name}" with the same aggregate (${y(e)}). Use different aggregates to request both, or remove one entry.`;
|
|
23
74
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
75
|
+
function C(e, i) {
|
|
76
|
+
return b(e, i).length === 1;
|
|
26
77
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
78
|
+
function E(e, i) {
|
|
79
|
+
return b(e, i).length === 1;
|
|
29
80
|
}
|
|
30
|
-
function
|
|
81
|
+
function b(e, i) {
|
|
31
82
|
return i.filter(
|
|
32
|
-
(
|
|
83
|
+
(o) => U(e, o)
|
|
33
84
|
);
|
|
34
85
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
86
|
+
function U(e, i) {
|
|
87
|
+
return P(e, i) ? e.source ? N(i, e) : !0 : !1;
|
|
37
88
|
}
|
|
38
|
-
function
|
|
39
|
-
return !(i.name !== e.name || e.role !== void 0 && i.role !== void 0 && i.role !== e.role ||
|
|
89
|
+
function P(e, i) {
|
|
90
|
+
return !(i.name !== e.name || e.role !== void 0 && i.role !== void 0 && i.role !== e.role || G(e, i) && y(i) !== y(e));
|
|
40
91
|
}
|
|
41
|
-
function
|
|
92
|
+
function G(e, i) {
|
|
42
93
|
return e.role === "measure" || i.role === "measure" || e.aggregate !== void 0 || i.aggregate !== void 0;
|
|
43
94
|
}
|
|
44
95
|
function y(e) {
|
|
45
96
|
return (e.aggregate || "SUM").toUpperCase();
|
|
46
97
|
}
|
|
47
|
-
const
|
|
48
|
-
function
|
|
98
|
+
const L = /^(\d{4})-(\d{2})-(\d{2})$/, H = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;
|
|
99
|
+
function $(e) {
|
|
49
100
|
if (typeof e != "string")
|
|
50
101
|
return null;
|
|
51
|
-
const i = e.trim(),
|
|
52
|
-
if (
|
|
53
|
-
const [,
|
|
54
|
-
return M(
|
|
55
|
-
Date.UTC(Number(
|
|
102
|
+
const i = e.trim(), n = L.exec(i);
|
|
103
|
+
if (n) {
|
|
104
|
+
const [, g, w, A] = n;
|
|
105
|
+
return M(g, w, A) ? new Date(
|
|
106
|
+
Date.UTC(Number(g), Number(w) - 1, Number(A))
|
|
56
107
|
) : null;
|
|
57
108
|
}
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
109
|
+
const o = H.exec(i);
|
|
110
|
+
if (!o)
|
|
60
111
|
return null;
|
|
61
|
-
const [,
|
|
62
|
-
if (!M(
|
|
112
|
+
const [, a, r, s, m, c, l = "00", , f] = o;
|
|
113
|
+
if (!M(a, r, s) || !_(m, 0, 23) || !_(c, 0, 59) || !_(l, 0, 59) || !V(f))
|
|
63
114
|
return null;
|
|
64
115
|
const h = new Date(i);
|
|
65
116
|
return Number.isFinite(h.getTime()) ? h : null;
|
|
66
117
|
}
|
|
67
|
-
function M(e, i,
|
|
68
|
-
const
|
|
69
|
-
if (!Number.isInteger(
|
|
118
|
+
function M(e, i, n) {
|
|
119
|
+
const o = Number(e), a = Number(i), r = Number(n);
|
|
120
|
+
if (!Number.isInteger(o) || !Number.isInteger(a) || !Number.isInteger(r) || a < 1 || a > 12)
|
|
70
121
|
return !1;
|
|
71
|
-
const
|
|
72
|
-
return
|
|
122
|
+
const s = new Date(Date.UTC(o, a - 1, r));
|
|
123
|
+
return s.getUTCFullYear() === o && s.getUTCMonth() === a - 1 && s.getUTCDate() === r;
|
|
73
124
|
}
|
|
74
|
-
function _(e, i,
|
|
75
|
-
const
|
|
76
|
-
return Number.isInteger(
|
|
125
|
+
function _(e, i, n) {
|
|
126
|
+
const o = Number(e);
|
|
127
|
+
return Number.isInteger(o) && o >= i && o <= n;
|
|
77
128
|
}
|
|
78
|
-
function
|
|
129
|
+
function V(e) {
|
|
79
130
|
if (e === "Z")
|
|
80
131
|
return !0;
|
|
81
132
|
const i = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
@@ -87,16 +138,16 @@ function d(e) {
|
|
|
87
138
|
function u(e) {
|
|
88
139
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
89
140
|
}
|
|
90
|
-
function
|
|
141
|
+
function I(e) {
|
|
91
142
|
const i = /* @__PURE__ */ new Set();
|
|
92
|
-
for (const
|
|
93
|
-
if (i.has(
|
|
94
|
-
return
|
|
95
|
-
i.add(
|
|
143
|
+
for (const n of e) {
|
|
144
|
+
if (i.has(n))
|
|
145
|
+
return n;
|
|
146
|
+
i.add(n);
|
|
96
147
|
}
|
|
97
148
|
return null;
|
|
98
149
|
}
|
|
99
|
-
const
|
|
150
|
+
const Q = /* @__PURE__ */ new Set([
|
|
100
151
|
"SUM",
|
|
101
152
|
"COUNT",
|
|
102
153
|
"AVG",
|
|
@@ -105,19 +156,19 @@ const G = /* @__PURE__ */ new Set([
|
|
|
105
156
|
"MEDIAN",
|
|
106
157
|
"DISTINCT"
|
|
107
158
|
]);
|
|
108
|
-
function
|
|
159
|
+
function x(e, i, n) {
|
|
109
160
|
if (!e || typeof e != "object") {
|
|
110
|
-
|
|
161
|
+
n.push(t("missing_source", "Analytics intent needs a source.", i));
|
|
111
162
|
return;
|
|
112
163
|
}
|
|
113
164
|
if (e.kind === "semantic") {
|
|
114
|
-
d(e.domainId) ||
|
|
165
|
+
d(e.domainId) || n.push(
|
|
115
166
|
t(
|
|
116
167
|
"missing_semantic_domain",
|
|
117
168
|
"Semantic source needs a domainId.",
|
|
118
169
|
`${i}.domainId`
|
|
119
170
|
)
|
|
120
|
-
), d(e.datasetName) ||
|
|
171
|
+
), d(e.datasetName) || n.push(
|
|
121
172
|
t(
|
|
122
173
|
"missing_dataset_name",
|
|
123
174
|
"Semantic source needs a datasetName.",
|
|
@@ -127,13 +178,13 @@ function k(e, i, s) {
|
|
|
127
178
|
return;
|
|
128
179
|
}
|
|
129
180
|
if (e.kind === "physical") {
|
|
130
|
-
d(e.connectionId) ||
|
|
181
|
+
d(e.connectionId) || n.push(
|
|
131
182
|
t(
|
|
132
183
|
"missing_connection_id",
|
|
133
184
|
"Physical source needs a connectionId.",
|
|
134
185
|
`${i}.connectionId`
|
|
135
186
|
)
|
|
136
|
-
), d(e.tableName) ||
|
|
187
|
+
), d(e.tableName) || n.push(
|
|
137
188
|
t(
|
|
138
189
|
"missing_table_name",
|
|
139
190
|
"Physical source needs a tableName.",
|
|
@@ -143,7 +194,7 @@ function k(e, i, s) {
|
|
|
143
194
|
return;
|
|
144
195
|
}
|
|
145
196
|
if (e.kind === "sql") {
|
|
146
|
-
d(e.connectionId) ||
|
|
197
|
+
d(e.connectionId) || n.push(
|
|
147
198
|
t(
|
|
148
199
|
"missing_connection_id",
|
|
149
200
|
"SQL source needs a connectionId.",
|
|
@@ -152,21 +203,21 @@ function k(e, i, s) {
|
|
|
152
203
|
);
|
|
153
204
|
return;
|
|
154
205
|
}
|
|
155
|
-
|
|
206
|
+
n.push(t("invalid_source_kind", "Source kind is not supported.", i));
|
|
156
207
|
}
|
|
157
|
-
function
|
|
208
|
+
function p(e, i, n, o = {}) {
|
|
158
209
|
if (!e || !u(e)) {
|
|
159
|
-
|
|
210
|
+
o.required && n.push(
|
|
160
211
|
t("missing_field_ref", "Field reference needs a name.", i)
|
|
161
212
|
);
|
|
162
213
|
return;
|
|
163
214
|
}
|
|
164
|
-
d(e.name) ||
|
|
215
|
+
d(e.name) || n.push(
|
|
165
216
|
t("missing_field_ref", "Field reference needs a name.", `${i}.name`)
|
|
166
|
-
), e.source !== void 0 &&
|
|
217
|
+
), e.source !== void 0 && x(e.source, `${i}.source`, n), z(e.aggregate, `${i}.aggregate`, n);
|
|
167
218
|
}
|
|
168
|
-
function
|
|
169
|
-
e !== void 0 && (typeof e != "string" || !
|
|
219
|
+
function z(e, i, n) {
|
|
220
|
+
e !== void 0 && (typeof e != "string" || !Q.has(e)) && n.push(
|
|
170
221
|
t(
|
|
171
222
|
"invalid_aggregate",
|
|
172
223
|
"Field aggregate must be SUM, COUNT, AVG, MIN, MAX, MEDIAN, or DISTINCT.",
|
|
@@ -174,7 +225,7 @@ function H(e, i, s) {
|
|
|
174
225
|
)
|
|
175
226
|
);
|
|
176
227
|
}
|
|
177
|
-
function
|
|
228
|
+
function X(e, i) {
|
|
178
229
|
if (e.analysis === void 0)
|
|
179
230
|
return;
|
|
180
231
|
if (!u(e.analysis)) {
|
|
@@ -216,12 +267,12 @@ function L(e, i) {
|
|
|
216
267
|
"analysis.orderBy"
|
|
217
268
|
)
|
|
218
269
|
);
|
|
219
|
-
const { timeWindow:
|
|
220
|
-
|
|
270
|
+
const { timeWindow: n } = e.analysis;
|
|
271
|
+
n !== void 0 && v(n, "analysis.timeWindow", i);
|
|
221
272
|
}
|
|
222
|
-
function
|
|
273
|
+
function v(e, i, n) {
|
|
223
274
|
if (!u(e)) {
|
|
224
|
-
|
|
275
|
+
n.push(
|
|
225
276
|
t(
|
|
226
277
|
"invalid_time_window",
|
|
227
278
|
"Time window must be a structured object.",
|
|
@@ -230,40 +281,40 @@ function N(e, i, s) {
|
|
|
230
281
|
);
|
|
231
282
|
return;
|
|
232
283
|
}
|
|
233
|
-
if (e.kind !== void 0 && e.kind !== "relative" && e.kind !== "absolute" &&
|
|
284
|
+
if (e.kind !== void 0 && e.kind !== "relative" && e.kind !== "absolute" && n.push(
|
|
234
285
|
t(
|
|
235
286
|
"invalid_time_window",
|
|
236
287
|
"Time window kind must be relative or absolute.",
|
|
237
288
|
`${i}.kind`
|
|
238
289
|
)
|
|
239
290
|
), e.kind === "absolute") {
|
|
240
|
-
if (d(e.start) ||
|
|
291
|
+
if (d(e.start) || n.push(
|
|
241
292
|
t(
|
|
242
293
|
"invalid_time_window",
|
|
243
294
|
"Absolute time window start must be a non-empty ISO date or timestamp string.",
|
|
244
295
|
`${i}.start`
|
|
245
296
|
)
|
|
246
|
-
), d(e.end) ||
|
|
297
|
+
), d(e.end) || n.push(
|
|
247
298
|
t(
|
|
248
299
|
"invalid_time_window",
|
|
249
300
|
"Absolute time window end must be a non-empty ISO date or timestamp string.",
|
|
250
301
|
`${i}.end`
|
|
251
302
|
)
|
|
252
303
|
), d(e.start) && d(e.end)) {
|
|
253
|
-
const
|
|
254
|
-
|
|
304
|
+
const o = $(e.start), a = $(e.end);
|
|
305
|
+
o || n.push(
|
|
255
306
|
t(
|
|
256
307
|
"invalid_time_window",
|
|
257
308
|
"Absolute time window start must be a valid ISO date or timestamp.",
|
|
258
309
|
`${i}.start`
|
|
259
310
|
)
|
|
260
|
-
),
|
|
311
|
+
), a || n.push(
|
|
261
312
|
t(
|
|
262
313
|
"invalid_time_window",
|
|
263
314
|
"Absolute time window end must be a valid ISO date or timestamp.",
|
|
264
315
|
`${i}.end`
|
|
265
316
|
)
|
|
266
|
-
),
|
|
317
|
+
), o && a && o.getTime() > a.getTime() && n.push(
|
|
267
318
|
t(
|
|
268
319
|
"invalid_time_window",
|
|
269
320
|
"Absolute time window start must be before or equal to end.",
|
|
@@ -273,25 +324,25 @@ function N(e, i, s) {
|
|
|
273
324
|
}
|
|
274
325
|
return;
|
|
275
326
|
}
|
|
276
|
-
e.unit !== "second" && e.unit !== "minute" && e.unit !== "hour" && e.unit !== "day" && e.unit !== "week" && e.unit !== "month" && e.unit !== "quarter" && e.unit !== "year" &&
|
|
327
|
+
e.unit !== "second" && e.unit !== "minute" && e.unit !== "hour" && e.unit !== "day" && e.unit !== "week" && e.unit !== "month" && e.unit !== "quarter" && e.unit !== "year" && n.push(
|
|
277
328
|
t(
|
|
278
329
|
"invalid_time_window",
|
|
279
330
|
"Time window unit must be second, minute, hour, day, week, month, quarter, or year.",
|
|
280
331
|
`${i}.unit`
|
|
281
332
|
)
|
|
282
|
-
), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) &&
|
|
333
|
+
), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && n.push(
|
|
283
334
|
t(
|
|
284
335
|
"invalid_time_window",
|
|
285
336
|
"Time window value must be a positive number.",
|
|
286
337
|
`${i}.value`
|
|
287
338
|
)
|
|
288
|
-
), e.anchor !== void 0 && e.anchor !== "now" && e.anchor !== "latest_available" &&
|
|
339
|
+
), e.anchor !== void 0 && e.anchor !== "now" && e.anchor !== "latest_available" && n.push(
|
|
289
340
|
t(
|
|
290
341
|
"invalid_time_window",
|
|
291
342
|
"Time window anchor must be now or latest_available.",
|
|
292
343
|
`${i}.anchor`
|
|
293
344
|
)
|
|
294
|
-
), e.completeness !== void 0 && e.completeness !== "include_partial" && e.completeness !== "complete_periods" &&
|
|
345
|
+
), e.completeness !== void 0 && e.completeness !== "include_partial" && e.completeness !== "complete_periods" && n.push(
|
|
295
346
|
t(
|
|
296
347
|
"invalid_time_window",
|
|
297
348
|
"Time window completeness must be include_partial or complete_periods.",
|
|
@@ -299,10 +350,10 @@ function N(e, i, s) {
|
|
|
299
350
|
)
|
|
300
351
|
);
|
|
301
352
|
}
|
|
302
|
-
function
|
|
353
|
+
function S(e, i, n) {
|
|
303
354
|
if (e !== void 0) {
|
|
304
355
|
if (!Array.isArray(e)) {
|
|
305
|
-
|
|
356
|
+
n.push(
|
|
306
357
|
t(
|
|
307
358
|
"invalid_analytics_filters",
|
|
308
359
|
"Analytics filters must be an array.",
|
|
@@ -311,94 +362,94 @@ function V(e, i, s) {
|
|
|
311
362
|
);
|
|
312
363
|
return;
|
|
313
364
|
}
|
|
314
|
-
e.forEach((
|
|
365
|
+
e.forEach((o, a) => {
|
|
315
366
|
var c;
|
|
316
|
-
const
|
|
317
|
-
if (!u(
|
|
318
|
-
|
|
367
|
+
const r = `${i}.${a}`;
|
|
368
|
+
if (!u(o)) {
|
|
369
|
+
n.push(
|
|
319
370
|
t(
|
|
320
371
|
"invalid_analytics_filter",
|
|
321
372
|
"Analytics filter must be a structured object.",
|
|
322
|
-
|
|
373
|
+
r
|
|
323
374
|
)
|
|
324
375
|
);
|
|
325
376
|
return;
|
|
326
377
|
}
|
|
327
|
-
const
|
|
328
|
-
|
|
378
|
+
const s = o;
|
|
379
|
+
p(s.field, `${r}.field`, n, {
|
|
329
380
|
required: !0
|
|
330
|
-
}),
|
|
381
|
+
}), s.scope !== void 0 && s.scope !== "row" && s.scope !== "aggregate" && n.push(
|
|
331
382
|
t(
|
|
332
383
|
"invalid_analytics_filter_scope",
|
|
333
384
|
"Analytics filter scope must be row or aggregate.",
|
|
334
|
-
`${
|
|
385
|
+
`${r}.scope`
|
|
335
386
|
)
|
|
336
|
-
),
|
|
387
|
+
), s.scope === "aggregate" && ((c = s.field) == null ? void 0 : c.role) !== void 0 && s.field.role !== "measure" && n.push(
|
|
337
388
|
t(
|
|
338
389
|
"invalid_analytics_filter_scope",
|
|
339
390
|
"Aggregate-scope analytics filters must target a measure field.",
|
|
340
|
-
`${
|
|
391
|
+
`${r}.scope`
|
|
341
392
|
)
|
|
342
393
|
);
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
394
|
+
const m = s.operator === "is_null" || s.operator === "is_not_null";
|
|
395
|
+
if (s.operator !== void 0 && s.operator !== "=" && s.operator !== "!=" && s.operator !== "in" && s.operator !== "not_in" && s.operator !== "contains" && s.operator !== "not_contains" && s.operator !== "between" && s.operator !== "not_between" && s.operator !== ">" && s.operator !== ">=" && s.operator !== "<" && s.operator !== "<=" && s.operator !== "is_null" && s.operator !== "is_not_null" && n.push(
|
|
345
396
|
t(
|
|
346
397
|
"invalid_analytics_filter_operator",
|
|
347
398
|
"Analytics filter operator is not supported.",
|
|
348
|
-
`${
|
|
399
|
+
`${r}.operator`
|
|
349
400
|
)
|
|
350
|
-
),
|
|
401
|
+
), s.values === void 0 && !m && n.push(
|
|
351
402
|
t(
|
|
352
403
|
"missing_analytics_filter_value",
|
|
353
404
|
"Analytics filter needs values unless it is a null check.",
|
|
354
|
-
|
|
405
|
+
r
|
|
355
406
|
)
|
|
356
|
-
),
|
|
357
|
-
|
|
407
|
+
), m && s.values !== void 0) {
|
|
408
|
+
n.push(
|
|
358
409
|
t(
|
|
359
410
|
"invalid_analytics_filter_values",
|
|
360
411
|
"Null-check analytics filters must not include values.",
|
|
361
|
-
`${
|
|
412
|
+
`${r}.values`
|
|
362
413
|
)
|
|
363
414
|
);
|
|
364
415
|
return;
|
|
365
416
|
}
|
|
366
|
-
if (
|
|
367
|
-
|
|
417
|
+
if (s.values !== void 0 && !Array.isArray(s.values)) {
|
|
418
|
+
n.push(
|
|
368
419
|
t(
|
|
369
420
|
"invalid_analytics_filter_values",
|
|
370
421
|
"Analytics filter values must be an array when provided.",
|
|
371
|
-
`${
|
|
422
|
+
`${r}.values`
|
|
372
423
|
)
|
|
373
424
|
);
|
|
374
425
|
return;
|
|
375
426
|
}
|
|
376
|
-
if (
|
|
377
|
-
const l =
|
|
378
|
-
if (
|
|
379
|
-
l !== 2 &&
|
|
427
|
+
if (s.values !== void 0) {
|
|
428
|
+
const l = s.values.length;
|
|
429
|
+
if (s.operator === "between" || s.operator === "not_between") {
|
|
430
|
+
l !== 2 && n.push(
|
|
380
431
|
t(
|
|
381
432
|
"invalid_analytics_filter_values",
|
|
382
433
|
"Between analytics filters must include exactly two values.",
|
|
383
|
-
`${
|
|
434
|
+
`${r}.values`
|
|
384
435
|
)
|
|
385
436
|
);
|
|
386
437
|
return;
|
|
387
438
|
}
|
|
388
|
-
(
|
|
439
|
+
(s.operator === "contains" || s.operator === "not_contains" || s.operator === "=" || s.operator === "!=" || s.operator === ">" || s.operator === ">=" || s.operator === "<" || s.operator === "<=" || s.operator === void 0) && l !== 1 && n.push(
|
|
389
440
|
t(
|
|
390
441
|
"invalid_analytics_filter_values",
|
|
391
442
|
"Scalar analytics filters must include exactly one value. Use in/not_in for multiple values.",
|
|
392
|
-
`${
|
|
443
|
+
`${r}.values`
|
|
393
444
|
)
|
|
394
445
|
);
|
|
395
446
|
}
|
|
396
447
|
});
|
|
397
448
|
}
|
|
398
449
|
}
|
|
399
|
-
function
|
|
400
|
-
var
|
|
401
|
-
const i = [],
|
|
450
|
+
function F(e) {
|
|
451
|
+
var o;
|
|
452
|
+
const i = [], n = [];
|
|
402
453
|
if (!e || typeof e != "object")
|
|
403
454
|
return {
|
|
404
455
|
ok: !1,
|
|
@@ -408,7 +459,7 @@ function B(e) {
|
|
|
408
459
|
"Analytics intent must be a structured object."
|
|
409
460
|
)
|
|
410
461
|
],
|
|
411
|
-
warnings:
|
|
462
|
+
warnings: n,
|
|
412
463
|
repairHints: [
|
|
413
464
|
{
|
|
414
465
|
code: "invalid_analytics_intent",
|
|
@@ -418,52 +469,52 @@ function B(e) {
|
|
|
418
469
|
};
|
|
419
470
|
if (e.version !== void 0 && e.version !== 1 && i.push(
|
|
420
471
|
t("invalid_version", "Analytics intent version must be 1.", "version")
|
|
421
|
-
),
|
|
422
|
-
const
|
|
423
|
-
(
|
|
472
|
+
), x(e.source, "source", i), e.kind === "metric") {
|
|
473
|
+
const a = Array.isArray(e.metrics) ? e.metrics.filter(
|
|
474
|
+
(r) => u(r) && d(r.name)
|
|
424
475
|
) : [];
|
|
425
476
|
if (!Array.isArray(e.metrics) || e.metrics.length === 0 ? i.push(
|
|
426
477
|
t("missing_metric", "Metric intent needs at least one metric.", "metrics")
|
|
427
478
|
) : e.metrics.some(
|
|
428
|
-
(
|
|
479
|
+
(r) => !u(r) || !d(r.name)
|
|
429
480
|
) && i.push(
|
|
430
481
|
t(
|
|
431
482
|
"invalid_metric_list",
|
|
432
483
|
"Metric intent metrics must be an array of field references with names.",
|
|
433
484
|
"metrics"
|
|
434
485
|
)
|
|
435
|
-
),
|
|
436
|
-
|
|
486
|
+
), a.forEach((r, s) => {
|
|
487
|
+
p(r, `metrics.${s}`, i, {
|
|
437
488
|
required: !0
|
|
438
489
|
});
|
|
439
|
-
}),
|
|
440
|
-
const
|
|
441
|
-
(
|
|
442
|
-
(c, l) => l !==
|
|
490
|
+
}), a.length > 0 && !q(a)) {
|
|
491
|
+
const r = a.find(
|
|
492
|
+
(s, m) => a.some(
|
|
493
|
+
(c, l) => l !== m && B(c, s)
|
|
443
494
|
)
|
|
444
495
|
);
|
|
445
|
-
|
|
496
|
+
r && i.push(
|
|
446
497
|
t(
|
|
447
498
|
"duplicate_metric",
|
|
448
|
-
|
|
499
|
+
j(r),
|
|
449
500
|
"metrics"
|
|
450
501
|
)
|
|
451
502
|
);
|
|
452
503
|
}
|
|
453
|
-
if (u(e.primaryMetric) && d(e.primaryMetric.name) &&
|
|
504
|
+
if (u(e.primaryMetric) && d(e.primaryMetric.name) && b(
|
|
454
505
|
e.primaryMetric,
|
|
455
|
-
|
|
506
|
+
a
|
|
456
507
|
).length > 1 && i.push(
|
|
457
508
|
t(
|
|
458
509
|
"ambiguous_primary_metric",
|
|
459
510
|
"Metric intent primaryMetric must identify exactly one selected metric.",
|
|
460
511
|
"primaryMetric"
|
|
461
512
|
)
|
|
462
|
-
), e.primaryMetric !== void 0 && (
|
|
513
|
+
), e.primaryMetric !== void 0 && (p(e.primaryMetric, "primaryMetric", i, {
|
|
463
514
|
required: !0
|
|
464
|
-
}), u(e.primaryMetric) && d(e.primaryMetric.name) &&
|
|
515
|
+
}), u(e.primaryMetric) && d(e.primaryMetric.name) && a.length > 0 && !C(
|
|
465
516
|
e.primaryMetric,
|
|
466
|
-
|
|
517
|
+
a
|
|
467
518
|
) && i.push(
|
|
468
519
|
t(
|
|
469
520
|
"invalid_primary_metric",
|
|
@@ -477,21 +528,21 @@ function B(e) {
|
|
|
477
528
|
"dimensions"
|
|
478
529
|
)
|
|
479
530
|
) : Array.isArray(e.dimensions) && e.dimensions.some(
|
|
480
|
-
(
|
|
531
|
+
(r) => !u(r) || !d(r.name)
|
|
481
532
|
) && i.push(
|
|
482
533
|
t(
|
|
483
534
|
"invalid_metric_dimensions",
|
|
484
535
|
"Metric intent dimensions must be an array of field references with names.",
|
|
485
536
|
"dimensions"
|
|
486
537
|
)
|
|
487
|
-
), e.dateField !== void 0 &&
|
|
538
|
+
), e.dateField !== void 0 && p(e.dateField, "dateField", i), e.timeWindow !== void 0 && (v(e.timeWindow, "timeWindow", i), e.dateField || i.push(
|
|
488
539
|
t(
|
|
489
540
|
"missing_time_window_date_field",
|
|
490
541
|
"Metric timeWindow needs a dateField.",
|
|
491
542
|
"dateField"
|
|
492
543
|
)
|
|
493
|
-
)),
|
|
494
|
-
|
|
544
|
+
)), S(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((r, s) => {
|
|
545
|
+
p(r, `dimensions.${s}`, i);
|
|
495
546
|
}), e.orderBy !== void 0) {
|
|
496
547
|
if (!u(e.orderBy))
|
|
497
548
|
i.push(
|
|
@@ -501,7 +552,7 @@ function B(e) {
|
|
|
501
552
|
"orderBy"
|
|
502
553
|
)
|
|
503
554
|
);
|
|
504
|
-
else if (
|
|
555
|
+
else if (p(e.orderBy.field, "orderBy.field", i, {
|
|
505
556
|
required: !0
|
|
506
557
|
}), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
|
|
507
558
|
t(
|
|
@@ -510,16 +561,16 @@ function B(e) {
|
|
|
510
561
|
"orderBy.direction"
|
|
511
562
|
)
|
|
512
563
|
), u(e.orderBy.field) && d(e.orderBy.field.name)) {
|
|
513
|
-
const
|
|
514
|
-
...
|
|
564
|
+
const r = [
|
|
565
|
+
...a,
|
|
515
566
|
...e.timeGrain && e.dateField && u(e.dateField) ? [e.dateField] : [],
|
|
516
567
|
...Array.isArray(e.dimensions) ? e.dimensions.filter(
|
|
517
|
-
(
|
|
568
|
+
(s) => u(s) && d(s.name)
|
|
518
569
|
) : []
|
|
519
570
|
];
|
|
520
|
-
|
|
571
|
+
r.length > 0 && !E(
|
|
521
572
|
e.orderBy.field,
|
|
522
|
-
|
|
573
|
+
r
|
|
523
574
|
) && i.push(
|
|
524
575
|
t(
|
|
525
576
|
"invalid_metric_order_by",
|
|
@@ -529,7 +580,7 @@ function B(e) {
|
|
|
529
580
|
);
|
|
530
581
|
}
|
|
531
582
|
}
|
|
532
|
-
|
|
583
|
+
X(e, i);
|
|
533
584
|
} else e.kind === "records" ? (!Array.isArray(e.fields) || e.fields.length === 0 ? i.push(
|
|
534
585
|
t(
|
|
535
586
|
"missing_record_fields",
|
|
@@ -537,16 +588,30 @@ function B(e) {
|
|
|
537
588
|
"fields"
|
|
538
589
|
)
|
|
539
590
|
) : e.fields.some(
|
|
540
|
-
(
|
|
591
|
+
(a) => !u(a) || !d(a.name)
|
|
541
592
|
) && i.push(
|
|
542
593
|
t(
|
|
543
594
|
"invalid_record_fields",
|
|
544
595
|
"Records intent fields must be field references with names.",
|
|
545
596
|
"fields"
|
|
546
597
|
)
|
|
547
|
-
), Array.isArray(e.fields) && e.fields.forEach((
|
|
548
|
-
|
|
549
|
-
}), e.dateField !== void 0 &&
|
|
598
|
+
), Array.isArray(e.fields) && e.fields.forEach((a, r) => {
|
|
599
|
+
p(a, `fields.${r}`, i);
|
|
600
|
+
}), e.dateField !== void 0 && p(e.dateField, "dateField", i), e.timeWindow !== void 0 && (v(e.timeWindow, "timeWindow", i), e.dateField || i.push(
|
|
601
|
+
t(
|
|
602
|
+
"missing_time_window_date_field",
|
|
603
|
+
"Records timeWindow needs a dateField.",
|
|
604
|
+
"dateField"
|
|
605
|
+
)
|
|
606
|
+
)), S(e.filters, "filters", i), Array.isArray(e.filters) && e.filters.forEach((a, r) => {
|
|
607
|
+
u(a) && a.scope === "aggregate" && i.push(
|
|
608
|
+
t(
|
|
609
|
+
"unsupported_record_filter_scope",
|
|
610
|
+
"Records intents support row-scope filters only. Use a metric intent for aggregate-scope filters.",
|
|
611
|
+
`filters.${r}.scope`
|
|
612
|
+
)
|
|
613
|
+
);
|
|
614
|
+
}), e.orderBy !== void 0 && (u(e.orderBy) ? (p(e.orderBy.field, "orderBy.field", i, {
|
|
550
615
|
required: !0
|
|
551
616
|
}), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
|
|
552
617
|
t(
|
|
@@ -566,26 +631,26 @@ function B(e) {
|
|
|
566
631
|
"Input options intent needs a field.",
|
|
567
632
|
"field"
|
|
568
633
|
)
|
|
569
|
-
),
|
|
634
|
+
), p(e.field, "field", i, { required: !0 })) : e.kind === "sql" ? (((o = e.source) == null ? void 0 : o.kind) !== "sql" && i.push(
|
|
570
635
|
t(
|
|
571
636
|
"invalid_sql_source",
|
|
572
637
|
"SQL analytics intent must use a SQL execution source.",
|
|
573
638
|
"source"
|
|
574
639
|
)
|
|
575
|
-
), d(e.sql) || i.push(t("missing_sql", "SQL analytics intent needs SQL text.", "sql")), Array.isArray(e.fields) && e.fields.forEach((
|
|
576
|
-
|
|
640
|
+
), d(e.sql) || i.push(t("missing_sql", "SQL analytics intent needs SQL text.", "sql")), Array.isArray(e.fields) && e.fields.forEach((a, r) => {
|
|
641
|
+
p(a, `fields.${r}`, i);
|
|
577
642
|
})) : i.push(
|
|
578
643
|
t("invalid_analytics_kind", "Analytics kind is not supported.", "kind")
|
|
579
644
|
);
|
|
580
645
|
return {
|
|
581
646
|
ok: i.length === 0,
|
|
582
647
|
errors: i,
|
|
583
|
-
warnings:
|
|
584
|
-
repairHints:
|
|
648
|
+
warnings: n,
|
|
649
|
+
repairHints: Z(i)
|
|
585
650
|
};
|
|
586
651
|
}
|
|
587
|
-
function
|
|
588
|
-
const i = [],
|
|
652
|
+
function Y(e) {
|
|
653
|
+
const i = [], n = [];
|
|
589
654
|
if (!e || typeof e != "object")
|
|
590
655
|
return {
|
|
591
656
|
ok: !1,
|
|
@@ -595,7 +660,7 @@ function Q(e) {
|
|
|
595
660
|
"Operation intent must be a structured object."
|
|
596
661
|
)
|
|
597
662
|
],
|
|
598
|
-
warnings:
|
|
663
|
+
warnings: n,
|
|
599
664
|
repairHints: [
|
|
600
665
|
{
|
|
601
666
|
code: "invalid_operation_intent",
|
|
@@ -612,18 +677,18 @@ function Q(e) {
|
|
|
612
677
|
"Answer-obligations operation intent needs at least one obligation.",
|
|
613
678
|
"obligations"
|
|
614
679
|
)
|
|
615
|
-
) : e.obligations.forEach((
|
|
616
|
-
d(
|
|
680
|
+
) : e.obligations.forEach((o, a) => {
|
|
681
|
+
d(o.id) || i.push(
|
|
617
682
|
t(
|
|
618
683
|
"missing_obligation_id",
|
|
619
684
|
"Each analytics obligation needs an id.",
|
|
620
|
-
`obligations.${
|
|
685
|
+
`obligations.${a}.id`
|
|
621
686
|
)
|
|
622
|
-
), d(
|
|
687
|
+
), d(o.prompt) || i.push(
|
|
623
688
|
t(
|
|
624
689
|
"missing_obligation_prompt",
|
|
625
690
|
"Each analytics obligation needs a prompt.",
|
|
626
|
-
`obligations.${
|
|
691
|
+
`obligations.${a}.prompt`
|
|
627
692
|
)
|
|
628
693
|
);
|
|
629
694
|
});
|
|
@@ -635,10 +700,10 @@ function Q(e) {
|
|
|
635
700
|
"instruction"
|
|
636
701
|
)
|
|
637
702
|
), e.analyticsIntent) {
|
|
638
|
-
const
|
|
703
|
+
const o = F(
|
|
639
704
|
e.analyticsIntent
|
|
640
705
|
);
|
|
641
|
-
i.push(...
|
|
706
|
+
i.push(...o.errors), n.push(...o.warnings);
|
|
642
707
|
}
|
|
643
708
|
} else
|
|
644
709
|
i.push(
|
|
@@ -651,12 +716,12 @@ function Q(e) {
|
|
|
651
716
|
return {
|
|
652
717
|
ok: i.length === 0,
|
|
653
718
|
errors: i,
|
|
654
|
-
warnings:
|
|
655
|
-
repairHints:
|
|
719
|
+
warnings: n,
|
|
720
|
+
repairHints: R(i)
|
|
656
721
|
};
|
|
657
722
|
}
|
|
658
|
-
function
|
|
659
|
-
const i = [],
|
|
723
|
+
function ee(e) {
|
|
724
|
+
const i = [], n = [];
|
|
660
725
|
if (!e || typeof e != "object")
|
|
661
726
|
return {
|
|
662
727
|
ok: !1,
|
|
@@ -666,7 +731,7 @@ function z(e) {
|
|
|
666
731
|
"Analytics recovery plan must be a structured object."
|
|
667
732
|
)
|
|
668
733
|
],
|
|
669
|
-
warnings:
|
|
734
|
+
warnings: n,
|
|
670
735
|
repairHints: [
|
|
671
736
|
{
|
|
672
737
|
code: "invalid_recovery_plan",
|
|
@@ -683,8 +748,8 @@ function z(e) {
|
|
|
683
748
|
"kind"
|
|
684
749
|
)
|
|
685
750
|
);
|
|
686
|
-
const
|
|
687
|
-
return i.push(...
|
|
751
|
+
const o = Y(e.operationIntent);
|
|
752
|
+
return i.push(...o.errors), n.push(...o.warnings), Array.isArray(e.plannedToolCalls) || i.push(
|
|
688
753
|
t(
|
|
689
754
|
"invalid_planned_tool_calls",
|
|
690
755
|
"Recovery plan plannedToolCalls must be an array.",
|
|
@@ -693,17 +758,17 @@ function z(e) {
|
|
|
693
758
|
), {
|
|
694
759
|
ok: i.length === 0,
|
|
695
760
|
errors: i,
|
|
696
|
-
warnings:
|
|
697
|
-
repairHints:
|
|
761
|
+
warnings: n,
|
|
762
|
+
repairHints: R(i)
|
|
698
763
|
};
|
|
699
764
|
}
|
|
700
|
-
function
|
|
765
|
+
function R(e) {
|
|
701
766
|
return e.map((i) => ({
|
|
702
767
|
code: i.code,
|
|
703
768
|
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."
|
|
704
769
|
}));
|
|
705
770
|
}
|
|
706
|
-
function
|
|
771
|
+
function Z(e) {
|
|
707
772
|
return e.map((i) => {
|
|
708
773
|
switch (i.code) {
|
|
709
774
|
case "missing_source":
|
|
@@ -756,13 +821,13 @@ function X(e) {
|
|
|
756
821
|
}
|
|
757
822
|
}).filter((i) => !!i);
|
|
758
823
|
}
|
|
759
|
-
function
|
|
824
|
+
function J(e, i, n, o) {
|
|
760
825
|
if (!e || typeof e != "object") {
|
|
761
|
-
|
|
826
|
+
n.push(t("invalid_view", "Dashboard view must be an object.", i));
|
|
762
827
|
return;
|
|
763
828
|
}
|
|
764
|
-
if (d(e.title) ||
|
|
765
|
-
|
|
829
|
+
if (d(e.title) || n.push(t("missing_view_title", "Dashboard view needs a title.", i)), !e.presentation || typeof e.presentation != "object") {
|
|
830
|
+
n.push(
|
|
766
831
|
t(
|
|
767
832
|
"missing_presentation",
|
|
768
833
|
"Dashboard view needs a presentation.",
|
|
@@ -772,7 +837,7 @@ function Y(e, i, s, r) {
|
|
|
772
837
|
return;
|
|
773
838
|
}
|
|
774
839
|
if (e.presentation.kind === "text") {
|
|
775
|
-
d(e.text) ||
|
|
840
|
+
d(e.text) || o.push(
|
|
776
841
|
t(
|
|
777
842
|
"missing_text_content",
|
|
778
843
|
"Text views should include text content.",
|
|
@@ -782,7 +847,7 @@ function Y(e, i, s, r) {
|
|
|
782
847
|
return;
|
|
783
848
|
}
|
|
784
849
|
if (!e.analytics) {
|
|
785
|
-
|
|
850
|
+
n.push(
|
|
786
851
|
t(
|
|
787
852
|
"missing_view_analytics",
|
|
788
853
|
"Non-text dashboard views need analytics intent.",
|
|
@@ -791,22 +856,22 @@ function Y(e, i, s, r) {
|
|
|
791
856
|
);
|
|
792
857
|
return;
|
|
793
858
|
}
|
|
794
|
-
const
|
|
795
|
-
for (const
|
|
796
|
-
|
|
797
|
-
t(
|
|
859
|
+
const a = F(e.analytics);
|
|
860
|
+
for (const r of a.errors)
|
|
861
|
+
n.push(
|
|
862
|
+
t(r.code, r.message, `${i}.analytics${r.path ? `.${r.path}` : ""}`)
|
|
798
863
|
);
|
|
799
|
-
for (const
|
|
800
|
-
|
|
864
|
+
for (const r of a.warnings)
|
|
865
|
+
o.push(
|
|
801
866
|
t(
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
`${i}.analytics${
|
|
867
|
+
r.code,
|
|
868
|
+
r.message,
|
|
869
|
+
`${i}.analytics${r.path ? `.${r.path}` : ""}`
|
|
805
870
|
)
|
|
806
871
|
);
|
|
807
872
|
}
|
|
808
|
-
function
|
|
809
|
-
const i = [],
|
|
873
|
+
function ie(e) {
|
|
874
|
+
const i = [], n = [];
|
|
810
875
|
if (!e || typeof e != "object")
|
|
811
876
|
return {
|
|
812
877
|
ok: !1,
|
|
@@ -816,20 +881,20 @@ function J(e) {
|
|
|
816
881
|
"Dashboard intent must be a structured object."
|
|
817
882
|
)
|
|
818
883
|
],
|
|
819
|
-
warnings:
|
|
884
|
+
warnings: n
|
|
820
885
|
};
|
|
821
886
|
e.version !== 1 && i.push(t("invalid_version", "Dashboard intent version must be 1.")), e.kind !== "dashboard" && i.push(t("invalid_kind", "Experience intent kind must be dashboard.")), d(e.title) || i.push(t("missing_title", "Dashboard intent needs a title.", "title"));
|
|
822
|
-
const
|
|
823
|
-
|
|
887
|
+
const o = Array.isArray(e.inputs) ? e.inputs : [], a = I(
|
|
888
|
+
o.filter(u).map((c) => c.id).filter((c) => typeof c == "string")
|
|
824
889
|
);
|
|
825
|
-
|
|
890
|
+
a && i.push(
|
|
826
891
|
t(
|
|
827
892
|
"duplicate_input_id",
|
|
828
|
-
`Duplicate input id: ${
|
|
893
|
+
`Duplicate input id: ${a}.`,
|
|
829
894
|
"inputs"
|
|
830
895
|
)
|
|
831
896
|
);
|
|
832
|
-
for (const [c, l] of
|
|
897
|
+
for (const [c, l] of o.entries()) {
|
|
833
898
|
const f = `inputs.${c}`;
|
|
834
899
|
if (!u(l)) {
|
|
835
900
|
i.push(t("invalid_input", "Dashboard input must be an object.", f));
|
|
@@ -839,27 +904,27 @@ function J(e) {
|
|
|
839
904
|
t("missing_input_label", "Input needs a label.", `${f}.label`)
|
|
840
905
|
), !l.field || !d(l.field.name) ? i.push(
|
|
841
906
|
t("missing_input_field", "Input needs a field.", `${f}.field`)
|
|
842
|
-
) :
|
|
907
|
+
) : p(l.field, `${f}.field`, i);
|
|
843
908
|
}
|
|
844
|
-
const
|
|
845
|
-
|
|
909
|
+
const r = Array.isArray(e.sections) ? e.sections : [];
|
|
910
|
+
r.length === 0 && i.push(
|
|
846
911
|
t(
|
|
847
912
|
"missing_sections",
|
|
848
913
|
"Dashboard intent needs at least one section.",
|
|
849
914
|
"sections"
|
|
850
915
|
)
|
|
851
916
|
);
|
|
852
|
-
const
|
|
917
|
+
const s = r.flatMap(
|
|
853
918
|
(c) => c && typeof c == "object" && Array.isArray(c.views) ? c.views.filter(u).map((l) => l.id).filter((l) => !!l) : []
|
|
854
|
-
),
|
|
855
|
-
|
|
919
|
+
), m = I(s);
|
|
920
|
+
m && i.push(
|
|
856
921
|
t(
|
|
857
922
|
"duplicate_view_id",
|
|
858
|
-
`Duplicate dashboard view id: ${
|
|
923
|
+
`Duplicate dashboard view id: ${m}.`,
|
|
859
924
|
"sections"
|
|
860
925
|
)
|
|
861
926
|
);
|
|
862
|
-
for (const [c, l] of
|
|
927
|
+
for (const [c, l] of r.entries()) {
|
|
863
928
|
const f = `sections.${c}`;
|
|
864
929
|
if (!l || typeof l != "object") {
|
|
865
930
|
i.push(
|
|
@@ -879,20 +944,22 @@ function J(e) {
|
|
|
879
944
|
);
|
|
880
945
|
continue;
|
|
881
946
|
}
|
|
882
|
-
for (const [h,
|
|
883
|
-
|
|
884
|
-
|
|
947
|
+
for (const [h, g] of l.views.entries())
|
|
948
|
+
J(
|
|
949
|
+
g,
|
|
885
950
|
`${f}.views.${h}`,
|
|
886
951
|
i,
|
|
887
|
-
|
|
952
|
+
n
|
|
888
953
|
);
|
|
889
954
|
}
|
|
890
|
-
return { ok: i.length === 0, errors: i, warnings:
|
|
955
|
+
return { ok: i.length === 0, errors: i, warnings: n };
|
|
891
956
|
}
|
|
892
957
|
export {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
958
|
+
D as a,
|
|
959
|
+
Y as b,
|
|
960
|
+
ee as c,
|
|
961
|
+
ie as d,
|
|
962
|
+
W as n,
|
|
963
|
+
$ as p,
|
|
964
|
+
F as v
|
|
898
965
|
};
|