react-semaphor 0.1.350 → 0.1.352
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +1 -1
- package/dist/chunks/{calendar-preferences-dialog-BAEeX-ug.js → calendar-preferences-dialog-BP6VCs24.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-C8flqOjZ.js → calendar-preferences-dialog-DqB0gRKY.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DU9x-97H.js → dashboard-briefing-launcher-CE8bNT8E.js} +3 -3
- package/dist/chunks/{dashboard-briefing-launcher--zBBsBWm.js → dashboard-briefing-launcher-DxLotfPa.js} +1 -1
- package/dist/chunks/{dashboard-controls-BwMjIqjP.js → dashboard-controls-B00gdNuz.js} +3 -3
- package/dist/chunks/{dashboard-controls-CMShL7m9.js → dashboard-controls-DiRVwF2s.js} +1 -1
- package/dist/chunks/{dashboard-json-kD_jszqF.js → dashboard-json-BvdoNEjb.js} +1 -1
- package/dist/chunks/{dashboard-json-CHKC0bf-.js → dashboard-json-qKWjSofT.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-C1RUXsWi.js → edit-dashboard-visual-B25Pk-Hr.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-C1vIFm6H.js → edit-dashboard-visual-ChpvAgup.js} +1 -1
- package/dist/chunks/{index-BJLPtQeK.js → index-D14U5QOC.js} +10843 -10840
- package/dist/chunks/{index-D2ai-cZQ.js → index-DYHvr2To.js} +56 -56
- package/dist/chunks/{resource-management-panel-UkMvz7Cp.js → resource-management-panel-BOW5JCor.js} +2 -2
- package/dist/chunks/{resource-management-panel-f4Od7wCB.js → resource-management-panel-ChEmFjoR.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-jpQ2BxKF.js → use-create-flow-overlay-state-C5jxnrOJ.js} +2 -2
- package/dist/chunks/{use-create-flow-overlay-state-C49F2KdU.js → use-create-flow-overlay-state-CZk4rrrw.js} +1 -1
- package/dist/chunks/{use-visual-utils-D8Pe1PSH.js → use-visual-utils-DHBV770y.js} +1 -1
- package/dist/chunks/{use-visual-utils-CiN4zNkZ.js → use-visual-utils-ika7wXDI.js} +1 -1
- package/dist/chunks/{validators-B-NiYgGc.js → validators-BnLhuIhd.js} +189 -176
- package/dist/chunks/validators-Cu_w8ZEP.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 +1 -1
- 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 +8 -0
- package/dist/types/dashboard-assistant.d.ts +8 -0
- package/dist/types/dashboard-authoring.d.ts +8 -0
- package/dist/types/data-app-builder.d.ts +8 -0
- package/dist/types/data-app-sdk.d.ts +8 -0
- package/dist/types/main.d.ts +8 -0
- package/package.json +1 -1
- package/dist/chunks/validators-DlEfynH8.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { s as R } from "./source-identity-qAmkNtEK.js";
|
|
2
|
-
function
|
|
3
|
-
return
|
|
2
|
+
function t(e, i, s) {
|
|
3
|
+
return s ? { code: e, message: i, path: s } : { code: e, message: i };
|
|
4
4
|
}
|
|
5
5
|
function T(e) {
|
|
6
6
|
for (let i = 0; i < e.length; i += 1) {
|
|
7
|
-
const
|
|
7
|
+
const s = e[i];
|
|
8
8
|
if (e.some(
|
|
9
|
-
(r, o) => o !== i && S(r,
|
|
9
|
+
(r, o) => o !== i && S(r, s)
|
|
10
10
|
))
|
|
11
11
|
return !1;
|
|
12
12
|
}
|
|
@@ -48,9 +48,9 @@ const q = /^(\d{4})-(\d{2})-(\d{2})$/, U = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d
|
|
|
48
48
|
function A(e) {
|
|
49
49
|
if (typeof e != "string")
|
|
50
50
|
return null;
|
|
51
|
-
const i = e.trim(),
|
|
52
|
-
if (
|
|
53
|
-
const [, v, b, w] =
|
|
51
|
+
const i = e.trim(), s = q.exec(i);
|
|
52
|
+
if (s) {
|
|
53
|
+
const [, v, b, w] = s;
|
|
54
54
|
return M(v, b, w) ? new Date(
|
|
55
55
|
Date.UTC(Number(v), Number(b) - 1, Number(w))
|
|
56
56
|
) : null;
|
|
@@ -58,22 +58,22 @@ function A(e) {
|
|
|
58
58
|
const r = U.exec(i);
|
|
59
59
|
if (!r)
|
|
60
60
|
return null;
|
|
61
|
-
const [, o, a,
|
|
62
|
-
if (!M(o, a,
|
|
61
|
+
const [, o, a, n, p, c, l = "00", , f] = r;
|
|
62
|
+
if (!M(o, a, n) || !_(p, 0, 23) || !_(c, 0, 59) || !_(l, 0, 59) || !P(f))
|
|
63
63
|
return null;
|
|
64
64
|
const h = new Date(i);
|
|
65
65
|
return Number.isFinite(h.getTime()) ? h : null;
|
|
66
66
|
}
|
|
67
|
-
function M(e, i,
|
|
68
|
-
const r = Number(e), o = Number(i), a = Number(
|
|
67
|
+
function M(e, i, s) {
|
|
68
|
+
const r = Number(e), o = Number(i), a = Number(s);
|
|
69
69
|
if (!Number.isInteger(r) || !Number.isInteger(o) || !Number.isInteger(a) || o < 1 || o > 12)
|
|
70
70
|
return !1;
|
|
71
|
-
const
|
|
72
|
-
return
|
|
71
|
+
const n = new Date(Date.UTC(r, o - 1, a));
|
|
72
|
+
return n.getUTCFullYear() === r && n.getUTCMonth() === o - 1 && n.getUTCDate() === a;
|
|
73
73
|
}
|
|
74
|
-
function _(e, i,
|
|
74
|
+
function _(e, i, s) {
|
|
75
75
|
const r = Number(e);
|
|
76
|
-
return Number.isInteger(r) && r >= i && r <=
|
|
76
|
+
return Number.isInteger(r) && r >= i && r <= s;
|
|
77
77
|
}
|
|
78
78
|
function P(e) {
|
|
79
79
|
if (e === "Z")
|
|
@@ -89,10 +89,10 @@ function u(e) {
|
|
|
89
89
|
}
|
|
90
90
|
function $(e) {
|
|
91
91
|
const i = /* @__PURE__ */ new Set();
|
|
92
|
-
for (const
|
|
93
|
-
if (i.has(
|
|
94
|
-
return
|
|
95
|
-
i.add(
|
|
92
|
+
for (const s of e) {
|
|
93
|
+
if (i.has(s))
|
|
94
|
+
return s;
|
|
95
|
+
i.add(s);
|
|
96
96
|
}
|
|
97
97
|
return null;
|
|
98
98
|
}
|
|
@@ -105,20 +105,20 @@ const G = /* @__PURE__ */ new Set([
|
|
|
105
105
|
"MEDIAN",
|
|
106
106
|
"DISTINCT"
|
|
107
107
|
]);
|
|
108
|
-
function k(e, i,
|
|
108
|
+
function k(e, i, s) {
|
|
109
109
|
if (!e || typeof e != "object") {
|
|
110
|
-
|
|
110
|
+
s.push(t("missing_source", "Analytics intent needs a source.", i));
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
113
113
|
if (e.kind === "semantic") {
|
|
114
|
-
d(e.domainId) ||
|
|
115
|
-
|
|
114
|
+
d(e.domainId) || s.push(
|
|
115
|
+
t(
|
|
116
116
|
"missing_semantic_domain",
|
|
117
117
|
"Semantic source needs a domainId.",
|
|
118
118
|
`${i}.domainId`
|
|
119
119
|
)
|
|
120
|
-
), d(e.datasetName) ||
|
|
121
|
-
|
|
120
|
+
), d(e.datasetName) || s.push(
|
|
121
|
+
t(
|
|
122
122
|
"missing_dataset_name",
|
|
123
123
|
"Semantic source needs a datasetName.",
|
|
124
124
|
`${i}.datasetName`
|
|
@@ -127,14 +127,14 @@ function k(e, i, t) {
|
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
if (e.kind === "physical") {
|
|
130
|
-
d(e.connectionId) ||
|
|
131
|
-
|
|
130
|
+
d(e.connectionId) || s.push(
|
|
131
|
+
t(
|
|
132
132
|
"missing_connection_id",
|
|
133
133
|
"Physical source needs a connectionId.",
|
|
134
134
|
`${i}.connectionId`
|
|
135
135
|
)
|
|
136
|
-
), d(e.tableName) ||
|
|
137
|
-
|
|
136
|
+
), d(e.tableName) || s.push(
|
|
137
|
+
t(
|
|
138
138
|
"missing_table_name",
|
|
139
139
|
"Physical source needs a tableName.",
|
|
140
140
|
`${i}.tableName`
|
|
@@ -143,8 +143,8 @@ function k(e, i, t) {
|
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
if (e.kind === "sql") {
|
|
146
|
-
d(e.connectionId) ||
|
|
147
|
-
|
|
146
|
+
d(e.connectionId) || s.push(
|
|
147
|
+
t(
|
|
148
148
|
"missing_connection_id",
|
|
149
149
|
"SQL source needs a connectionId.",
|
|
150
150
|
`${i}.connectionId`
|
|
@@ -152,22 +152,22 @@ function k(e, i, t) {
|
|
|
152
152
|
);
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
s.push(t("invalid_source_kind", "Source kind is not supported.", i));
|
|
156
156
|
}
|
|
157
|
-
function m(e, i,
|
|
157
|
+
function m(e, i, s, r = {}) {
|
|
158
158
|
if (!e || !u(e)) {
|
|
159
|
-
r.required &&
|
|
160
|
-
|
|
159
|
+
r.required && s.push(
|
|
160
|
+
t("missing_field_ref", "Field reference needs a name.", i)
|
|
161
161
|
);
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
d(e.name) ||
|
|
165
|
-
|
|
166
|
-
), e.source !== void 0 && k(e.source, `${i}.source`,
|
|
164
|
+
d(e.name) || s.push(
|
|
165
|
+
t("missing_field_ref", "Field reference needs a name.", `${i}.name`)
|
|
166
|
+
), e.source !== void 0 && k(e.source, `${i}.source`, s), H(e.aggregate, `${i}.aggregate`, s);
|
|
167
167
|
}
|
|
168
|
-
function H(e, i,
|
|
169
|
-
e !== void 0 && (typeof e != "string" || !G.has(e)) &&
|
|
170
|
-
|
|
168
|
+
function H(e, i, s) {
|
|
169
|
+
e !== void 0 && (typeof e != "string" || !G.has(e)) && s.push(
|
|
170
|
+
t(
|
|
171
171
|
"invalid_aggregate",
|
|
172
172
|
"Field aggregate must be SUM, COUNT, AVG, MIN, MAX, MEDIAN, or DISTINCT.",
|
|
173
173
|
i
|
|
@@ -179,7 +179,7 @@ function L(e, i) {
|
|
|
179
179
|
return;
|
|
180
180
|
if (!u(e.analysis)) {
|
|
181
181
|
i.push(
|
|
182
|
-
|
|
182
|
+
t(
|
|
183
183
|
"invalid_metric_analysis",
|
|
184
184
|
"Metric analysis must be a structured object.",
|
|
185
185
|
"analysis"
|
|
@@ -189,7 +189,7 @@ function L(e, i) {
|
|
|
189
189
|
}
|
|
190
190
|
if (e.analysis.kind !== "period_change") {
|
|
191
191
|
i.push(
|
|
192
|
-
|
|
192
|
+
t(
|
|
193
193
|
"invalid_metric_analysis",
|
|
194
194
|
"Metric analysis kind is not supported.",
|
|
195
195
|
"analysis.kind"
|
|
@@ -198,31 +198,31 @@ function L(e, i) {
|
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
200
|
e.dateField || i.push(
|
|
201
|
-
|
|
201
|
+
t(
|
|
202
202
|
"missing_analysis_date_field",
|
|
203
203
|
"Period-change analysis needs a dateField.",
|
|
204
204
|
"dateField"
|
|
205
205
|
)
|
|
206
206
|
), e.timeGrain || i.push(
|
|
207
|
-
|
|
207
|
+
t(
|
|
208
208
|
"missing_analysis_time_grain",
|
|
209
209
|
"Period-change analysis needs a timeGrain.",
|
|
210
210
|
"timeGrain"
|
|
211
211
|
)
|
|
212
212
|
), e.analysis.orderBy !== void 0 && e.analysis.orderBy !== "absolute_change" && e.analysis.orderBy !== "positive_change" && e.analysis.orderBy !== "negative_change" && e.analysis.orderBy !== "period" && i.push(
|
|
213
|
-
|
|
213
|
+
t(
|
|
214
214
|
"invalid_metric_analysis",
|
|
215
215
|
"Period-change analysis orderBy must be absolute_change, positive_change, negative_change, or period.",
|
|
216
216
|
"analysis.orderBy"
|
|
217
217
|
)
|
|
218
218
|
);
|
|
219
|
-
const { timeWindow:
|
|
220
|
-
|
|
219
|
+
const { timeWindow: s } = e.analysis;
|
|
220
|
+
s !== void 0 && N(s, "analysis.timeWindow", i);
|
|
221
221
|
}
|
|
222
|
-
function N(e, i,
|
|
222
|
+
function N(e, i, s) {
|
|
223
223
|
if (!u(e)) {
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
s.push(
|
|
225
|
+
t(
|
|
226
226
|
"invalid_time_window",
|
|
227
227
|
"Time window must be a structured object.",
|
|
228
228
|
i
|
|
@@ -230,41 +230,41 @@ function N(e, i, t) {
|
|
|
230
230
|
);
|
|
231
231
|
return;
|
|
232
232
|
}
|
|
233
|
-
if (e.kind !== void 0 && e.kind !== "relative" && e.kind !== "absolute" &&
|
|
234
|
-
|
|
233
|
+
if (e.kind !== void 0 && e.kind !== "relative" && e.kind !== "absolute" && s.push(
|
|
234
|
+
t(
|
|
235
235
|
"invalid_time_window",
|
|
236
236
|
"Time window kind must be relative or absolute.",
|
|
237
237
|
`${i}.kind`
|
|
238
238
|
)
|
|
239
239
|
), e.kind === "absolute") {
|
|
240
|
-
if (d(e.start) ||
|
|
241
|
-
|
|
240
|
+
if (d(e.start) || s.push(
|
|
241
|
+
t(
|
|
242
242
|
"invalid_time_window",
|
|
243
243
|
"Absolute time window start must be a non-empty ISO date or timestamp string.",
|
|
244
244
|
`${i}.start`
|
|
245
245
|
)
|
|
246
|
-
), d(e.end) ||
|
|
247
|
-
|
|
246
|
+
), d(e.end) || s.push(
|
|
247
|
+
t(
|
|
248
248
|
"invalid_time_window",
|
|
249
249
|
"Absolute time window end must be a non-empty ISO date or timestamp string.",
|
|
250
250
|
`${i}.end`
|
|
251
251
|
)
|
|
252
252
|
), d(e.start) && d(e.end)) {
|
|
253
253
|
const r = A(e.start), o = A(e.end);
|
|
254
|
-
r ||
|
|
255
|
-
|
|
254
|
+
r || s.push(
|
|
255
|
+
t(
|
|
256
256
|
"invalid_time_window",
|
|
257
257
|
"Absolute time window start must be a valid ISO date or timestamp.",
|
|
258
258
|
`${i}.start`
|
|
259
259
|
)
|
|
260
|
-
), o ||
|
|
261
|
-
|
|
260
|
+
), o || s.push(
|
|
261
|
+
t(
|
|
262
262
|
"invalid_time_window",
|
|
263
263
|
"Absolute time window end must be a valid ISO date or timestamp.",
|
|
264
264
|
`${i}.end`
|
|
265
265
|
)
|
|
266
|
-
), r && o && r.getTime() > o.getTime() &&
|
|
267
|
-
|
|
266
|
+
), r && o && r.getTime() > o.getTime() && s.push(
|
|
267
|
+
t(
|
|
268
268
|
"invalid_time_window",
|
|
269
269
|
"Absolute time window start must be before or equal to end.",
|
|
270
270
|
i
|
|
@@ -273,37 +273,37 @@ function N(e, i, t) {
|
|
|
273
273
|
}
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
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" &&
|
|
277
|
-
|
|
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" && s.push(
|
|
277
|
+
t(
|
|
278
278
|
"invalid_time_window",
|
|
279
279
|
"Time window unit must be second, minute, hour, day, week, month, quarter, or year.",
|
|
280
280
|
`${i}.unit`
|
|
281
281
|
)
|
|
282
|
-
), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) &&
|
|
283
|
-
|
|
282
|
+
), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && s.push(
|
|
283
|
+
t(
|
|
284
284
|
"invalid_time_window",
|
|
285
285
|
"Time window value must be a positive number.",
|
|
286
286
|
`${i}.value`
|
|
287
287
|
)
|
|
288
|
-
), e.anchor !== void 0 && e.anchor !== "now" && e.anchor !== "latest_available" &&
|
|
289
|
-
|
|
288
|
+
), e.anchor !== void 0 && e.anchor !== "now" && e.anchor !== "latest_available" && s.push(
|
|
289
|
+
t(
|
|
290
290
|
"invalid_time_window",
|
|
291
291
|
"Time window anchor must be now or latest_available.",
|
|
292
292
|
`${i}.anchor`
|
|
293
293
|
)
|
|
294
|
-
), e.completeness !== void 0 && e.completeness !== "include_partial" && e.completeness !== "complete_periods" &&
|
|
295
|
-
|
|
294
|
+
), e.completeness !== void 0 && e.completeness !== "include_partial" && e.completeness !== "complete_periods" && s.push(
|
|
295
|
+
t(
|
|
296
296
|
"invalid_time_window",
|
|
297
297
|
"Time window completeness must be include_partial or complete_periods.",
|
|
298
298
|
`${i}.completeness`
|
|
299
299
|
)
|
|
300
300
|
);
|
|
301
301
|
}
|
|
302
|
-
function V(e, i,
|
|
302
|
+
function V(e, i, s) {
|
|
303
303
|
if (e !== void 0) {
|
|
304
304
|
if (!Array.isArray(e)) {
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
s.push(
|
|
306
|
+
t(
|
|
307
307
|
"invalid_analytics_filters",
|
|
308
308
|
"Analytics filters must be an array.",
|
|
309
309
|
i
|
|
@@ -312,10 +312,11 @@ function V(e, i, t) {
|
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
314
|
e.forEach((r, o) => {
|
|
315
|
+
var c;
|
|
315
316
|
const a = `${i}.${o}`;
|
|
316
317
|
if (!u(r)) {
|
|
317
|
-
|
|
318
|
-
|
|
318
|
+
s.push(
|
|
319
|
+
t(
|
|
319
320
|
"invalid_analytics_filter",
|
|
320
321
|
"Analytics filter must be a structured object.",
|
|
321
322
|
a
|
|
@@ -323,26 +324,38 @@ function V(e, i, t) {
|
|
|
323
324
|
);
|
|
324
325
|
return;
|
|
325
326
|
}
|
|
326
|
-
const
|
|
327
|
-
m(
|
|
327
|
+
const n = r;
|
|
328
|
+
m(n.field, `${a}.field`, s, {
|
|
328
329
|
required: !0
|
|
329
|
-
})
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
}), n.scope !== void 0 && n.scope !== "row" && n.scope !== "aggregate" && s.push(
|
|
331
|
+
t(
|
|
332
|
+
"invalid_analytics_filter_scope",
|
|
333
|
+
"Analytics filter scope must be row or aggregate.",
|
|
334
|
+
`${a}.scope`
|
|
335
|
+
)
|
|
336
|
+
), n.scope === "aggregate" && ((c = n.field) == null ? void 0 : c.role) !== void 0 && n.field.role !== "measure" && s.push(
|
|
337
|
+
t(
|
|
338
|
+
"invalid_analytics_filter_scope",
|
|
339
|
+
"Aggregate-scope analytics filters must target a measure field.",
|
|
340
|
+
`${a}.scope`
|
|
341
|
+
)
|
|
342
|
+
);
|
|
343
|
+
const p = n.operator === "is_null" || n.operator === "is_not_null";
|
|
344
|
+
if (n.operator !== void 0 && n.operator !== "=" && n.operator !== "!=" && n.operator !== "in" && n.operator !== "not_in" && n.operator !== "contains" && n.operator !== "not_contains" && n.operator !== "between" && n.operator !== "not_between" && n.operator !== ">" && n.operator !== ">=" && n.operator !== "<" && n.operator !== "<=" && n.operator !== "is_null" && n.operator !== "is_not_null" && s.push(
|
|
345
|
+
t(
|
|
333
346
|
"invalid_analytics_filter_operator",
|
|
334
347
|
"Analytics filter operator is not supported.",
|
|
335
348
|
`${a}.operator`
|
|
336
349
|
)
|
|
337
|
-
),
|
|
338
|
-
|
|
350
|
+
), n.values === void 0 && !p && s.push(
|
|
351
|
+
t(
|
|
339
352
|
"missing_analytics_filter_value",
|
|
340
353
|
"Analytics filter needs values unless it is a null check.",
|
|
341
354
|
a
|
|
342
355
|
)
|
|
343
|
-
), p &&
|
|
344
|
-
|
|
345
|
-
|
|
356
|
+
), p && n.values !== void 0) {
|
|
357
|
+
s.push(
|
|
358
|
+
t(
|
|
346
359
|
"invalid_analytics_filter_values",
|
|
347
360
|
"Null-check analytics filters must not include values.",
|
|
348
361
|
`${a}.values`
|
|
@@ -350,9 +363,9 @@ function V(e, i, t) {
|
|
|
350
363
|
);
|
|
351
364
|
return;
|
|
352
365
|
}
|
|
353
|
-
if (
|
|
354
|
-
|
|
355
|
-
|
|
366
|
+
if (n.values !== void 0 && !Array.isArray(n.values)) {
|
|
367
|
+
s.push(
|
|
368
|
+
t(
|
|
356
369
|
"invalid_analytics_filter_values",
|
|
357
370
|
"Analytics filter values must be an array when provided.",
|
|
358
371
|
`${a}.values`
|
|
@@ -360,11 +373,11 @@ function V(e, i, t) {
|
|
|
360
373
|
);
|
|
361
374
|
return;
|
|
362
375
|
}
|
|
363
|
-
if (
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
|
|
367
|
-
|
|
376
|
+
if (n.values !== void 0) {
|
|
377
|
+
const l = n.values.length;
|
|
378
|
+
if (n.operator === "between" || n.operator === "not_between") {
|
|
379
|
+
l !== 2 && s.push(
|
|
380
|
+
t(
|
|
368
381
|
"invalid_analytics_filter_values",
|
|
369
382
|
"Between analytics filters must include exactly two values.",
|
|
370
383
|
`${a}.values`
|
|
@@ -372,8 +385,8 @@ function V(e, i, t) {
|
|
|
372
385
|
);
|
|
373
386
|
return;
|
|
374
387
|
}
|
|
375
|
-
(
|
|
376
|
-
|
|
388
|
+
(n.operator === "contains" || n.operator === "not_contains" || n.operator === "=" || n.operator === "!=" || n.operator === ">" || n.operator === ">=" || n.operator === "<" || n.operator === "<=" || n.operator === void 0) && l !== 1 && s.push(
|
|
389
|
+
t(
|
|
377
390
|
"invalid_analytics_filter_values",
|
|
378
391
|
"Scalar analytics filters must include exactly one value. Use in/not_in for multiple values.",
|
|
379
392
|
`${a}.values`
|
|
@@ -385,17 +398,17 @@ function V(e, i, t) {
|
|
|
385
398
|
}
|
|
386
399
|
function B(e) {
|
|
387
400
|
var r;
|
|
388
|
-
const i = [],
|
|
401
|
+
const i = [], s = [];
|
|
389
402
|
if (!e || typeof e != "object")
|
|
390
403
|
return {
|
|
391
404
|
ok: !1,
|
|
392
405
|
errors: [
|
|
393
|
-
|
|
406
|
+
t(
|
|
394
407
|
"invalid_analytics_intent",
|
|
395
408
|
"Analytics intent must be a structured object."
|
|
396
409
|
)
|
|
397
410
|
],
|
|
398
|
-
warnings:
|
|
411
|
+
warnings: s,
|
|
399
412
|
repairHints: [
|
|
400
413
|
{
|
|
401
414
|
code: "invalid_analytics_intent",
|
|
@@ -404,33 +417,33 @@ function B(e) {
|
|
|
404
417
|
]
|
|
405
418
|
};
|
|
406
419
|
if (e.version !== void 0 && e.version !== 1 && i.push(
|
|
407
|
-
|
|
420
|
+
t("invalid_version", "Analytics intent version must be 1.", "version")
|
|
408
421
|
), k(e.source, "source", i), e.kind === "metric") {
|
|
409
422
|
const o = Array.isArray(e.metrics) ? e.metrics.filter(
|
|
410
423
|
(a) => u(a) && d(a.name)
|
|
411
424
|
) : [];
|
|
412
425
|
if (!Array.isArray(e.metrics) || e.metrics.length === 0 ? i.push(
|
|
413
|
-
|
|
426
|
+
t("missing_metric", "Metric intent needs at least one metric.", "metrics")
|
|
414
427
|
) : e.metrics.some(
|
|
415
428
|
(a) => !u(a) || !d(a.name)
|
|
416
429
|
) && i.push(
|
|
417
|
-
|
|
430
|
+
t(
|
|
418
431
|
"invalid_metric_list",
|
|
419
432
|
"Metric intent metrics must be an array of field references with names.",
|
|
420
433
|
"metrics"
|
|
421
434
|
)
|
|
422
|
-
), o.forEach((a,
|
|
423
|
-
m(a, `metrics.${
|
|
435
|
+
), o.forEach((a, n) => {
|
|
436
|
+
m(a, `metrics.${n}`, i, {
|
|
424
437
|
required: !0
|
|
425
438
|
});
|
|
426
439
|
}), o.length > 0 && !T(o)) {
|
|
427
440
|
const a = o.find(
|
|
428
|
-
(
|
|
429
|
-
(c, l) => l !== p && S(c,
|
|
441
|
+
(n, p) => o.some(
|
|
442
|
+
(c, l) => l !== p && S(c, n)
|
|
430
443
|
)
|
|
431
444
|
);
|
|
432
445
|
a && i.push(
|
|
433
|
-
|
|
446
|
+
t(
|
|
434
447
|
"duplicate_metric",
|
|
435
448
|
F(a),
|
|
436
449
|
"metrics"
|
|
@@ -441,7 +454,7 @@ function B(e) {
|
|
|
441
454
|
e.primaryMetric,
|
|
442
455
|
o
|
|
443
456
|
).length > 1 && i.push(
|
|
444
|
-
|
|
457
|
+
t(
|
|
445
458
|
"ambiguous_primary_metric",
|
|
446
459
|
"Metric intent primaryMetric must identify exactly one selected metric.",
|
|
447
460
|
"primaryMetric"
|
|
@@ -452,13 +465,13 @@ function B(e) {
|
|
|
452
465
|
e.primaryMetric,
|
|
453
466
|
o
|
|
454
467
|
) && i.push(
|
|
455
|
-
|
|
468
|
+
t(
|
|
456
469
|
"invalid_primary_metric",
|
|
457
470
|
"Metric intent primaryMetric must match one metric field reference.",
|
|
458
471
|
"primaryMetric"
|
|
459
472
|
)
|
|
460
473
|
)), e.dimensions !== void 0 && !Array.isArray(e.dimensions) ? i.push(
|
|
461
|
-
|
|
474
|
+
t(
|
|
462
475
|
"invalid_metric_dimensions",
|
|
463
476
|
"Metric intent dimensions must be an array of field references.",
|
|
464
477
|
"dimensions"
|
|
@@ -466,23 +479,23 @@ function B(e) {
|
|
|
466
479
|
) : Array.isArray(e.dimensions) && e.dimensions.some(
|
|
467
480
|
(a) => !u(a) || !d(a.name)
|
|
468
481
|
) && i.push(
|
|
469
|
-
|
|
482
|
+
t(
|
|
470
483
|
"invalid_metric_dimensions",
|
|
471
484
|
"Metric intent dimensions must be an array of field references with names.",
|
|
472
485
|
"dimensions"
|
|
473
486
|
)
|
|
474
487
|
), e.dateField !== void 0 && m(e.dateField, "dateField", i), e.timeWindow !== void 0 && (N(e.timeWindow, "timeWindow", i), e.dateField || i.push(
|
|
475
|
-
|
|
488
|
+
t(
|
|
476
489
|
"missing_time_window_date_field",
|
|
477
490
|
"Metric timeWindow needs a dateField.",
|
|
478
491
|
"dateField"
|
|
479
492
|
)
|
|
480
|
-
)), V(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((a,
|
|
481
|
-
m(a, `dimensions.${
|
|
493
|
+
)), V(e.filters, "filters", i), Array.isArray(e.dimensions) && e.dimensions.forEach((a, n) => {
|
|
494
|
+
m(a, `dimensions.${n}`, i);
|
|
482
495
|
}), e.orderBy !== void 0) {
|
|
483
496
|
if (!u(e.orderBy))
|
|
484
497
|
i.push(
|
|
485
|
-
|
|
498
|
+
t(
|
|
486
499
|
"invalid_metric_order_by",
|
|
487
500
|
"Metric intent orderBy must be a structured object.",
|
|
488
501
|
"orderBy"
|
|
@@ -491,7 +504,7 @@ function B(e) {
|
|
|
491
504
|
else if (m(e.orderBy.field, "orderBy.field", i, {
|
|
492
505
|
required: !0
|
|
493
506
|
}), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
|
|
494
|
-
|
|
507
|
+
t(
|
|
495
508
|
"invalid_metric_order_direction",
|
|
496
509
|
"Metric intent orderBy direction must be asc or desc.",
|
|
497
510
|
"orderBy.direction"
|
|
@@ -501,14 +514,14 @@ function B(e) {
|
|
|
501
514
|
...o,
|
|
502
515
|
...e.timeGrain && e.dateField && u(e.dateField) ? [e.dateField] : [],
|
|
503
516
|
...Array.isArray(e.dimensions) ? e.dimensions.filter(
|
|
504
|
-
(
|
|
517
|
+
(n) => u(n) && d(n.name)
|
|
505
518
|
) : []
|
|
506
519
|
];
|
|
507
520
|
a.length > 0 && !j(
|
|
508
521
|
e.orderBy.field,
|
|
509
522
|
a
|
|
510
523
|
) && i.push(
|
|
511
|
-
|
|
524
|
+
t(
|
|
512
525
|
"invalid_metric_order_by",
|
|
513
526
|
"Metric intent orderBy.field must match one selected metric, grouped dateField, or dimension.",
|
|
514
527
|
"orderBy.field"
|
|
@@ -518,7 +531,7 @@ function B(e) {
|
|
|
518
531
|
}
|
|
519
532
|
L(e, i);
|
|
520
533
|
} else e.kind === "records" ? (!Array.isArray(e.fields) || e.fields.length === 0 ? i.push(
|
|
521
|
-
|
|
534
|
+
t(
|
|
522
535
|
"missing_record_fields",
|
|
523
536
|
"Records intent needs at least one field.",
|
|
524
537
|
"fields"
|
|
@@ -526,7 +539,7 @@ function B(e) {
|
|
|
526
539
|
) : e.fields.some(
|
|
527
540
|
(o) => !u(o) || !d(o.name)
|
|
528
541
|
) && i.push(
|
|
529
|
-
|
|
542
|
+
t(
|
|
530
543
|
"invalid_record_fields",
|
|
531
544
|
"Records intent fields must be field references with names.",
|
|
532
545
|
"fields"
|
|
@@ -536,53 +549,53 @@ function B(e) {
|
|
|
536
549
|
}), e.dateField !== void 0 && m(e.dateField, "dateField", i), e.orderBy !== void 0 && (u(e.orderBy) ? (m(e.orderBy.field, "orderBy.field", i, {
|
|
537
550
|
required: !0
|
|
538
551
|
}), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && i.push(
|
|
539
|
-
|
|
552
|
+
t(
|
|
540
553
|
"invalid_record_order_direction",
|
|
541
554
|
"Records intent orderBy direction must be asc or desc.",
|
|
542
555
|
"orderBy.direction"
|
|
543
556
|
)
|
|
544
557
|
)) : i.push(
|
|
545
|
-
|
|
558
|
+
t(
|
|
546
559
|
"invalid_record_order_by",
|
|
547
560
|
"Records intent orderBy must be a structured object.",
|
|
548
561
|
"orderBy"
|
|
549
562
|
)
|
|
550
563
|
))) : e.kind === "inputOptions" ? ((!e.field || !d(e.field.name)) && i.push(
|
|
551
|
-
|
|
564
|
+
t(
|
|
552
565
|
"missing_input_options_field",
|
|
553
566
|
"Input options intent needs a field.",
|
|
554
567
|
"field"
|
|
555
568
|
)
|
|
556
569
|
), m(e.field, "field", i, { required: !0 })) : e.kind === "sql" ? (((r = e.source) == null ? void 0 : r.kind) !== "sql" && i.push(
|
|
557
|
-
|
|
570
|
+
t(
|
|
558
571
|
"invalid_sql_source",
|
|
559
572
|
"SQL analytics intent must use a SQL execution source.",
|
|
560
573
|
"source"
|
|
561
574
|
)
|
|
562
|
-
), d(e.sql) || i.push(
|
|
575
|
+
), d(e.sql) || i.push(t("missing_sql", "SQL analytics intent needs SQL text.", "sql")), Array.isArray(e.fields) && e.fields.forEach((o, a) => {
|
|
563
576
|
m(o, `fields.${a}`, i);
|
|
564
577
|
})) : i.push(
|
|
565
|
-
|
|
578
|
+
t("invalid_analytics_kind", "Analytics kind is not supported.", "kind")
|
|
566
579
|
);
|
|
567
580
|
return {
|
|
568
581
|
ok: i.length === 0,
|
|
569
582
|
errors: i,
|
|
570
|
-
warnings:
|
|
583
|
+
warnings: s,
|
|
571
584
|
repairHints: X(i)
|
|
572
585
|
};
|
|
573
586
|
}
|
|
574
587
|
function Q(e) {
|
|
575
|
-
const i = [],
|
|
588
|
+
const i = [], s = [];
|
|
576
589
|
if (!e || typeof e != "object")
|
|
577
590
|
return {
|
|
578
591
|
ok: !1,
|
|
579
592
|
errors: [
|
|
580
|
-
|
|
593
|
+
t(
|
|
581
594
|
"invalid_operation_intent",
|
|
582
595
|
"Operation intent must be a structured object."
|
|
583
596
|
)
|
|
584
597
|
],
|
|
585
|
-
warnings:
|
|
598
|
+
warnings: s,
|
|
586
599
|
repairHints: [
|
|
587
600
|
{
|
|
588
601
|
code: "invalid_operation_intent",
|
|
@@ -591,23 +604,23 @@ function Q(e) {
|
|
|
591
604
|
]
|
|
592
605
|
};
|
|
593
606
|
if (e.version !== 1 && i.push(
|
|
594
|
-
|
|
607
|
+
t("invalid_version", "Operation intent version must be 1.", "version")
|
|
595
608
|
), e.kind === "answer_obligations")
|
|
596
609
|
!Array.isArray(e.obligations) || e.obligations.length === 0 ? i.push(
|
|
597
|
-
|
|
610
|
+
t(
|
|
598
611
|
"missing_obligations",
|
|
599
612
|
"Answer-obligations operation intent needs at least one obligation.",
|
|
600
613
|
"obligations"
|
|
601
614
|
)
|
|
602
615
|
) : e.obligations.forEach((r, o) => {
|
|
603
616
|
d(r.id) || i.push(
|
|
604
|
-
|
|
617
|
+
t(
|
|
605
618
|
"missing_obligation_id",
|
|
606
619
|
"Each analytics obligation needs an id.",
|
|
607
620
|
`obligations.${o}.id`
|
|
608
621
|
)
|
|
609
622
|
), d(r.prompt) || i.push(
|
|
610
|
-
|
|
623
|
+
t(
|
|
611
624
|
"missing_obligation_prompt",
|
|
612
625
|
"Each analytics obligation needs a prompt.",
|
|
613
626
|
`obligations.${o}.prompt`
|
|
@@ -616,7 +629,7 @@ function Q(e) {
|
|
|
616
629
|
});
|
|
617
630
|
else if (e.kind === "dashboard_change" || e.kind === "data_app_change") {
|
|
618
631
|
if (d(e.instruction) || i.push(
|
|
619
|
-
|
|
632
|
+
t(
|
|
620
633
|
"missing_instruction",
|
|
621
634
|
"Change operation intent needs an instruction.",
|
|
622
635
|
"instruction"
|
|
@@ -625,11 +638,11 @@ function Q(e) {
|
|
|
625
638
|
const r = B(
|
|
626
639
|
e.analyticsIntent
|
|
627
640
|
);
|
|
628
|
-
i.push(...r.errors),
|
|
641
|
+
i.push(...r.errors), s.push(...r.warnings);
|
|
629
642
|
}
|
|
630
643
|
} else
|
|
631
644
|
i.push(
|
|
632
|
-
|
|
645
|
+
t(
|
|
633
646
|
"invalid_operation_kind",
|
|
634
647
|
"Operation intent kind is not supported.",
|
|
635
648
|
"kind"
|
|
@@ -638,22 +651,22 @@ function Q(e) {
|
|
|
638
651
|
return {
|
|
639
652
|
ok: i.length === 0,
|
|
640
653
|
errors: i,
|
|
641
|
-
warnings:
|
|
654
|
+
warnings: s,
|
|
642
655
|
repairHints: x(i)
|
|
643
656
|
};
|
|
644
657
|
}
|
|
645
658
|
function z(e) {
|
|
646
|
-
const i = [],
|
|
659
|
+
const i = [], s = [];
|
|
647
660
|
if (!e || typeof e != "object")
|
|
648
661
|
return {
|
|
649
662
|
ok: !1,
|
|
650
663
|
errors: [
|
|
651
|
-
|
|
664
|
+
t(
|
|
652
665
|
"invalid_recovery_plan",
|
|
653
666
|
"Analytics recovery plan must be a structured object."
|
|
654
667
|
)
|
|
655
668
|
],
|
|
656
|
-
warnings:
|
|
669
|
+
warnings: s,
|
|
657
670
|
repairHints: [
|
|
658
671
|
{
|
|
659
672
|
code: "invalid_recovery_plan",
|
|
@@ -662,17 +675,17 @@ function z(e) {
|
|
|
662
675
|
]
|
|
663
676
|
};
|
|
664
677
|
e.version !== 1 && i.push(
|
|
665
|
-
|
|
678
|
+
t("invalid_version", "Recovery plan version must be 1.", "version")
|
|
666
679
|
), e.kind !== "analytics_recovery_plan" && i.push(
|
|
667
|
-
|
|
680
|
+
t(
|
|
668
681
|
"invalid_recovery_plan_kind",
|
|
669
682
|
"Recovery plan kind must be analytics_recovery_plan.",
|
|
670
683
|
"kind"
|
|
671
684
|
)
|
|
672
685
|
);
|
|
673
686
|
const r = Q(e.operationIntent);
|
|
674
|
-
return i.push(...r.errors),
|
|
675
|
-
|
|
687
|
+
return i.push(...r.errors), s.push(...r.warnings), Array.isArray(e.plannedToolCalls) || i.push(
|
|
688
|
+
t(
|
|
676
689
|
"invalid_planned_tool_calls",
|
|
677
690
|
"Recovery plan plannedToolCalls must be an array.",
|
|
678
691
|
"plannedToolCalls"
|
|
@@ -680,7 +693,7 @@ function z(e) {
|
|
|
680
693
|
), {
|
|
681
694
|
ok: i.length === 0,
|
|
682
695
|
errors: i,
|
|
683
|
-
warnings:
|
|
696
|
+
warnings: s,
|
|
684
697
|
repairHints: x(i)
|
|
685
698
|
};
|
|
686
699
|
}
|
|
@@ -743,14 +756,14 @@ function X(e) {
|
|
|
743
756
|
}
|
|
744
757
|
}).filter((i) => !!i);
|
|
745
758
|
}
|
|
746
|
-
function Y(e, i,
|
|
759
|
+
function Y(e, i, s, r) {
|
|
747
760
|
if (!e || typeof e != "object") {
|
|
748
|
-
|
|
761
|
+
s.push(t("invalid_view", "Dashboard view must be an object.", i));
|
|
749
762
|
return;
|
|
750
763
|
}
|
|
751
|
-
if (d(e.title) ||
|
|
752
|
-
|
|
753
|
-
|
|
764
|
+
if (d(e.title) || s.push(t("missing_view_title", "Dashboard view needs a title.", i)), !e.presentation || typeof e.presentation != "object") {
|
|
765
|
+
s.push(
|
|
766
|
+
t(
|
|
754
767
|
"missing_presentation",
|
|
755
768
|
"Dashboard view needs a presentation.",
|
|
756
769
|
`${i}.presentation`
|
|
@@ -760,7 +773,7 @@ function Y(e, i, t, r) {
|
|
|
760
773
|
}
|
|
761
774
|
if (e.presentation.kind === "text") {
|
|
762
775
|
d(e.text) || r.push(
|
|
763
|
-
|
|
776
|
+
t(
|
|
764
777
|
"missing_text_content",
|
|
765
778
|
"Text views should include text content.",
|
|
766
779
|
`${i}.text`
|
|
@@ -769,8 +782,8 @@ function Y(e, i, t, r) {
|
|
|
769
782
|
return;
|
|
770
783
|
}
|
|
771
784
|
if (!e.analytics) {
|
|
772
|
-
|
|
773
|
-
|
|
785
|
+
s.push(
|
|
786
|
+
t(
|
|
774
787
|
"missing_view_analytics",
|
|
775
788
|
"Non-text dashboard views need analytics intent.",
|
|
776
789
|
`${i}.analytics`
|
|
@@ -780,12 +793,12 @@ function Y(e, i, t, r) {
|
|
|
780
793
|
}
|
|
781
794
|
const o = B(e.analytics);
|
|
782
795
|
for (const a of o.errors)
|
|
783
|
-
|
|
784
|
-
|
|
796
|
+
s.push(
|
|
797
|
+
t(a.code, a.message, `${i}.analytics${a.path ? `.${a.path}` : ""}`)
|
|
785
798
|
);
|
|
786
799
|
for (const a of o.warnings)
|
|
787
800
|
r.push(
|
|
788
|
-
|
|
801
|
+
t(
|
|
789
802
|
a.code,
|
|
790
803
|
a.message,
|
|
791
804
|
`${i}.analytics${a.path ? `.${a.path}` : ""}`
|
|
@@ -793,24 +806,24 @@ function Y(e, i, t, r) {
|
|
|
793
806
|
);
|
|
794
807
|
}
|
|
795
808
|
function J(e) {
|
|
796
|
-
const i = [],
|
|
809
|
+
const i = [], s = [];
|
|
797
810
|
if (!e || typeof e != "object")
|
|
798
811
|
return {
|
|
799
812
|
ok: !1,
|
|
800
813
|
errors: [
|
|
801
|
-
|
|
814
|
+
t(
|
|
802
815
|
"invalid_dashboard_intent",
|
|
803
816
|
"Dashboard intent must be a structured object."
|
|
804
817
|
)
|
|
805
818
|
],
|
|
806
|
-
warnings:
|
|
819
|
+
warnings: s
|
|
807
820
|
};
|
|
808
|
-
e.version !== 1 && i.push(
|
|
821
|
+
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"));
|
|
809
822
|
const r = Array.isArray(e.inputs) ? e.inputs : [], o = $(
|
|
810
823
|
r.filter(u).map((c) => c.id).filter((c) => typeof c == "string")
|
|
811
824
|
);
|
|
812
825
|
o && i.push(
|
|
813
|
-
|
|
826
|
+
t(
|
|
814
827
|
"duplicate_input_id",
|
|
815
828
|
`Duplicate input id: ${o}.`,
|
|
816
829
|
"inputs"
|
|
@@ -819,28 +832,28 @@ function J(e) {
|
|
|
819
832
|
for (const [c, l] of r.entries()) {
|
|
820
833
|
const f = `inputs.${c}`;
|
|
821
834
|
if (!u(l)) {
|
|
822
|
-
i.push(
|
|
835
|
+
i.push(t("invalid_input", "Dashboard input must be an object.", f));
|
|
823
836
|
continue;
|
|
824
837
|
}
|
|
825
|
-
d(l.id) || i.push(
|
|
826
|
-
|
|
838
|
+
d(l.id) || i.push(t("missing_input_id", "Input needs an id.", `${f}.id`)), d(l.label) || i.push(
|
|
839
|
+
t("missing_input_label", "Input needs a label.", `${f}.label`)
|
|
827
840
|
), !l.field || !d(l.field.name) ? i.push(
|
|
828
|
-
|
|
841
|
+
t("missing_input_field", "Input needs a field.", `${f}.field`)
|
|
829
842
|
) : m(l.field, `${f}.field`, i);
|
|
830
843
|
}
|
|
831
844
|
const a = Array.isArray(e.sections) ? e.sections : [];
|
|
832
845
|
a.length === 0 && i.push(
|
|
833
|
-
|
|
846
|
+
t(
|
|
834
847
|
"missing_sections",
|
|
835
848
|
"Dashboard intent needs at least one section.",
|
|
836
849
|
"sections"
|
|
837
850
|
)
|
|
838
851
|
);
|
|
839
|
-
const
|
|
852
|
+
const n = a.flatMap(
|
|
840
853
|
(c) => c && typeof c == "object" && Array.isArray(c.views) ? c.views.filter(u).map((l) => l.id).filter((l) => !!l) : []
|
|
841
|
-
), p = $(
|
|
854
|
+
), p = $(n);
|
|
842
855
|
p && i.push(
|
|
843
|
-
|
|
856
|
+
t(
|
|
844
857
|
"duplicate_view_id",
|
|
845
858
|
`Duplicate dashboard view id: ${p}.`,
|
|
846
859
|
"sections"
|
|
@@ -850,15 +863,15 @@ function J(e) {
|
|
|
850
863
|
const f = `sections.${c}`;
|
|
851
864
|
if (!l || typeof l != "object") {
|
|
852
865
|
i.push(
|
|
853
|
-
|
|
866
|
+
t("invalid_section", "Dashboard section must be an object.", f)
|
|
854
867
|
);
|
|
855
868
|
continue;
|
|
856
869
|
}
|
|
857
870
|
if (d(l.title) || i.push(
|
|
858
|
-
|
|
871
|
+
t("missing_section_title", "Dashboard section needs a title.", f)
|
|
859
872
|
), !Array.isArray(l.views) || l.views.length === 0) {
|
|
860
873
|
i.push(
|
|
861
|
-
|
|
874
|
+
t(
|
|
862
875
|
"missing_section_views",
|
|
863
876
|
"Dashboard section needs at least one view.",
|
|
864
877
|
`${f}.views`
|
|
@@ -871,10 +884,10 @@ function J(e) {
|
|
|
871
884
|
v,
|
|
872
885
|
`${f}.views.${h}`,
|
|
873
886
|
i,
|
|
874
|
-
|
|
887
|
+
s
|
|
875
888
|
);
|
|
876
889
|
}
|
|
877
|
-
return { ok: i.length === 0, errors: i, warnings:
|
|
890
|
+
return { ok: i.length === 0, errors: i, warnings: s };
|
|
878
891
|
}
|
|
879
892
|
export {
|
|
880
893
|
Q as a,
|