@modelform/react-native 0.4.0 → 0.6.0
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/README.md +21 -1
- package/dist/{chunk-ATRMUHKJ.mjs → chunk-BW6HKFAB.mjs} +1079 -372
- package/dist/{chunk-WMRDOYPV.js → chunk-YUXA7I4J.js} +1179 -472
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +42 -2
- package/dist/core/index.mjs +41 -1
- package/dist/core/inputs.d.ts +71 -1
- package/dist/core/local.d.ts +4 -0
- package/dist/core/snippets.d.ts +4 -0
- package/dist/core/templates.d.ts +74 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +547 -314
- package/dist/index.mjs +508 -275
- package/dist/ui/inputs/InputGroup.d.ts +9 -0
- package/dist/ui/inputs/formContext.d.ts +22 -1
- package/package.json +1 -1
- package/schema/dashboard.schema.json +113 -2
|
@@ -990,9 +990,22 @@ var INPUT_OPTION_KEYS = {
|
|
|
990
990
|
var INPUT_TYPES = Object.keys(INPUT_OPTION_KEYS);
|
|
991
991
|
var isInputType = (type) => type in INPUT_OPTION_KEYS;
|
|
992
992
|
var isInputPanel = (p) => p.type.startsWith("input-") && !!_optionalChain([p, 'access', _90 => _90.options, 'optionalAccess', _91 => _91.metric]);
|
|
993
|
+
var INPUT_GROUP = "input-group";
|
|
994
|
+
var isFormPanelType = (type) => isInputType(type) || type === INPUT_GROUP;
|
|
995
|
+
var isInputGroup = (p) => p.type === INPUT_GROUP && Array.isArray(_optionalChain([p, 'access', _92 => _92.options, 'optionalAccess', _93 => _93.fields]));
|
|
996
|
+
var GROUP_FIELD_TYPES = INPUT_TYPES.filter((t) => t !== "input-counter");
|
|
997
|
+
function groupFields(group) {
|
|
998
|
+
return group.options.fields.filter((f) => f && isInputType(f.type) && f.type !== "input-counter" && typeof _optionalChain([f, 'access', _94 => _94.options, 'optionalAccess', _95 => _95.metric]) === "string" && f.options.metric).map(({ span, ...f }) => ({ ...f, gridPos: { x: 0, y: 0, w: _nullishCoalesce(span, () => ( 24)), h: 3 } }));
|
|
999
|
+
}
|
|
1000
|
+
var panelsOf = (dashboard) => dashboard.panels.flatMap((p) => p.type === "row" ? [p, ..._nullishCoalesce(p.panels, () => ( []))] : [p]);
|
|
993
1001
|
function inputPanels(dashboard) {
|
|
994
|
-
|
|
995
|
-
|
|
1002
|
+
return panelsOf(dashboard).flatMap((p) => isInputGroup(p) ? groupFields(p) : isInputPanel(p) ? [p] : []);
|
|
1003
|
+
}
|
|
1004
|
+
function inputGroups(dashboard) {
|
|
1005
|
+
return panelsOf(dashboard).filter(isInputGroup);
|
|
1006
|
+
}
|
|
1007
|
+
function plainInputPanels(dashboard) {
|
|
1008
|
+
return panelsOf(dashboard).filter(isInputPanel);
|
|
996
1009
|
}
|
|
997
1010
|
function parseClockDigits(digits) {
|
|
998
1011
|
const d = digits.replace(/\D/g, "").slice(-6);
|
|
@@ -1011,16 +1024,66 @@ function formatClock(seconds) {
|
|
|
1011
1024
|
const h = total % 100;
|
|
1012
1025
|
return `${String(m).padStart(2, "0")}:${String(s).padStart(2, "0")}.${String(h).padStart(2, "0")}`;
|
|
1013
1026
|
}
|
|
1014
|
-
function toEntries(panel, value, ts) {
|
|
1027
|
+
function toEntries(panel, value, ts, origin = {}) {
|
|
1015
1028
|
if (value == null || value === "") return [];
|
|
1016
1029
|
const metric = panel.options.metric;
|
|
1017
|
-
const
|
|
1030
|
+
const extra = {};
|
|
1031
|
+
if (origin.save != null) extra.save = origin.save;
|
|
1032
|
+
if (origin.item != null) extra.item = origin.item;
|
|
1033
|
+
const one = (v) => typeof v === "string" ? { metric, ts, value: null, text: v, ...extra } : { metric, ts, value: typeof v === "boolean" ? v ? 1 : 0 : v, text: null, ...extra };
|
|
1018
1034
|
return Array.isArray(value) ? value.map(one) : [one(value)];
|
|
1019
1035
|
}
|
|
1036
|
+
function newSaveId(now = Date.now()) {
|
|
1037
|
+
const rand = () => Math.floor(Math.random() * 4294967296).toString(36).padStart(7, "0");
|
|
1038
|
+
return `${now.toString(36)}-${rand()}${rand()}`;
|
|
1039
|
+
}
|
|
1040
|
+
var isEmptyValue = (v) => v == null || v === "" || Array.isArray(v) && !v.length;
|
|
1041
|
+
function isEmptyItem(group, item) {
|
|
1042
|
+
return groupFields(group).every((f) => f.type === "input-toggle" || isEmptyValue(item[f.options.metric]));
|
|
1043
|
+
}
|
|
1044
|
+
function groupToEntries(group, items, ts, save) {
|
|
1045
|
+
const fields = groupFields(group);
|
|
1046
|
+
return items.filter((item) => !isEmptyItem(group, item)).flatMap((item, i) => fields.flatMap((f) => toEntries(f, _nullishCoalesce(item[f.options.metric], () => ( null)), ts, { save, item: i })));
|
|
1047
|
+
}
|
|
1048
|
+
function entriesToItems(group, entries) {
|
|
1049
|
+
const fields = groupFields(group);
|
|
1050
|
+
const byItem = /* @__PURE__ */ new Map();
|
|
1051
|
+
for (const e of entries) {
|
|
1052
|
+
if (e.item == null || !fields.some((f) => f.options.metric === e.metric)) continue;
|
|
1053
|
+
byItem.set(e.item, [..._nullishCoalesce(byItem.get(e.item), () => ( [])), e]);
|
|
1054
|
+
}
|
|
1055
|
+
return [...byItem.keys()].sort((a, b) => a - b).map((k) => {
|
|
1056
|
+
const mine = byItem.get(k);
|
|
1057
|
+
const item = {};
|
|
1058
|
+
for (const f of fields) {
|
|
1059
|
+
const es = mine.filter((e) => e.metric === f.options.metric);
|
|
1060
|
+
if (es.length) item[f.options.metric] = f.options.multi ? es.map((e) => _nullishCoalesce(e.text, () => ( e.value))) : entryToInputValue(f, es[0]);
|
|
1061
|
+
}
|
|
1062
|
+
return item;
|
|
1063
|
+
});
|
|
1064
|
+
}
|
|
1065
|
+
function groupProblems(group, items) {
|
|
1066
|
+
const fields = groupFields(group);
|
|
1067
|
+
const label = group.options.itemTitle || "Item";
|
|
1068
|
+
const filled = items.map((item, i) => ({ item, n: i + 1 })).filter(({ item }) => !isEmptyItem(group, item));
|
|
1069
|
+
const out = [];
|
|
1070
|
+
const { min, max } = group.options;
|
|
1071
|
+
if (typeof min === "number" && filled.length < min) out.push(`${group.title || label}: at least ${min} ${min === 1 ? label.toLowerCase() : `${label.toLowerCase()}s`}`);
|
|
1072
|
+
if (typeof max === "number" && filled.length > max) out.push(`${group.title || label}: at most ${max}`);
|
|
1073
|
+
for (const { item, n } of filled)
|
|
1074
|
+
for (const f of fields) {
|
|
1075
|
+
const problem = inputProblem(f, _nullishCoalesce(item[f.options.metric], () => ( null)));
|
|
1076
|
+
if (problem) out.push(`${label} ${n}: ${f.title || f.options.metric} ${problem === "Required" ? "is required" : problem.toLowerCase()}`);
|
|
1077
|
+
}
|
|
1078
|
+
return out;
|
|
1079
|
+
}
|
|
1080
|
+
function sameSave(entry, candidates) {
|
|
1081
|
+
return entry.save ? candidates.filter((e) => e.save === entry.save) : candidates.filter((e) => !e.save && e.ts === entry.ts);
|
|
1082
|
+
}
|
|
1020
1083
|
function inputProblem(panel, value) {
|
|
1021
1084
|
const o = panel.options;
|
|
1022
1085
|
const empty = value == null || value === "" || Array.isArray(value) && !value.length;
|
|
1023
|
-
if (empty) return o.required && _optionalChain([INPUT_OPTION_KEYS, 'access',
|
|
1086
|
+
if (empty) return o.required && _optionalChain([INPUT_OPTION_KEYS, 'access', _96 => _96[panel.type], 'optionalAccess', _97 => _97.includes, 'call', _98 => _98("required")]) ? "Required" : void 0;
|
|
1024
1087
|
if ((panel.type === "input-number" || panel.type === "input-slider") && typeof value === "number") {
|
|
1025
1088
|
const unit = o.unit ? ` ${o.unit}` : "";
|
|
1026
1089
|
if (typeof o.min === "number" && value < o.min) return `At least ${o.min}${unit}`;
|
|
@@ -1038,8 +1101,8 @@ function textSuggestions(entries, query, limit = 8) {
|
|
|
1038
1101
|
const seen = /* @__PURE__ */ new Set();
|
|
1039
1102
|
const out = [];
|
|
1040
1103
|
for (const e of [...entries].sort((a, b) => b.ts - a.ts)) {
|
|
1041
|
-
const text = _optionalChain([e, 'access',
|
|
1042
|
-
const key = _optionalChain([text, 'optionalAccess',
|
|
1104
|
+
const text = _optionalChain([e, 'access', _99 => _99.text, 'optionalAccess', _100 => _100.trim, 'call', _101 => _101()]);
|
|
1105
|
+
const key = _optionalChain([text, 'optionalAccess', _102 => _102.toLowerCase, 'call', _103 => _103()]);
|
|
1043
1106
|
if (!text || !key || seen.has(key)) continue;
|
|
1044
1107
|
seen.add(key);
|
|
1045
1108
|
if (key === q) continue;
|
|
@@ -1051,8 +1114,10 @@ function textSuggestions(entries, query, limit = 8) {
|
|
|
1051
1114
|
}
|
|
1052
1115
|
function entriesSavedWith(entries, metric, withMetric, withText) {
|
|
1053
1116
|
const want = withText.trim().toLowerCase();
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1117
|
+
const matches = entries.filter((e) => e.metric === withMetric && _optionalChain([e, 'access', _104 => _104.text, 'optionalAccess', _105 => _105.trim, 'call', _106 => _106(), 'access', _107 => _107.toLowerCase, 'call', _108 => _108()]) === want);
|
|
1118
|
+
const saves = new Set(matches.map((e) => e.save).filter(Boolean));
|
|
1119
|
+
const times = new Set(matches.filter((e) => !e.save).map((e) => e.ts));
|
|
1120
|
+
return entries.filter((e) => e.metric === metric && (e.save ? saves.has(e.save) : times.has(e.ts)));
|
|
1056
1121
|
}
|
|
1057
1122
|
|
|
1058
1123
|
// src/core/format.ts
|
|
@@ -1158,11 +1223,11 @@ function fromNow(t) {
|
|
|
1158
1223
|
return diff >= 0 ? `${text} ago` : `in ${text}`;
|
|
1159
1224
|
}
|
|
1160
1225
|
function thresholdStep(value, config = {}) {
|
|
1161
|
-
const steps = _optionalChain([config, 'access',
|
|
1162
|
-
if (!_optionalChain([steps, 'optionalAccess',
|
|
1226
|
+
const steps = _optionalChain([config, 'access', _109 => _109.thresholds, 'optionalAccess', _110 => _110.steps]);
|
|
1227
|
+
if (!_optionalChain([steps, 'optionalAccess', _111 => _111.length])) return void 0;
|
|
1163
1228
|
if (value == null) return steps[0];
|
|
1164
1229
|
let v = value;
|
|
1165
|
-
if (_optionalChain([config, 'access',
|
|
1230
|
+
if (_optionalChain([config, 'access', _112 => _112.thresholds, 'optionalAccess', _113 => _113.mode]) === "percentage") {
|
|
1166
1231
|
const min = _nullishCoalesce(config.min, () => ( 0));
|
|
1167
1232
|
const max = _nullishCoalesce(config.max, () => ( 100));
|
|
1168
1233
|
v = (value - min) / (max - min || 1) * 100;
|
|
@@ -1222,12 +1287,12 @@ var SERIES_PALETTE = {
|
|
|
1222
1287
|
function seriesColor(index, scheme, config) {
|
|
1223
1288
|
const palette = SERIES_PALETTE[scheme];
|
|
1224
1289
|
const color = palette[index % palette.length];
|
|
1225
|
-
if (_optionalChain([config, 'optionalAccess',
|
|
1290
|
+
if (_optionalChain([config, 'optionalAccess', _114 => _114.color, 'optionalAccess', _115 => _115.mode]) === "fixed") return resolveColor(config.color.fixedColor, color);
|
|
1226
1291
|
return color;
|
|
1227
1292
|
}
|
|
1228
1293
|
function mappedResult(value, config = {}) {
|
|
1229
1294
|
for (const m of _nullishCoalesce(config.mappings, () => ( []))) {
|
|
1230
|
-
if (!_optionalChain([m, 'optionalAccess',
|
|
1295
|
+
if (!_optionalChain([m, 'optionalAccess', _116 => _116.options]) || typeof m.options !== "object") continue;
|
|
1231
1296
|
if (m.type === "value") {
|
|
1232
1297
|
const hit = m.options[String(value)];
|
|
1233
1298
|
if (hit) return hit;
|
|
@@ -1240,7 +1305,7 @@ function mappedResult(value, config = {}) {
|
|
|
1240
1305
|
if (value == null) continue;
|
|
1241
1306
|
const re = regexOf(pattern);
|
|
1242
1307
|
const match = re && String(value).match(re);
|
|
1243
|
-
if (match) return { ...result, text: _optionalChain([result, 'access',
|
|
1308
|
+
if (match) return { ...result, text: _optionalChain([result, 'access', _117 => _117.text, 'optionalAccess', _118 => _118.replace, 'call', _119 => _119(/\$(\d+)/g, (_, n) => _nullishCoalesce(match[Number(n)], () => ( "")))]) };
|
|
1244
1309
|
} else if (m.type === "special") {
|
|
1245
1310
|
const { match, result } = m.options;
|
|
1246
1311
|
const isNull = value == null;
|
|
@@ -1260,7 +1325,7 @@ function regexOf(pattern) {
|
|
|
1260
1325
|
}
|
|
1261
1326
|
}
|
|
1262
1327
|
function formatDisplay(value, config = {}) {
|
|
1263
|
-
return _nullishCoalesce(_optionalChain([mappedResult, 'call',
|
|
1328
|
+
return _nullishCoalesce(_optionalChain([mappedResult, 'call', _120 => _120(value, config), 'optionalAccess', _121 => _121.text]), () => ( formatValue(value, config)));
|
|
1264
1329
|
}
|
|
1265
1330
|
var CONTINUOUS = {
|
|
1266
1331
|
"continuous-GrYlRd": ["#73BF69", "#FADE2A", "#F2495C"],
|
|
@@ -1280,14 +1345,14 @@ function mix(a, b, t) {
|
|
|
1280
1345
|
return `#${out.map((v) => v.toString(16).padStart(2, "0")).join("")}`;
|
|
1281
1346
|
}
|
|
1282
1347
|
function valueColor(value, config, fallback, extent) {
|
|
1283
|
-
const mapped = _optionalChain([mappedResult, 'call',
|
|
1348
|
+
const mapped = _optionalChain([mappedResult, 'call', _122 => _122(value, config), 'optionalAccess', _123 => _123.color]);
|
|
1284
1349
|
if (mapped) return resolveColor(mapped, fallback);
|
|
1285
|
-
const mode = _optionalChain([config, 'access',
|
|
1286
|
-
if (mode === "fixed") return resolveColor(_optionalChain([config, 'access',
|
|
1350
|
+
const mode = _optionalChain([config, 'access', _124 => _124.color, 'optionalAccess', _125 => _125.mode]);
|
|
1351
|
+
if (mode === "fixed") return resolveColor(_optionalChain([config, 'access', _126 => _126.color, 'optionalAccess', _127 => _127.fixedColor]), fallback);
|
|
1287
1352
|
const stops = mode ? CONTINUOUS[mode] : void 0;
|
|
1288
1353
|
if (stops) {
|
|
1289
|
-
const min = _nullishCoalesce(_nullishCoalesce(config.min, () => ( _optionalChain([extent, 'optionalAccess',
|
|
1290
|
-
const max = _nullishCoalesce(_nullishCoalesce(config.max, () => ( _optionalChain([extent, 'optionalAccess',
|
|
1354
|
+
const min = _nullishCoalesce(_nullishCoalesce(config.min, () => ( _optionalChain([extent, 'optionalAccess', _128 => _128[0]]))), () => ( 0));
|
|
1355
|
+
const max = _nullishCoalesce(_nullishCoalesce(config.max, () => ( _optionalChain([extent, 'optionalAccess', _129 => _129[1]]))), () => ( 1));
|
|
1291
1356
|
const t = value == null ? 0 : Math.min(1, Math.max(0, (value - min) / (max - min || 1)));
|
|
1292
1357
|
const at = t * (stops.length - 1);
|
|
1293
1358
|
const i = Math.min(Math.floor(at), stops.length - 2);
|
|
@@ -1302,8 +1367,8 @@ function valueColor(value, config, fallback, extent) {
|
|
|
1302
1367
|
|
|
1303
1368
|
// src/core/fieldconfig.ts
|
|
1304
1369
|
function resolveFieldConfig(panel, field2, frame, displayName) {
|
|
1305
|
-
let config = mergeConfig(_nullishCoalesce(_optionalChain([panel, 'access',
|
|
1306
|
-
for (const o of _nullishCoalesce(_optionalChain([panel, 'access',
|
|
1370
|
+
let config = mergeConfig(_nullishCoalesce(_optionalChain([panel, 'access', _130 => _130.fieldConfig, 'optionalAccess', _131 => _131.defaults]), () => ( {})), _nullishCoalesce(field2.config, () => ( {})));
|
|
1371
|
+
for (const o of _nullishCoalesce(_optionalChain([panel, 'access', _132 => _132.fieldConfig, 'optionalAccess', _133 => _133.overrides]), () => ( []))) {
|
|
1307
1372
|
if (!fieldMatches(o.matcher, field2, frame, displayName)) continue;
|
|
1308
1373
|
for (const p of o.properties) if (p.value !== void 0) config = setPath(config, p.id, p.value);
|
|
1309
1374
|
}
|
|
@@ -1388,7 +1453,7 @@ var GrafanaClient = class {
|
|
|
1388
1453
|
}
|
|
1389
1454
|
search(query = "", options = {}) {
|
|
1390
1455
|
const params = new URLSearchParams({ type: _nullishCoalesce(options.type, () => ( "dash-db")), query, limit: String(_nullishCoalesce(options.limit, () => ( 100))) });
|
|
1391
|
-
_optionalChain([options, 'access',
|
|
1456
|
+
_optionalChain([options, 'access', _134 => _134.tag, 'optionalAccess', _135 => _135.forEach, 'call', _136 => _136((t) => params.append("tag", t))]);
|
|
1392
1457
|
return this.request(`/api/search?${params}`);
|
|
1393
1458
|
}
|
|
1394
1459
|
async dashboard(uid) {
|
|
@@ -1397,7 +1462,7 @@ var GrafanaClient = class {
|
|
|
1397
1462
|
}
|
|
1398
1463
|
/** Resolve name / "${DS_X}" placeholder / missing refs to a concrete {type, uid}. */
|
|
1399
1464
|
async resolveRef(ref) {
|
|
1400
|
-
if (_optionalChain([ref, 'optionalAccess',
|
|
1465
|
+
if (_optionalChain([ref, 'optionalAccess', _137 => _137.uid]) && !isPlaceholder(ref.uid) && ref.uid !== "default") {
|
|
1401
1466
|
if (ref.type) return ref;
|
|
1402
1467
|
}
|
|
1403
1468
|
this.settings ??= this.request("/api/frontend/settings");
|
|
@@ -1409,11 +1474,11 @@ var GrafanaClient = class {
|
|
|
1409
1474
|
throw e;
|
|
1410
1475
|
}
|
|
1411
1476
|
const all = Object.values(settings.datasources);
|
|
1412
|
-
const sameType = (type) => type === _optionalChain([ref, 'optionalAccess',
|
|
1413
|
-
const found = _optionalChain([ref, 'optionalAccess',
|
|
1414
|
-
(_optionalChain([ref, 'optionalAccess',
|
|
1477
|
+
const sameType = (type) => type === _optionalChain([ref, 'optionalAccess', _138 => _138.type]) || TYPE_ALIASES[type] === _optionalChain([ref, 'optionalAccess', _139 => _139.type]) || TYPE_ALIASES[_nullishCoalesce(_optionalChain([ref, 'optionalAccess', _140 => _140.type]), () => ( ""))] === type;
|
|
1478
|
+
const found = _optionalChain([ref, 'optionalAccess', _141 => _141.uid]) && !isPlaceholder(ref.uid) && all.find((d) => d.uid === ref.uid || d.name === ref.uid) || _optionalChain([ref, 'optionalAccess', _142 => _142.type]) && all.find((d) => sameType(d.type) && d.isDefault) || _optionalChain([ref, 'optionalAccess', _143 => _143.type]) && all.find((d) => sameType(d.type)) || // A ref that names a type this Grafana doesn't have must not run against some other datasource.
|
|
1479
|
+
(_optionalChain([ref, 'optionalAccess', _144 => _144.type]) ? void 0 : settings.datasources[settings.defaultDatasource]);
|
|
1415
1480
|
if (!found) {
|
|
1416
|
-
throw new GrafanaError(_optionalChain([ref, 'optionalAccess',
|
|
1481
|
+
throw new GrafanaError(_optionalChain([ref, 'optionalAccess', _145 => _145.type]) ? `No ${ref.type} datasource in this Grafana` : `No datasource matches ${JSON.stringify(ref)}`);
|
|
1417
1482
|
}
|
|
1418
1483
|
return { uid: found.uid, type: found.type };
|
|
1419
1484
|
}
|
|
@@ -1475,11 +1540,11 @@ var GrafanaDataSource = class {
|
|
|
1475
1540
|
};
|
|
1476
1541
|
var FIELD_TYPES = ["time", "number", "string", "boolean"];
|
|
1477
1542
|
function fromWire(frame) {
|
|
1478
|
-
const fields = _nullishCoalesce(_optionalChain([frame, 'access',
|
|
1479
|
-
const values = _nullishCoalesce(_optionalChain([frame, 'access',
|
|
1543
|
+
const fields = _nullishCoalesce(_optionalChain([frame, 'access', _146 => _146.schema, 'optionalAccess', _147 => _147.fields]), () => ( []));
|
|
1544
|
+
const values = _nullishCoalesce(_optionalChain([frame, 'access', _148 => _148.data, 'optionalAccess', _149 => _149.values]), () => ( []));
|
|
1480
1545
|
return {
|
|
1481
|
-
name: _optionalChain([frame, 'access',
|
|
1482
|
-
refId: _optionalChain([frame, 'access',
|
|
1546
|
+
name: _optionalChain([frame, 'access', _150 => _150.schema, 'optionalAccess', _151 => _151.name]),
|
|
1547
|
+
refId: _optionalChain([frame, 'access', _152 => _152.schema, 'optionalAccess', _153 => _153.refId]),
|
|
1483
1548
|
fields: fields.map((f, i) => ({
|
|
1484
1549
|
name: f.name,
|
|
1485
1550
|
type: FIELD_TYPES.includes(f.type) ? f.type : "other",
|
|
@@ -1558,7 +1623,7 @@ function buildFrames(target, entries, request, label) {
|
|
|
1558
1623
|
const fill = _nullishCoalesce(target.fillZero, () => ( (aggregate === "sum" || aggregate === "count")));
|
|
1559
1624
|
({ times, values } = bucketize(rows, aggregate, bucket, request.range, fill));
|
|
1560
1625
|
}
|
|
1561
|
-
const display = group == null ? name : _nullishCoalesce(_optionalChain([label, 'optionalCall',
|
|
1626
|
+
const display = group == null ? name : _nullishCoalesce(_optionalChain([label, 'optionalCall', _154 => _154(target.metric, group)]), () => ( group));
|
|
1562
1627
|
return {
|
|
1563
1628
|
name,
|
|
1564
1629
|
refId: target.refId,
|
|
@@ -1587,7 +1652,7 @@ function bucketize(rows, aggregate, bucket, range, fillZero) {
|
|
|
1587
1652
|
const keys = fillZero ? step.range(range.from, range.to) : [...sums.keys()].sort((a, b) => a - b);
|
|
1588
1653
|
const values = keys.map((k) => {
|
|
1589
1654
|
const vs = sums.get(k);
|
|
1590
|
-
if (!_optionalChain([vs, 'optionalAccess',
|
|
1655
|
+
if (!_optionalChain([vs, 'optionalAccess', _155 => _155.length])) return fillZero ? 0 : null;
|
|
1591
1656
|
switch (aggregate) {
|
|
1592
1657
|
case "sum":
|
|
1593
1658
|
case "count":
|
|
@@ -1681,17 +1746,17 @@ function parseGazetteer(json) {
|
|
|
1681
1746
|
};
|
|
1682
1747
|
if (Array.isArray(json)) {
|
|
1683
1748
|
for (const item of json) {
|
|
1684
|
-
const lat = Number(_nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
1685
|
-
const lon = Number(_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess',
|
|
1749
|
+
const lat = Number(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _156 => _156.latitude]), () => ( _optionalChain([item, 'optionalAccess', _157 => _157.lat]))));
|
|
1750
|
+
const lon = Number(_nullishCoalesce(_nullishCoalesce(_optionalChain([item, 'optionalAccess', _158 => _158.longitude]), () => ( _optionalChain([item, 'optionalAccess', _159 => _159.lon]))), () => ( _optionalChain([item, 'optionalAccess', _160 => _160.lng]))));
|
|
1686
1751
|
if (!Number.isFinite(lat) || !Number.isFinite(lon)) continue;
|
|
1687
1752
|
const p = { lon, lat };
|
|
1688
1753
|
add(item.key, p);
|
|
1689
1754
|
for (const k of [..._nullishCoalesce(item.keys, () => ( [])), ..._nullishCoalesce(item.keywords, () => ( []))]) add(k, p);
|
|
1690
1755
|
add(item.name, p);
|
|
1691
1756
|
}
|
|
1692
|
-
} else if (_optionalChain([json, 'optionalAccess',
|
|
1757
|
+
} else if (_optionalChain([json, 'optionalAccess', _161 => _161.type]) === "FeatureCollection") {
|
|
1693
1758
|
for (const f of _nullishCoalesce(json.features, () => ( []))) {
|
|
1694
|
-
const p = featurePoint(_optionalChain([f, 'optionalAccess',
|
|
1759
|
+
const p = featurePoint(_optionalChain([f, 'optionalAccess', _162 => _162.geometry]));
|
|
1695
1760
|
if (!p) continue;
|
|
1696
1761
|
add(f.id, p);
|
|
1697
1762
|
for (const v of Object.values(_nullishCoalesce(f.properties, () => ( {})))) if (typeof v === "string") add(v, p);
|
|
@@ -1700,7 +1765,7 @@ function parseGazetteer(json) {
|
|
|
1700
1765
|
return { find: (key) => _nullishCoalesce(exact.get(key), () => ( folded.get(key.toLowerCase()))) };
|
|
1701
1766
|
}
|
|
1702
1767
|
function featurePoint(geometry) {
|
|
1703
|
-
if (!_optionalChain([geometry, 'optionalAccess',
|
|
1768
|
+
if (!_optionalChain([geometry, 'optionalAccess', _163 => _163.coordinates])) return void 0;
|
|
1704
1769
|
if (geometry.type === "Point") {
|
|
1705
1770
|
const [lon, lat] = geometry.coordinates;
|
|
1706
1771
|
return Number.isFinite(lon) && Number.isFinite(lat) ? { lon, lat } : void 0;
|
|
@@ -1729,7 +1794,7 @@ function loadGazetteer(path, ds) {
|
|
|
1729
1794
|
const json = absolute ? fetch(path).then((r) => {
|
|
1730
1795
|
if (!r.ok) throw new Error(`${r.status} ${r.statusText}`);
|
|
1731
1796
|
return r.json();
|
|
1732
|
-
}) : _optionalChain([ds, 'optionalAccess',
|
|
1797
|
+
}) : _optionalChain([ds, 'optionalAccess', _164 => _164.publicFile]) ? ds.publicFile(path) : Promise.reject(new Error(`${path} is served by Grafana, and this dashboard has no Grafana connection`));
|
|
1733
1798
|
const run2 = json.then(parseGazetteer);
|
|
1734
1799
|
run2.catch(() => loaded.get(path) === run2 && loaded.delete(path));
|
|
1735
1800
|
loaded.set(path, run2);
|
|
@@ -1769,7 +1834,7 @@ function macro(path, format3, ctx) {
|
|
|
1769
1834
|
switch (head) {
|
|
1770
1835
|
case "__from":
|
|
1771
1836
|
case "__to": {
|
|
1772
|
-
const ms = head === "__from" ? _optionalChain([ctx, 'access',
|
|
1837
|
+
const ms = head === "__from" ? _optionalChain([ctx, 'access', _165 => _165.range, 'optionalAccess', _166 => _166.from]) : _optionalChain([ctx, 'access', _167 => _167.range, 'optionalAccess', _168 => _168.to]);
|
|
1773
1838
|
if (ms == null) return void 0;
|
|
1774
1839
|
if (format3 === "date" || format3 === "date:iso") return new Date(ms).toISOString();
|
|
1775
1840
|
if (format3 === "date:seconds") return String(Math.floor(ms / 1e3));
|
|
@@ -1806,13 +1871,13 @@ function macro(path, format3, ctx) {
|
|
|
1806
1871
|
}
|
|
1807
1872
|
return void 0;
|
|
1808
1873
|
case "__series":
|
|
1809
|
-
return rest[0] === "name" ? _nullishCoalesce(_nullishCoalesce(d.seriesName, () => ( _optionalChain([d, 'access',
|
|
1874
|
+
return rest[0] === "name" ? _nullishCoalesce(_nullishCoalesce(d.seriesName, () => ( _optionalChain([d, 'access', _169 => _169.frame, 'optionalAccess', _170 => _170.name]))), () => ( d.fieldName)) : void 0;
|
|
1810
1875
|
case "__data": {
|
|
1811
1876
|
const m = /^fields(?:\.([\w-]+)|\["([^"]*)"\]|\[(\d+)\])/.exec(rest.join("."));
|
|
1812
1877
|
if (!m || !d.frame || d.row == null) return void 0;
|
|
1813
1878
|
const key = _nullishCoalesce(m[1], () => ( m[2]));
|
|
1814
|
-
const f = key != null ? d.frame.fields.find((x) => x.name === key || _optionalChain([x, 'access',
|
|
1815
|
-
const v = _optionalChain([f, 'optionalAccess',
|
|
1879
|
+
const f = key != null ? d.frame.fields.find((x) => x.name === key || _optionalChain([x, 'access', _171 => _171.config, 'optionalAccess', _172 => _172.displayName]) === key) : d.frame.fields[Number(m[3])];
|
|
1880
|
+
const v = _optionalChain([f, 'optionalAccess', _173 => _173.values, 'access', _174 => _174[d.row]]);
|
|
1816
1881
|
if (v == null) return void 0;
|
|
1817
1882
|
return f.type === "time" ? String(toMillis(v)) : String(v);
|
|
1818
1883
|
}
|
|
@@ -1823,9 +1888,9 @@ function urlTime(raw, ms) {
|
|
|
1823
1888
|
return raw.trim().startsWith("now") ? encodeURIComponent(raw.trim()) : String(ms);
|
|
1824
1889
|
}
|
|
1825
1890
|
function allVariables(ctx) {
|
|
1826
|
-
const names = (_nullishCoalesce(_optionalChain([ctx, 'access',
|
|
1891
|
+
const names = (_nullishCoalesce(_optionalChain([ctx, 'access', _175 => _175.dashboard, 'optionalAccess', _176 => _176.templating, 'optionalAccess', _177 => _177.list]), () => ( []))).filter((v) => v.type !== "adhoc").map((v) => v.name);
|
|
1827
1892
|
return (names.length ? names : Object.keys(ctx.values)).flatMap((n) => {
|
|
1828
|
-
const v = _nullishCoalesce(_optionalChain([ctx, 'access',
|
|
1893
|
+
const v = _nullishCoalesce(_optionalChain([ctx, 'access', _178 => _178.scoped, 'optionalAccess', _179 => _179[n], 'optionalAccess', _180 => _180.value]), () => ( ctx.values[n]));
|
|
1829
1894
|
return v == null ? [] : [queryParam(n, v)];
|
|
1830
1895
|
}).join("&");
|
|
1831
1896
|
}
|
|
@@ -1836,7 +1901,7 @@ function parseDashboardLink(href, grafanaUrl) {
|
|
|
1836
1901
|
const base = grafanaUrl ? /^(?:[a-z][a-z0-9+.-]*:)?\/\/([^/?#]+)([^?#]*)/i.exec(grafanaUrl.trim()) : null;
|
|
1837
1902
|
if (host && (!base || base[1].toLowerCase() !== host.toLowerCase())) return null;
|
|
1838
1903
|
if (scheme && !/^https?:$/i.test(scheme)) return null;
|
|
1839
|
-
const prefix = (_nullishCoalesce(_optionalChain([base, 'optionalAccess',
|
|
1904
|
+
const prefix = (_nullishCoalesce(_optionalChain([base, 'optionalAccess', _181 => _181[2]]), () => ( ""))).replace(/\/+$/, "");
|
|
1840
1905
|
const path = prefix && rawPath.startsWith(prefix + "/") ? rawPath.slice(prefix.length) : rawPath;
|
|
1841
1906
|
const p = /^\/d\/([^/]+)(?:\/[^/]*)?\/?$/.exec(path);
|
|
1842
1907
|
if (!p) return null;
|
|
@@ -1860,12 +1925,12 @@ function decode(s) {
|
|
|
1860
1925
|
}
|
|
1861
1926
|
}
|
|
1862
1927
|
function applyDashboardLink(dashboard, target) {
|
|
1863
|
-
const time = target.from || target.to ? { from: target.from || _optionalChain([dashboard, 'access',
|
|
1864
|
-
const list = _optionalChain([dashboard, 'access',
|
|
1928
|
+
const time = target.from || target.to ? { from: target.from || _optionalChain([dashboard, 'access', _182 => _182.time, 'optionalAccess', _183 => _183.from]) || "now-6h", to: target.to || _optionalChain([dashboard, 'access', _184 => _184.time, 'optionalAccess', _185 => _185.to]) || "now" } : dashboard.time;
|
|
1929
|
+
const list = _optionalChain([dashboard, 'access', _186 => _186.templating, 'optionalAccess', _187 => _187.list, 'access', _188 => _188.map, 'call', _189 => _189((v) => {
|
|
1865
1930
|
const values = target.vars[v.name];
|
|
1866
|
-
if (!_optionalChain([values, 'optionalAccess',
|
|
1931
|
+
if (!_optionalChain([values, 'optionalAccess', _190 => _190.length])) return v;
|
|
1867
1932
|
const value = v.multi ? values : values[0];
|
|
1868
|
-
const text = (Array.isArray(value) ? value : [value]).map((x) => x === "$__all" ? "All" : _nullishCoalesce(_optionalChain([v, 'access',
|
|
1933
|
+
const text = (Array.isArray(value) ? value : [value]).map((x) => x === "$__all" ? "All" : _nullishCoalesce(_optionalChain([v, 'access', _191 => _191.options, 'optionalAccess', _192 => _192.find, 'call', _193 => _193((o) => o.value === x), 'optionalAccess', _194 => _194.text]), () => ( x)));
|
|
1869
1934
|
return { ...v, current: { text: v.multi ? text : text[0], value } };
|
|
1870
1935
|
})]);
|
|
1871
1936
|
return { ...dashboard, time, templating: list ? { ...dashboard.templating, list } : dashboard.templating };
|
|
@@ -2189,7 +2254,8 @@ var dashboard_schema_default = {
|
|
|
2189
2254
|
"input-rating",
|
|
2190
2255
|
"input-text",
|
|
2191
2256
|
"input-counter",
|
|
2192
|
-
"input-duration"
|
|
2257
|
+
"input-duration",
|
|
2258
|
+
"input-group"
|
|
2193
2259
|
]
|
|
2194
2260
|
},
|
|
2195
2261
|
title: {
|
|
@@ -2324,7 +2390,7 @@ var dashboard_schema_default = {
|
|
|
2324
2390
|
if: {
|
|
2325
2391
|
properties: {
|
|
2326
2392
|
type: {
|
|
2327
|
-
pattern: "^input-"
|
|
2393
|
+
pattern: "^input-(?!group$)"
|
|
2328
2394
|
}
|
|
2329
2395
|
},
|
|
2330
2396
|
required: [
|
|
@@ -2341,6 +2407,28 @@ var dashboard_schema_default = {
|
|
|
2341
2407
|
}
|
|
2342
2408
|
}
|
|
2343
2409
|
}
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
if: {
|
|
2413
|
+
properties: {
|
|
2414
|
+
type: {
|
|
2415
|
+
const: "input-group"
|
|
2416
|
+
}
|
|
2417
|
+
},
|
|
2418
|
+
required: [
|
|
2419
|
+
"type"
|
|
2420
|
+
]
|
|
2421
|
+
},
|
|
2422
|
+
then: {
|
|
2423
|
+
required: [
|
|
2424
|
+
"options"
|
|
2425
|
+
],
|
|
2426
|
+
properties: {
|
|
2427
|
+
options: {
|
|
2428
|
+
$ref: "#/definitions/InputGroupOptions"
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2344
2432
|
}
|
|
2345
2433
|
]
|
|
2346
2434
|
},
|
|
@@ -2995,6 +3083,94 @@ var dashboard_schema_default = {
|
|
|
2995
3083
|
"label",
|
|
2996
3084
|
"value"
|
|
2997
3085
|
]
|
|
3086
|
+
},
|
|
3087
|
+
InputGroupOptions: {
|
|
3088
|
+
type: "object",
|
|
3089
|
+
properties: {
|
|
3090
|
+
fields: {
|
|
3091
|
+
type: "array",
|
|
3092
|
+
items: {
|
|
3093
|
+
$ref: "#/definitions/GroupField"
|
|
3094
|
+
},
|
|
3095
|
+
description: "The inputs each item has. Any input type but input-counter."
|
|
3096
|
+
},
|
|
3097
|
+
itemTitle: {
|
|
3098
|
+
type: "string",
|
|
3099
|
+
description: 'Items are titled "<itemTitle> 1", "<itemTitle> 2"\u2026 (default "Item").'
|
|
3100
|
+
},
|
|
3101
|
+
titleFrom: {
|
|
3102
|
+
type: "string",
|
|
3103
|
+
description: "A field's metric whose value titles its item once it has one."
|
|
3104
|
+
},
|
|
3105
|
+
min: {
|
|
3106
|
+
type: "number",
|
|
3107
|
+
description: "Fewest items Save accepts (default 0). Items left completely empty don't count."
|
|
3108
|
+
},
|
|
3109
|
+
max: {
|
|
3110
|
+
type: "number",
|
|
3111
|
+
description: "Most items the user can add."
|
|
3112
|
+
},
|
|
3113
|
+
start: {
|
|
3114
|
+
anyOf: [
|
|
3115
|
+
{
|
|
3116
|
+
type: "number"
|
|
3117
|
+
},
|
|
3118
|
+
{
|
|
3119
|
+
type: "string",
|
|
3120
|
+
const: "last"
|
|
3121
|
+
}
|
|
3122
|
+
],
|
|
3123
|
+
description: 'Empty items a new form starts with (default 1), or "last" for the items saved last time.'
|
|
3124
|
+
},
|
|
3125
|
+
addLabel: {
|
|
3126
|
+
type: "string",
|
|
3127
|
+
description: 'Text of the add button (default "Add <itemTitle>").'
|
|
3128
|
+
}
|
|
3129
|
+
},
|
|
3130
|
+
required: [
|
|
3131
|
+
"fields"
|
|
3132
|
+
],
|
|
3133
|
+
description: "input-group: fields filled in once per item, for as many items as the user adds (the entree and sides of a meal, the sets of a workout). Each field records to its own metric; entries of one item share `save` and `item`."
|
|
3134
|
+
},
|
|
3135
|
+
GroupField: {
|
|
3136
|
+
type: "object",
|
|
3137
|
+
properties: {
|
|
3138
|
+
type: {
|
|
3139
|
+
$ref: "#/definitions/InputType"
|
|
3140
|
+
},
|
|
3141
|
+
title: {
|
|
3142
|
+
type: "string"
|
|
3143
|
+
},
|
|
3144
|
+
description: {
|
|
3145
|
+
type: "string"
|
|
3146
|
+
},
|
|
3147
|
+
span: {
|
|
3148
|
+
type: "number",
|
|
3149
|
+
description: "Width inside an item, out of 24 (default 24)."
|
|
3150
|
+
},
|
|
3151
|
+
options: {
|
|
3152
|
+
$ref: "#/definitions/InputOptions"
|
|
3153
|
+
}
|
|
3154
|
+
},
|
|
3155
|
+
required: [
|
|
3156
|
+
"type",
|
|
3157
|
+
"options"
|
|
3158
|
+
],
|
|
3159
|
+
description: "One field of an input-group: an input panel without `id` or `gridPos`, `span` columns (of 24) wide in its item."
|
|
3160
|
+
},
|
|
3161
|
+
InputType: {
|
|
3162
|
+
type: "string",
|
|
3163
|
+
enum: [
|
|
3164
|
+
"input-number",
|
|
3165
|
+
"input-slider",
|
|
3166
|
+
"input-select",
|
|
3167
|
+
"input-toggle",
|
|
3168
|
+
"input-rating",
|
|
3169
|
+
"input-text",
|
|
3170
|
+
"input-counter",
|
|
3171
|
+
"input-duration"
|
|
3172
|
+
],
|
|
3173
|
+
description: 'Input forms reuse the dashboard format: a form is a dashboard whose panels have `input-*` types. Layout, rows and gridPos work exactly like visualization panels, so one layout engine (and one hot-reloadable JSON file) drives both tabs.\n\n { "type": "input-number", "title": "Weight", "gridPos": {"x":0,"y":0,"w":12,"h":3}, "options": { "metric": "weight", "unit": "kg", "step": 0.1, "default": "last" } }'
|
|
2998
3174
|
}
|
|
2999
3175
|
}
|
|
3000
3176
|
};
|
|
@@ -3551,8 +3727,8 @@ function validate12(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3551
3727
|
validate12.errors = vErrors;
|
|
3552
3728
|
return errors === 0;
|
|
3553
3729
|
}
|
|
3554
|
-
var schema18 = { "type": "object", "properties": { "id": { "type": "number" }, "type": { "type": "string", "examples": ["row", "timeseries", "trend", "xychart", "stat", "gauge", "bargauge", "piechart", "barchart", "table", "text", "geomap", "input-number", "input-slider", "input-select", "input-toggle", "input-rating", "input-text", "input-counter", "input-duration"] }, "title": { "type": "string" }, "description": { "type": "string" }, "gridPos": { "$ref": "#/definitions/GridPos" }, "datasource": { "anyOf": [{ "$ref": "#/definitions/DataSourceRef" }, { "type": "string" }, { "type": "null" }] }, "targets": { "type": "array", "items": { "$ref": "#/definitions/Target" } }, "fieldConfig": { "type": "object", "properties": { "defaults": { "$ref": "#/definitions/FieldConfig" }, "overrides": { "type": "array", "items": { "$ref": "#/definitions/FieldOverride" } } } }, "options": { "type": "object" }, "transformations": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "options": { "type": "object" }, "disabled": { "type": "boolean" } }, "required": ["id"] }, "description": "Applied in order to the query results. See transform.ts for the ones modelform implements." }, "collapsed": { "type": "boolean", "description": "Rows only." }, "panels": { "type": "array", "items": { "$ref": "#/definitions/Panel" }, "description": "Rows only: children of a collapsed row live here instead of at the top level." }, "repeat": { "type": "string", "description": "Repeat this row (or panel) once per selected value of the named variable." }, "repeatDirection": { "type": "string", "enum": ["h", "v"], "description": "Panel repeats: side by side (`h`, wrapping at maxPerRow) or stacked (`v`)." }, "maxPerRow": { "type": "number" }, "scopedVars": { "type": "object", "additionalProperties": { "type": "object", "properties": { "text": { "type": "string" }, "value": { "type": "string" } }, "required": ["text", "value"] }, "description": "Set on each copy of a repeated row or panel: the single value it was repeated for." }, "mobile": { "$ref": "#/definitions/MobileOptions" }, "links": { "type": "array", "items": { "$ref": "#/definitions/DataLink" }, "description": "Panel links, from the panel header menu in Grafana." } }, "required": ["type", "gridPos"], "additionalProperties": {}, "allOf": [{ "if": { "properties": { "type": { "pattern": "^input-" } }, "required": ["type"] }, "then": { "required": ["options"], "properties": { "options": { "$ref": "#/definitions/InputOptions" } } } }] };
|
|
3555
|
-
var pattern1 = new RegExp("^input-", "u");
|
|
3730
|
+
var schema18 = { "type": "object", "properties": { "id": { "type": "number" }, "type": { "type": "string", "examples": ["row", "timeseries", "trend", "xychart", "stat", "gauge", "bargauge", "piechart", "barchart", "table", "text", "geomap", "input-number", "input-slider", "input-select", "input-toggle", "input-rating", "input-text", "input-counter", "input-duration", "input-group"] }, "title": { "type": "string" }, "description": { "type": "string" }, "gridPos": { "$ref": "#/definitions/GridPos" }, "datasource": { "anyOf": [{ "$ref": "#/definitions/DataSourceRef" }, { "type": "string" }, { "type": "null" }] }, "targets": { "type": "array", "items": { "$ref": "#/definitions/Target" } }, "fieldConfig": { "type": "object", "properties": { "defaults": { "$ref": "#/definitions/FieldConfig" }, "overrides": { "type": "array", "items": { "$ref": "#/definitions/FieldOverride" } } } }, "options": { "type": "object" }, "transformations": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "options": { "type": "object" }, "disabled": { "type": "boolean" } }, "required": ["id"] }, "description": "Applied in order to the query results. See transform.ts for the ones modelform implements." }, "collapsed": { "type": "boolean", "description": "Rows only." }, "panels": { "type": "array", "items": { "$ref": "#/definitions/Panel" }, "description": "Rows only: children of a collapsed row live here instead of at the top level." }, "repeat": { "type": "string", "description": "Repeat this row (or panel) once per selected value of the named variable." }, "repeatDirection": { "type": "string", "enum": ["h", "v"], "description": "Panel repeats: side by side (`h`, wrapping at maxPerRow) or stacked (`v`)." }, "maxPerRow": { "type": "number" }, "scopedVars": { "type": "object", "additionalProperties": { "type": "object", "properties": { "text": { "type": "string" }, "value": { "type": "string" } }, "required": ["text", "value"] }, "description": "Set on each copy of a repeated row or panel: the single value it was repeated for." }, "mobile": { "$ref": "#/definitions/MobileOptions" }, "links": { "type": "array", "items": { "$ref": "#/definitions/DataLink" }, "description": "Panel links, from the panel header menu in Grafana." } }, "required": ["type", "gridPos"], "additionalProperties": {}, "allOf": [{ "if": { "properties": { "type": { "pattern": "^input-(?!group$)" } }, "required": ["type"] }, "then": { "required": ["options"], "properties": { "options": { "$ref": "#/definitions/InputOptions" } } } }, { "if": { "properties": { "type": { "const": "input-group" } }, "required": ["type"] }, "then": { "required": ["options"], "properties": { "options": { "$ref": "#/definitions/InputGroupOptions" } } } }] };
|
|
3731
|
+
var pattern1 = new RegExp("^input-(?!group$)", "u");
|
|
3556
3732
|
var schema19 = { "type": "object", "properties": { "metric": { "type": "string", "description": "The metric this input records to. Visualization queries select data by this name." }, "unit": { "type": "string" }, "min": { "type": "number" }, "max": { "type": "number" }, "step": { "type": "number" }, "placeholder": { "type": "string" }, "labels": { "type": "array", "items": { "type": "string" }, "description": 'input-slider only: text spaced evenly along the track, first at min and last at max, e.g. ["Understeer", "Neutral", "Oversteer"]. Replaces the numeric min/max labels.' }, "default": { "anyOf": [{ "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "type": "string", "const": "last" }], "description": 'Initial value: a literal, or "last" to start from the most recent entry.' }, "record": { "type": "string", "enum": ["changed", "always"], "description": '"changed" (the default) records the value only when it was edited before Save; "always" records it on every Save, so a default like "last" is kept with each save.' }, "required": { "type": "boolean", "description": "Save waits until this has a value." }, "choices": { "type": "array", "items": { "$ref": "#/definitions/InputChoice" }, "description": "input-select only." }, "choicesFrom": { "type": "string", "description": "input-select only: take the choices from the app at runtime instead of `choices`, for lists that live in app data (e.g. wheel sets). Names a key of InputForm's `choices` prop." }, "multi": { "type": "boolean", "description": "input-select only: allow selecting several. Each selection is recorded as its own entry." }, "increment": { "type": "number", "description": "input-counter only: the amount each tap records (default 1)." }, "suggest": { "type": "boolean", "description": "input-text only: a single-line field that suggests values recorded earlier, matching what's typed." }, "suggestWith": { "type": "string", "description": "input-text with `suggest` only: another input's metric whose current value narrows the suggestions to values saved alongside it (e.g. configurations of the chosen track). Falls back to every earlier value when none were." } }, "required": ["metric"] };
|
|
3557
3733
|
var schema20 = { "type": "object", "properties": { "label": { "type": "string" }, "value": { "type": ["number", "string"] } }, "required": ["label", "value"] };
|
|
3558
3734
|
function validate19(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
@@ -3912,7 +4088,260 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3912
4088
|
validate19.errors = vErrors;
|
|
3913
4089
|
return errors === 0;
|
|
3914
4090
|
}
|
|
4091
|
+
var schema23 = { "type": "string", "enum": ["input-number", "input-slider", "input-select", "input-toggle", "input-rating", "input-text", "input-counter", "input-duration"], "description": 'Input forms reuse the dashboard format: a form is a dashboard whose panels have `input-*` types. Layout, rows and gridPos work exactly like visualization panels, so one layout engine (and one hot-reloadable JSON file) drives both tabs.\n\n { "type": "input-number", "title": "Weight", "gridPos": {"x":0,"y":0,"w":12,"h":3}, "options": { "metric": "weight", "unit": "kg", "step": 0.1, "default": "last" } }' };
|
|
4092
|
+
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
4093
|
+
let vErrors = null;
|
|
4094
|
+
let errors = 0;
|
|
4095
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
4096
|
+
if (data.type === void 0) {
|
|
4097
|
+
const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
4098
|
+
if (vErrors === null) {
|
|
4099
|
+
vErrors = [err0];
|
|
4100
|
+
} else {
|
|
4101
|
+
vErrors.push(err0);
|
|
4102
|
+
}
|
|
4103
|
+
errors++;
|
|
4104
|
+
}
|
|
4105
|
+
if (data.options === void 0) {
|
|
4106
|
+
const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "options" }, message: "must have required property 'options'" };
|
|
4107
|
+
if (vErrors === null) {
|
|
4108
|
+
vErrors = [err1];
|
|
4109
|
+
} else {
|
|
4110
|
+
vErrors.push(err1);
|
|
4111
|
+
}
|
|
4112
|
+
errors++;
|
|
4113
|
+
}
|
|
4114
|
+
if (data.type !== void 0) {
|
|
4115
|
+
let data0 = data.type;
|
|
4116
|
+
if (typeof data0 !== "string") {
|
|
4117
|
+
const err2 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/InputType/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
4118
|
+
if (vErrors === null) {
|
|
4119
|
+
vErrors = [err2];
|
|
4120
|
+
} else {
|
|
4121
|
+
vErrors.push(err2);
|
|
4122
|
+
}
|
|
4123
|
+
errors++;
|
|
4124
|
+
}
|
|
4125
|
+
if (!(data0 === "input-number" || data0 === "input-slider" || data0 === "input-select" || data0 === "input-toggle" || data0 === "input-rating" || data0 === "input-text" || data0 === "input-counter" || data0 === "input-duration")) {
|
|
4126
|
+
const err3 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/InputType/enum", keyword: "enum", params: { allowedValues: schema23.enum }, message: "must be equal to one of the allowed values" };
|
|
4127
|
+
if (vErrors === null) {
|
|
4128
|
+
vErrors = [err3];
|
|
4129
|
+
} else {
|
|
4130
|
+
vErrors.push(err3);
|
|
4131
|
+
}
|
|
4132
|
+
errors++;
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
if (data.title !== void 0) {
|
|
4136
|
+
if (typeof data.title !== "string") {
|
|
4137
|
+
const err4 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
4138
|
+
if (vErrors === null) {
|
|
4139
|
+
vErrors = [err4];
|
|
4140
|
+
} else {
|
|
4141
|
+
vErrors.push(err4);
|
|
4142
|
+
}
|
|
4143
|
+
errors++;
|
|
4144
|
+
}
|
|
4145
|
+
}
|
|
4146
|
+
if (data.description !== void 0) {
|
|
4147
|
+
if (typeof data.description !== "string") {
|
|
4148
|
+
const err5 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
4149
|
+
if (vErrors === null) {
|
|
4150
|
+
vErrors = [err5];
|
|
4151
|
+
} else {
|
|
4152
|
+
vErrors.push(err5);
|
|
4153
|
+
}
|
|
4154
|
+
errors++;
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
if (data.span !== void 0) {
|
|
4158
|
+
if (!(typeof data.span == "number")) {
|
|
4159
|
+
const err6 = { instancePath: instancePath + "/span", schemaPath: "#/properties/span/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
4160
|
+
if (vErrors === null) {
|
|
4161
|
+
vErrors = [err6];
|
|
4162
|
+
} else {
|
|
4163
|
+
vErrors.push(err6);
|
|
4164
|
+
}
|
|
4165
|
+
errors++;
|
|
4166
|
+
}
|
|
4167
|
+
}
|
|
4168
|
+
if (data.options !== void 0) {
|
|
4169
|
+
if (!validate19(data.options, { instancePath: instancePath + "/options", parentData: data, parentDataProperty: "options", rootData })) {
|
|
4170
|
+
vErrors = vErrors === null ? validate19.errors : vErrors.concat(validate19.errors);
|
|
4171
|
+
errors = vErrors.length;
|
|
4172
|
+
}
|
|
4173
|
+
}
|
|
4174
|
+
} else {
|
|
4175
|
+
const err7 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
4176
|
+
if (vErrors === null) {
|
|
4177
|
+
vErrors = [err7];
|
|
4178
|
+
} else {
|
|
4179
|
+
vErrors.push(err7);
|
|
4180
|
+
}
|
|
4181
|
+
errors++;
|
|
4182
|
+
}
|
|
4183
|
+
validate22.errors = vErrors;
|
|
4184
|
+
return errors === 0;
|
|
4185
|
+
}
|
|
3915
4186
|
function validate21(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
4187
|
+
let vErrors = null;
|
|
4188
|
+
let errors = 0;
|
|
4189
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
4190
|
+
if (data.fields === void 0) {
|
|
4191
|
+
const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "fields" }, message: "must have required property 'fields'" };
|
|
4192
|
+
if (vErrors === null) {
|
|
4193
|
+
vErrors = [err0];
|
|
4194
|
+
} else {
|
|
4195
|
+
vErrors.push(err0);
|
|
4196
|
+
}
|
|
4197
|
+
errors++;
|
|
4198
|
+
}
|
|
4199
|
+
if (data.fields !== void 0) {
|
|
4200
|
+
let data0 = data.fields;
|
|
4201
|
+
if (Array.isArray(data0)) {
|
|
4202
|
+
const len0 = data0.length;
|
|
4203
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
4204
|
+
if (!validate22(data0[i0], { instancePath: instancePath + "/fields/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
|
|
4205
|
+
vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
|
|
4206
|
+
errors = vErrors.length;
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4209
|
+
} else {
|
|
4210
|
+
const err1 = { instancePath: instancePath + "/fields", schemaPath: "#/properties/fields/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
4211
|
+
if (vErrors === null) {
|
|
4212
|
+
vErrors = [err1];
|
|
4213
|
+
} else {
|
|
4214
|
+
vErrors.push(err1);
|
|
4215
|
+
}
|
|
4216
|
+
errors++;
|
|
4217
|
+
}
|
|
4218
|
+
}
|
|
4219
|
+
if (data.itemTitle !== void 0) {
|
|
4220
|
+
if (typeof data.itemTitle !== "string") {
|
|
4221
|
+
const err2 = { instancePath: instancePath + "/itemTitle", schemaPath: "#/properties/itemTitle/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
4222
|
+
if (vErrors === null) {
|
|
4223
|
+
vErrors = [err2];
|
|
4224
|
+
} else {
|
|
4225
|
+
vErrors.push(err2);
|
|
4226
|
+
}
|
|
4227
|
+
errors++;
|
|
4228
|
+
}
|
|
4229
|
+
}
|
|
4230
|
+
if (data.titleFrom !== void 0) {
|
|
4231
|
+
if (typeof data.titleFrom !== "string") {
|
|
4232
|
+
const err3 = { instancePath: instancePath + "/titleFrom", schemaPath: "#/properties/titleFrom/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
4233
|
+
if (vErrors === null) {
|
|
4234
|
+
vErrors = [err3];
|
|
4235
|
+
} else {
|
|
4236
|
+
vErrors.push(err3);
|
|
4237
|
+
}
|
|
4238
|
+
errors++;
|
|
4239
|
+
}
|
|
4240
|
+
}
|
|
4241
|
+
if (data.min !== void 0) {
|
|
4242
|
+
if (!(typeof data.min == "number")) {
|
|
4243
|
+
const err4 = { instancePath: instancePath + "/min", schemaPath: "#/properties/min/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
4244
|
+
if (vErrors === null) {
|
|
4245
|
+
vErrors = [err4];
|
|
4246
|
+
} else {
|
|
4247
|
+
vErrors.push(err4);
|
|
4248
|
+
}
|
|
4249
|
+
errors++;
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
if (data.max !== void 0) {
|
|
4253
|
+
if (!(typeof data.max == "number")) {
|
|
4254
|
+
const err5 = { instancePath: instancePath + "/max", schemaPath: "#/properties/max/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
4255
|
+
if (vErrors === null) {
|
|
4256
|
+
vErrors = [err5];
|
|
4257
|
+
} else {
|
|
4258
|
+
vErrors.push(err5);
|
|
4259
|
+
}
|
|
4260
|
+
errors++;
|
|
4261
|
+
}
|
|
4262
|
+
}
|
|
4263
|
+
if (data.start !== void 0) {
|
|
4264
|
+
let data6 = data.start;
|
|
4265
|
+
const _errs13 = errors;
|
|
4266
|
+
let valid3 = false;
|
|
4267
|
+
const _errs14 = errors;
|
|
4268
|
+
if (!(typeof data6 == "number")) {
|
|
4269
|
+
const err6 = { instancePath: instancePath + "/start", schemaPath: "#/properties/start/anyOf/0/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
4270
|
+
if (vErrors === null) {
|
|
4271
|
+
vErrors = [err6];
|
|
4272
|
+
} else {
|
|
4273
|
+
vErrors.push(err6);
|
|
4274
|
+
}
|
|
4275
|
+
errors++;
|
|
4276
|
+
}
|
|
4277
|
+
var _valid0 = _errs14 === errors;
|
|
4278
|
+
valid3 = valid3 || _valid0;
|
|
4279
|
+
if (!valid3) {
|
|
4280
|
+
const _errs16 = errors;
|
|
4281
|
+
if (typeof data6 !== "string") {
|
|
4282
|
+
const err7 = { instancePath: instancePath + "/start", schemaPath: "#/properties/start/anyOf/1/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
4283
|
+
if (vErrors === null) {
|
|
4284
|
+
vErrors = [err7];
|
|
4285
|
+
} else {
|
|
4286
|
+
vErrors.push(err7);
|
|
4287
|
+
}
|
|
4288
|
+
errors++;
|
|
4289
|
+
}
|
|
4290
|
+
if ("last" !== data6) {
|
|
4291
|
+
const err8 = { instancePath: instancePath + "/start", schemaPath: "#/properties/start/anyOf/1/const", keyword: "const", params: { allowedValue: "last" }, message: "must be equal to constant" };
|
|
4292
|
+
if (vErrors === null) {
|
|
4293
|
+
vErrors = [err8];
|
|
4294
|
+
} else {
|
|
4295
|
+
vErrors.push(err8);
|
|
4296
|
+
}
|
|
4297
|
+
errors++;
|
|
4298
|
+
}
|
|
4299
|
+
var _valid0 = _errs16 === errors;
|
|
4300
|
+
valid3 = valid3 || _valid0;
|
|
4301
|
+
}
|
|
4302
|
+
if (!valid3) {
|
|
4303
|
+
const err9 = { instancePath: instancePath + "/start", schemaPath: "#/properties/start/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
4304
|
+
if (vErrors === null) {
|
|
4305
|
+
vErrors = [err9];
|
|
4306
|
+
} else {
|
|
4307
|
+
vErrors.push(err9);
|
|
4308
|
+
}
|
|
4309
|
+
errors++;
|
|
4310
|
+
} else {
|
|
4311
|
+
errors = _errs13;
|
|
4312
|
+
if (vErrors !== null) {
|
|
4313
|
+
if (_errs13) {
|
|
4314
|
+
vErrors.length = _errs13;
|
|
4315
|
+
} else {
|
|
4316
|
+
vErrors = null;
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
}
|
|
4320
|
+
}
|
|
4321
|
+
if (data.addLabel !== void 0) {
|
|
4322
|
+
if (typeof data.addLabel !== "string") {
|
|
4323
|
+
const err10 = { instancePath: instancePath + "/addLabel", schemaPath: "#/properties/addLabel/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
4324
|
+
if (vErrors === null) {
|
|
4325
|
+
vErrors = [err10];
|
|
4326
|
+
} else {
|
|
4327
|
+
vErrors.push(err10);
|
|
4328
|
+
}
|
|
4329
|
+
errors++;
|
|
4330
|
+
}
|
|
4331
|
+
}
|
|
4332
|
+
} else {
|
|
4333
|
+
const err11 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
4334
|
+
if (vErrors === null) {
|
|
4335
|
+
vErrors = [err11];
|
|
4336
|
+
} else {
|
|
4337
|
+
vErrors.push(err11);
|
|
4338
|
+
}
|
|
4339
|
+
errors++;
|
|
4340
|
+
}
|
|
4341
|
+
validate21.errors = vErrors;
|
|
4342
|
+
return errors === 0;
|
|
4343
|
+
}
|
|
4344
|
+
function validate26(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3916
4345
|
let vErrors = null;
|
|
3917
4346
|
let errors = 0;
|
|
3918
4347
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -4064,13 +4493,13 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4064
4493
|
}
|
|
4065
4494
|
errors++;
|
|
4066
4495
|
}
|
|
4067
|
-
|
|
4496
|
+
validate26.errors = vErrors;
|
|
4068
4497
|
return errors === 0;
|
|
4069
4498
|
}
|
|
4070
|
-
var
|
|
4071
|
-
var
|
|
4072
|
-
var
|
|
4073
|
-
function
|
|
4499
|
+
var schema28 = { "type": "object", "properties": { "unit": { "type": "string" }, "min": { "type": "number" }, "max": { "type": "number" }, "decimals": { "type": "number" }, "displayName": { "type": "string" }, "color": { "type": "object", "properties": { "mode": { "type": "string" }, "fixedColor": { "type": "string" } } }, "thresholds": { "type": "object", "properties": { "mode": { "type": "string", "enum": ["absolute", "percentage"] }, "steps": { "type": "array", "items": { "$ref": "#/definitions/ThresholdStep" } } }, "required": ["steps"] }, "mappings": { "type": "array", "items": { "$ref": "#/definitions/ValueMapping" } }, "links": { "type": "array", "items": { "$ref": "#/definitions/DataLink" }, "description": "Data links: opened from a point, cell or value of this field." }, "custom": { "type": "object", "properties": { "drawStyle": { "type": "string", "enum": ["line", "bars", "points"] }, "lineWidth": { "type": "number" }, "fillOpacity": { "type": "number" }, "showPoints": { "type": "string", "enum": ["auto", "always", "never"] } }, "additionalProperties": {} } }, "additionalProperties": {} };
|
|
4500
|
+
var schema29 = { "type": "object", "properties": { "value": { "type": ["number", "null"] }, "color": { "type": "string" } }, "required": ["value", "color"] };
|
|
4501
|
+
var schema30 = { "anyOf": [{ "type": "object", "properties": { "type": { "type": "string", "const": "value" }, "options": { "type": "object", "additionalProperties": { "$ref": "#/definitions/MappingResult" } } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string", "const": "range" }, "options": { "type": "object", "properties": { "from": { "type": ["number", "null"] }, "to": { "type": ["number", "null"] }, "result": { "$ref": "#/definitions/MappingResult" } }, "required": ["result"] } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string", "const": "regex" }, "options": { "type": "object", "properties": { "pattern": { "type": "string" }, "result": { "$ref": "#/definitions/MappingResult" } }, "required": ["pattern", "result"] } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string", "const": "special" }, "options": { "type": "object", "properties": { "match": { "type": "string", "enum": ["null", "nan", "null+nan", "true", "false", "empty"] }, "result": { "$ref": "#/definitions/MappingResult" } }, "required": ["match", "result"] } }, "required": ["type", "options"] }, { "type": "object", "properties": { "type": { "type": "string" }, "options": {} }, "required": ["type"] }], "description": "Grafana value mappings: display text (and optionally a color) in place of a value." };
|
|
4502
|
+
function validate29(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
4074
4503
|
let vErrors = null;
|
|
4075
4504
|
let errors = 0;
|
|
4076
4505
|
const _errs0 = errors;
|
|
@@ -4243,7 +4672,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4243
4672
|
if (data7.from !== void 0) {
|
|
4244
4673
|
let data8 = data7.from;
|
|
4245
4674
|
if (!(typeof data8 == "number") && data8 !== null) {
|
|
4246
|
-
const err15 = { instancePath: instancePath + "/options/from", schemaPath: "#/anyOf/1/properties/options/properties/from/type", keyword: "type", params: { type:
|
|
4675
|
+
const err15 = { instancePath: instancePath + "/options/from", schemaPath: "#/anyOf/1/properties/options/properties/from/type", keyword: "type", params: { type: schema30.anyOf[1].properties.options.properties.from.type }, message: "must be number,null" };
|
|
4247
4676
|
if (vErrors === null) {
|
|
4248
4677
|
vErrors = [err15];
|
|
4249
4678
|
} else {
|
|
@@ -4255,7 +4684,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4255
4684
|
if (data7.to !== void 0) {
|
|
4256
4685
|
let data9 = data7.to;
|
|
4257
4686
|
if (!(typeof data9 == "number") && data9 !== null) {
|
|
4258
|
-
const err16 = { instancePath: instancePath + "/options/to", schemaPath: "#/anyOf/1/properties/options/properties/to/type", keyword: "type", params: { type:
|
|
4687
|
+
const err16 = { instancePath: instancePath + "/options/to", schemaPath: "#/anyOf/1/properties/options/properties/to/type", keyword: "type", params: { type: schema30.anyOf[1].properties.options.properties.to.type }, message: "must be number,null" };
|
|
4259
4688
|
if (vErrors === null) {
|
|
4260
4689
|
vErrors = [err16];
|
|
4261
4690
|
} else {
|
|
@@ -4547,7 +4976,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4547
4976
|
errors++;
|
|
4548
4977
|
}
|
|
4549
4978
|
if (!(data23 === "null" || data23 === "nan" || data23 === "null+nan" || data23 === "true" || data23 === "false" || data23 === "empty")) {
|
|
4550
|
-
const err43 = { instancePath: instancePath + "/options/match", schemaPath: "#/anyOf/3/properties/options/properties/match/enum", keyword: "enum", params: { allowedValues:
|
|
4979
|
+
const err43 = { instancePath: instancePath + "/options/match", schemaPath: "#/anyOf/3/properties/options/properties/match/enum", keyword: "enum", params: { allowedValues: schema30.anyOf[3].properties.options.properties.match.enum }, message: "must be equal to one of the allowed values" };
|
|
4551
4980
|
if (vErrors === null) {
|
|
4552
4981
|
vErrors = [err43];
|
|
4553
4982
|
} else {
|
|
@@ -4679,10 +5108,10 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4679
5108
|
}
|
|
4680
5109
|
}
|
|
4681
5110
|
}
|
|
4682
|
-
|
|
5111
|
+
validate29.errors = vErrors;
|
|
4683
5112
|
return errors === 0;
|
|
4684
5113
|
}
|
|
4685
|
-
function
|
|
5114
|
+
function validate28(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
4686
5115
|
let vErrors = null;
|
|
4687
5116
|
let errors = 0;
|
|
4688
5117
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -4800,7 +5229,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4800
5229
|
errors++;
|
|
4801
5230
|
}
|
|
4802
5231
|
if (!(data9 === "absolute" || data9 === "percentage")) {
|
|
4803
|
-
const err10 = { instancePath: instancePath + "/thresholds/mode", schemaPath: "#/properties/thresholds/properties/mode/enum", keyword: "enum", params: { allowedValues:
|
|
5232
|
+
const err10 = { instancePath: instancePath + "/thresholds/mode", schemaPath: "#/properties/thresholds/properties/mode/enum", keyword: "enum", params: { allowedValues: schema28.properties.thresholds.properties.mode.enum }, message: "must be equal to one of the allowed values" };
|
|
4804
5233
|
if (vErrors === null) {
|
|
4805
5234
|
vErrors = [err10];
|
|
4806
5235
|
} else {
|
|
@@ -4837,7 +5266,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4837
5266
|
if (data11.value !== void 0) {
|
|
4838
5267
|
let data12 = data11.value;
|
|
4839
5268
|
if (!(typeof data12 == "number") && data12 !== null) {
|
|
4840
|
-
const err13 = { instancePath: instancePath + "/thresholds/steps/" + i0 + "/value", schemaPath: "#/definitions/ThresholdStep/properties/value/type", keyword: "type", params: { type:
|
|
5269
|
+
const err13 = { instancePath: instancePath + "/thresholds/steps/" + i0 + "/value", schemaPath: "#/definitions/ThresholdStep/properties/value/type", keyword: "type", params: { type: schema29.properties.value.type }, message: "must be number,null" };
|
|
4841
5270
|
if (vErrors === null) {
|
|
4842
5271
|
vErrors = [err13];
|
|
4843
5272
|
} else {
|
|
@@ -4892,8 +5321,8 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4892
5321
|
if (Array.isArray(data14)) {
|
|
4893
5322
|
const len1 = data14.length;
|
|
4894
5323
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
4895
|
-
if (!
|
|
4896
|
-
vErrors = vErrors === null ?
|
|
5324
|
+
if (!validate29(data14[i1], { instancePath: instancePath + "/mappings/" + i1, parentData: data14, parentDataProperty: i1, rootData })) {
|
|
5325
|
+
vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);
|
|
4897
5326
|
errors = vErrors.length;
|
|
4898
5327
|
}
|
|
4899
5328
|
}
|
|
@@ -5000,7 +5429,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5000
5429
|
errors++;
|
|
5001
5430
|
}
|
|
5002
5431
|
if (!(data22 === "line" || data22 === "bars" || data22 === "points")) {
|
|
5003
|
-
const err27 = { instancePath: instancePath + "/custom/drawStyle", schemaPath: "#/properties/custom/properties/drawStyle/enum", keyword: "enum", params: { allowedValues:
|
|
5432
|
+
const err27 = { instancePath: instancePath + "/custom/drawStyle", schemaPath: "#/properties/custom/properties/drawStyle/enum", keyword: "enum", params: { allowedValues: schema28.properties.custom.properties.drawStyle.enum }, message: "must be equal to one of the allowed values" };
|
|
5004
5433
|
if (vErrors === null) {
|
|
5005
5434
|
vErrors = [err27];
|
|
5006
5435
|
} else {
|
|
@@ -5043,7 +5472,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5043
5472
|
errors++;
|
|
5044
5473
|
}
|
|
5045
5474
|
if (!(data25 === "auto" || data25 === "always" || data25 === "never")) {
|
|
5046
|
-
const err31 = { instancePath: instancePath + "/custom/showPoints", schemaPath: "#/properties/custom/properties/showPoints/enum", keyword: "enum", params: { allowedValues:
|
|
5475
|
+
const err31 = { instancePath: instancePath + "/custom/showPoints", schemaPath: "#/properties/custom/properties/showPoints/enum", keyword: "enum", params: { allowedValues: schema28.properties.custom.properties.showPoints.enum }, message: "must be equal to one of the allowed values" };
|
|
5047
5476
|
if (vErrors === null) {
|
|
5048
5477
|
vErrors = [err31];
|
|
5049
5478
|
} else {
|
|
@@ -5071,7 +5500,7 @@ function validate23(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5071
5500
|
}
|
|
5072
5501
|
errors++;
|
|
5073
5502
|
}
|
|
5074
|
-
|
|
5503
|
+
validate28.errors = vErrors;
|
|
5075
5504
|
return errors === 0;
|
|
5076
5505
|
}
|
|
5077
5506
|
var wrapper0 = { validate: validate18 };
|
|
@@ -5148,242 +5577,309 @@ function validate18(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5148
5577
|
}
|
|
5149
5578
|
errors++;
|
|
5150
5579
|
}
|
|
5580
|
+
const _errs8 = errors;
|
|
5581
|
+
let valid4 = true;
|
|
5582
|
+
const _errs9 = errors;
|
|
5151
5583
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
5152
|
-
|
|
5153
|
-
|
|
5584
|
+
let missing1;
|
|
5585
|
+
if (data.type === void 0 && (missing1 = "type")) {
|
|
5586
|
+
const err4 = {};
|
|
5154
5587
|
if (vErrors === null) {
|
|
5155
5588
|
vErrors = [err4];
|
|
5156
5589
|
} else {
|
|
5157
5590
|
vErrors.push(err4);
|
|
5158
5591
|
}
|
|
5159
5592
|
errors++;
|
|
5593
|
+
} else {
|
|
5594
|
+
if (data.type !== void 0) {
|
|
5595
|
+
if ("input-group" !== data.type) {
|
|
5596
|
+
const err5 = {};
|
|
5597
|
+
if (vErrors === null) {
|
|
5598
|
+
vErrors = [err5];
|
|
5599
|
+
} else {
|
|
5600
|
+
vErrors.push(err5);
|
|
5601
|
+
}
|
|
5602
|
+
errors++;
|
|
5603
|
+
}
|
|
5604
|
+
}
|
|
5605
|
+
}
|
|
5606
|
+
}
|
|
5607
|
+
var _valid1 = _errs9 === errors;
|
|
5608
|
+
errors = _errs8;
|
|
5609
|
+
if (vErrors !== null) {
|
|
5610
|
+
if (_errs8) {
|
|
5611
|
+
vErrors.length = _errs8;
|
|
5612
|
+
} else {
|
|
5613
|
+
vErrors = null;
|
|
5614
|
+
}
|
|
5615
|
+
}
|
|
5616
|
+
if (_valid1) {
|
|
5617
|
+
const _errs11 = errors;
|
|
5618
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
5619
|
+
if (data.options === void 0) {
|
|
5620
|
+
const err6 = { instancePath, schemaPath: "#/allOf/1/then/required", keyword: "required", params: { missingProperty: "options" }, message: "must have required property 'options'" };
|
|
5621
|
+
if (vErrors === null) {
|
|
5622
|
+
vErrors = [err6];
|
|
5623
|
+
} else {
|
|
5624
|
+
vErrors.push(err6);
|
|
5625
|
+
}
|
|
5626
|
+
errors++;
|
|
5627
|
+
}
|
|
5628
|
+
if (data.options !== void 0) {
|
|
5629
|
+
if (!validate21(data.options, { instancePath: instancePath + "/options", parentData: data, parentDataProperty: "options", rootData })) {
|
|
5630
|
+
vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);
|
|
5631
|
+
errors = vErrors.length;
|
|
5632
|
+
}
|
|
5633
|
+
}
|
|
5634
|
+
}
|
|
5635
|
+
var _valid1 = _errs11 === errors;
|
|
5636
|
+
valid4 = _valid1;
|
|
5637
|
+
}
|
|
5638
|
+
if (!valid4) {
|
|
5639
|
+
const err7 = { instancePath, schemaPath: "#/allOf/1/if", keyword: "if", params: { failingKeyword: "then" }, message: 'must match "then" schema' };
|
|
5640
|
+
if (vErrors === null) {
|
|
5641
|
+
vErrors = [err7];
|
|
5642
|
+
} else {
|
|
5643
|
+
vErrors.push(err7);
|
|
5644
|
+
}
|
|
5645
|
+
errors++;
|
|
5646
|
+
}
|
|
5647
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
5648
|
+
if (data.type === void 0) {
|
|
5649
|
+
const err8 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
5650
|
+
if (vErrors === null) {
|
|
5651
|
+
vErrors = [err8];
|
|
5652
|
+
} else {
|
|
5653
|
+
vErrors.push(err8);
|
|
5654
|
+
}
|
|
5655
|
+
errors++;
|
|
5160
5656
|
}
|
|
5161
5657
|
if (data.gridPos === void 0) {
|
|
5162
|
-
const
|
|
5658
|
+
const err9 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "gridPos" }, message: "must have required property 'gridPos'" };
|
|
5163
5659
|
if (vErrors === null) {
|
|
5164
|
-
vErrors = [
|
|
5660
|
+
vErrors = [err9];
|
|
5165
5661
|
} else {
|
|
5166
|
-
vErrors.push(
|
|
5662
|
+
vErrors.push(err9);
|
|
5167
5663
|
}
|
|
5168
5664
|
errors++;
|
|
5169
5665
|
}
|
|
5170
5666
|
if (data.id !== void 0) {
|
|
5171
5667
|
if (!(typeof data.id == "number")) {
|
|
5172
|
-
const
|
|
5668
|
+
const err10 = { instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
5173
5669
|
if (vErrors === null) {
|
|
5174
|
-
vErrors = [
|
|
5670
|
+
vErrors = [err10];
|
|
5175
5671
|
} else {
|
|
5176
|
-
vErrors.push(
|
|
5672
|
+
vErrors.push(err10);
|
|
5177
5673
|
}
|
|
5178
5674
|
errors++;
|
|
5179
5675
|
}
|
|
5180
5676
|
}
|
|
5181
5677
|
if (data.type !== void 0) {
|
|
5182
5678
|
if (typeof data.type !== "string") {
|
|
5183
|
-
const
|
|
5679
|
+
const err11 = { instancePath: instancePath + "/type", schemaPath: "#/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5184
5680
|
if (vErrors === null) {
|
|
5185
|
-
vErrors = [
|
|
5681
|
+
vErrors = [err11];
|
|
5186
5682
|
} else {
|
|
5187
|
-
vErrors.push(
|
|
5683
|
+
vErrors.push(err11);
|
|
5188
5684
|
}
|
|
5189
5685
|
errors++;
|
|
5190
5686
|
}
|
|
5191
5687
|
}
|
|
5192
5688
|
if (data.title !== void 0) {
|
|
5193
5689
|
if (typeof data.title !== "string") {
|
|
5194
|
-
const
|
|
5690
|
+
const err12 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5195
5691
|
if (vErrors === null) {
|
|
5196
|
-
vErrors = [
|
|
5692
|
+
vErrors = [err12];
|
|
5197
5693
|
} else {
|
|
5198
|
-
vErrors.push(
|
|
5694
|
+
vErrors.push(err12);
|
|
5199
5695
|
}
|
|
5200
5696
|
errors++;
|
|
5201
5697
|
}
|
|
5202
5698
|
}
|
|
5203
5699
|
if (data.description !== void 0) {
|
|
5204
5700
|
if (typeof data.description !== "string") {
|
|
5205
|
-
const
|
|
5701
|
+
const err13 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5206
5702
|
if (vErrors === null) {
|
|
5207
|
-
vErrors = [
|
|
5703
|
+
vErrors = [err13];
|
|
5208
5704
|
} else {
|
|
5209
|
-
vErrors.push(
|
|
5705
|
+
vErrors.push(err13);
|
|
5210
5706
|
}
|
|
5211
5707
|
errors++;
|
|
5212
5708
|
}
|
|
5213
5709
|
}
|
|
5214
5710
|
if (data.gridPos !== void 0) {
|
|
5215
|
-
let
|
|
5216
|
-
if (
|
|
5217
|
-
if (
|
|
5218
|
-
const
|
|
5711
|
+
let data8 = data.gridPos;
|
|
5712
|
+
if (data8 && typeof data8 == "object" && !Array.isArray(data8)) {
|
|
5713
|
+
if (data8.x === void 0) {
|
|
5714
|
+
const err14 = { instancePath: instancePath + "/gridPos", schemaPath: "#/definitions/GridPos/required", keyword: "required", params: { missingProperty: "x" }, message: "must have required property 'x'" };
|
|
5219
5715
|
if (vErrors === null) {
|
|
5220
|
-
vErrors = [
|
|
5716
|
+
vErrors = [err14];
|
|
5221
5717
|
} else {
|
|
5222
|
-
vErrors.push(
|
|
5718
|
+
vErrors.push(err14);
|
|
5223
5719
|
}
|
|
5224
5720
|
errors++;
|
|
5225
5721
|
}
|
|
5226
|
-
if (
|
|
5227
|
-
const
|
|
5722
|
+
if (data8.y === void 0) {
|
|
5723
|
+
const err15 = { instancePath: instancePath + "/gridPos", schemaPath: "#/definitions/GridPos/required", keyword: "required", params: { missingProperty: "y" }, message: "must have required property 'y'" };
|
|
5228
5724
|
if (vErrors === null) {
|
|
5229
|
-
vErrors = [
|
|
5725
|
+
vErrors = [err15];
|
|
5230
5726
|
} else {
|
|
5231
|
-
vErrors.push(
|
|
5727
|
+
vErrors.push(err15);
|
|
5232
5728
|
}
|
|
5233
5729
|
errors++;
|
|
5234
5730
|
}
|
|
5235
|
-
if (
|
|
5236
|
-
const
|
|
5731
|
+
if (data8.w === void 0) {
|
|
5732
|
+
const err16 = { instancePath: instancePath + "/gridPos", schemaPath: "#/definitions/GridPos/required", keyword: "required", params: { missingProperty: "w" }, message: "must have required property 'w'" };
|
|
5237
5733
|
if (vErrors === null) {
|
|
5238
|
-
vErrors = [
|
|
5734
|
+
vErrors = [err16];
|
|
5239
5735
|
} else {
|
|
5240
|
-
vErrors.push(
|
|
5736
|
+
vErrors.push(err16);
|
|
5241
5737
|
}
|
|
5242
5738
|
errors++;
|
|
5243
5739
|
}
|
|
5244
|
-
if (
|
|
5245
|
-
const
|
|
5740
|
+
if (data8.h === void 0) {
|
|
5741
|
+
const err17 = { instancePath: instancePath + "/gridPos", schemaPath: "#/definitions/GridPos/required", keyword: "required", params: { missingProperty: "h" }, message: "must have required property 'h'" };
|
|
5246
5742
|
if (vErrors === null) {
|
|
5247
|
-
vErrors = [
|
|
5743
|
+
vErrors = [err17];
|
|
5248
5744
|
} else {
|
|
5249
|
-
vErrors.push(
|
|
5745
|
+
vErrors.push(err17);
|
|
5250
5746
|
}
|
|
5251
5747
|
errors++;
|
|
5252
5748
|
}
|
|
5253
|
-
if (
|
|
5254
|
-
if (!(typeof
|
|
5255
|
-
const
|
|
5749
|
+
if (data8.x !== void 0) {
|
|
5750
|
+
if (!(typeof data8.x == "number")) {
|
|
5751
|
+
const err18 = { instancePath: instancePath + "/gridPos/x", schemaPath: "#/definitions/GridPos/properties/x/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
5256
5752
|
if (vErrors === null) {
|
|
5257
|
-
vErrors = [
|
|
5753
|
+
vErrors = [err18];
|
|
5258
5754
|
} else {
|
|
5259
|
-
vErrors.push(
|
|
5755
|
+
vErrors.push(err18);
|
|
5260
5756
|
}
|
|
5261
5757
|
errors++;
|
|
5262
5758
|
}
|
|
5263
5759
|
}
|
|
5264
|
-
if (
|
|
5265
|
-
if (!(typeof
|
|
5266
|
-
const
|
|
5760
|
+
if (data8.y !== void 0) {
|
|
5761
|
+
if (!(typeof data8.y == "number")) {
|
|
5762
|
+
const err19 = { instancePath: instancePath + "/gridPos/y", schemaPath: "#/definitions/GridPos/properties/y/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
5267
5763
|
if (vErrors === null) {
|
|
5268
|
-
vErrors = [
|
|
5764
|
+
vErrors = [err19];
|
|
5269
5765
|
} else {
|
|
5270
|
-
vErrors.push(
|
|
5766
|
+
vErrors.push(err19);
|
|
5271
5767
|
}
|
|
5272
5768
|
errors++;
|
|
5273
5769
|
}
|
|
5274
5770
|
}
|
|
5275
|
-
if (
|
|
5276
|
-
if (!(typeof
|
|
5277
|
-
const
|
|
5771
|
+
if (data8.w !== void 0) {
|
|
5772
|
+
if (!(typeof data8.w == "number")) {
|
|
5773
|
+
const err20 = { instancePath: instancePath + "/gridPos/w", schemaPath: "#/definitions/GridPos/properties/w/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
5278
5774
|
if (vErrors === null) {
|
|
5279
|
-
vErrors = [
|
|
5775
|
+
vErrors = [err20];
|
|
5280
5776
|
} else {
|
|
5281
|
-
vErrors.push(
|
|
5777
|
+
vErrors.push(err20);
|
|
5282
5778
|
}
|
|
5283
5779
|
errors++;
|
|
5284
5780
|
}
|
|
5285
5781
|
}
|
|
5286
|
-
if (
|
|
5287
|
-
if (!(typeof
|
|
5288
|
-
const
|
|
5782
|
+
if (data8.h !== void 0) {
|
|
5783
|
+
if (!(typeof data8.h == "number")) {
|
|
5784
|
+
const err21 = { instancePath: instancePath + "/gridPos/h", schemaPath: "#/definitions/GridPos/properties/h/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
5289
5785
|
if (vErrors === null) {
|
|
5290
|
-
vErrors = [
|
|
5786
|
+
vErrors = [err21];
|
|
5291
5787
|
} else {
|
|
5292
|
-
vErrors.push(
|
|
5788
|
+
vErrors.push(err21);
|
|
5293
5789
|
}
|
|
5294
5790
|
errors++;
|
|
5295
5791
|
}
|
|
5296
5792
|
}
|
|
5297
5793
|
} else {
|
|
5298
|
-
const
|
|
5794
|
+
const err22 = { instancePath: instancePath + "/gridPos", schemaPath: "#/definitions/GridPos/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5299
5795
|
if (vErrors === null) {
|
|
5300
|
-
vErrors = [
|
|
5796
|
+
vErrors = [err22];
|
|
5301
5797
|
} else {
|
|
5302
|
-
vErrors.push(
|
|
5798
|
+
vErrors.push(err22);
|
|
5303
5799
|
}
|
|
5304
5800
|
errors++;
|
|
5305
5801
|
}
|
|
5306
5802
|
}
|
|
5307
5803
|
if (data.datasource !== void 0) {
|
|
5308
|
-
let
|
|
5309
|
-
const
|
|
5310
|
-
let
|
|
5311
|
-
const
|
|
5312
|
-
if (
|
|
5313
|
-
if (
|
|
5314
|
-
if (typeof
|
|
5315
|
-
const
|
|
5804
|
+
let data13 = data.datasource;
|
|
5805
|
+
const _errs34 = errors;
|
|
5806
|
+
let valid10 = false;
|
|
5807
|
+
const _errs35 = errors;
|
|
5808
|
+
if (data13 && typeof data13 == "object" && !Array.isArray(data13)) {
|
|
5809
|
+
if (data13.type !== void 0) {
|
|
5810
|
+
if (typeof data13.type !== "string") {
|
|
5811
|
+
const err23 = { instancePath: instancePath + "/datasource/type", schemaPath: "#/definitions/DataSourceRef/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5316
5812
|
if (vErrors === null) {
|
|
5317
|
-
vErrors = [
|
|
5813
|
+
vErrors = [err23];
|
|
5318
5814
|
} else {
|
|
5319
|
-
vErrors.push(
|
|
5815
|
+
vErrors.push(err23);
|
|
5320
5816
|
}
|
|
5321
5817
|
errors++;
|
|
5322
5818
|
}
|
|
5323
5819
|
}
|
|
5324
|
-
if (
|
|
5325
|
-
if (typeof
|
|
5326
|
-
const
|
|
5820
|
+
if (data13.uid !== void 0) {
|
|
5821
|
+
if (typeof data13.uid !== "string") {
|
|
5822
|
+
const err24 = { instancePath: instancePath + "/datasource/uid", schemaPath: "#/definitions/DataSourceRef/properties/uid/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5327
5823
|
if (vErrors === null) {
|
|
5328
|
-
vErrors = [
|
|
5824
|
+
vErrors = [err24];
|
|
5329
5825
|
} else {
|
|
5330
|
-
vErrors.push(
|
|
5826
|
+
vErrors.push(err24);
|
|
5331
5827
|
}
|
|
5332
5828
|
errors++;
|
|
5333
5829
|
}
|
|
5334
5830
|
}
|
|
5335
5831
|
} else {
|
|
5336
|
-
const
|
|
5832
|
+
const err25 = { instancePath: instancePath + "/datasource", schemaPath: "#/definitions/DataSourceRef/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5337
5833
|
if (vErrors === null) {
|
|
5338
|
-
vErrors = [
|
|
5834
|
+
vErrors = [err25];
|
|
5339
5835
|
} else {
|
|
5340
|
-
vErrors.push(
|
|
5836
|
+
vErrors.push(err25);
|
|
5341
5837
|
}
|
|
5342
5838
|
errors++;
|
|
5343
5839
|
}
|
|
5344
|
-
var
|
|
5345
|
-
|
|
5346
|
-
if (!
|
|
5347
|
-
const
|
|
5348
|
-
if (typeof
|
|
5349
|
-
const
|
|
5840
|
+
var _valid2 = _errs35 === errors;
|
|
5841
|
+
valid10 = valid10 || _valid2;
|
|
5842
|
+
if (!valid10) {
|
|
5843
|
+
const _errs42 = errors;
|
|
5844
|
+
if (typeof data13 !== "string") {
|
|
5845
|
+
const err26 = { instancePath: instancePath + "/datasource", schemaPath: "#/properties/datasource/anyOf/1/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5350
5846
|
if (vErrors === null) {
|
|
5351
|
-
vErrors = [
|
|
5847
|
+
vErrors = [err26];
|
|
5352
5848
|
} else {
|
|
5353
|
-
vErrors.push(
|
|
5849
|
+
vErrors.push(err26);
|
|
5354
5850
|
}
|
|
5355
5851
|
errors++;
|
|
5356
5852
|
}
|
|
5357
|
-
var
|
|
5358
|
-
|
|
5359
|
-
if (!
|
|
5360
|
-
const
|
|
5361
|
-
if (
|
|
5362
|
-
const
|
|
5853
|
+
var _valid2 = _errs42 === errors;
|
|
5854
|
+
valid10 = valid10 || _valid2;
|
|
5855
|
+
if (!valid10) {
|
|
5856
|
+
const _errs44 = errors;
|
|
5857
|
+
if (data13 !== null) {
|
|
5858
|
+
const err27 = { instancePath: instancePath + "/datasource", schemaPath: "#/properties/datasource/anyOf/2/type", keyword: "type", params: { type: "null" }, message: "must be null" };
|
|
5363
5859
|
if (vErrors === null) {
|
|
5364
|
-
vErrors = [
|
|
5860
|
+
vErrors = [err27];
|
|
5365
5861
|
} else {
|
|
5366
|
-
vErrors.push(
|
|
5862
|
+
vErrors.push(err27);
|
|
5367
5863
|
}
|
|
5368
5864
|
errors++;
|
|
5369
5865
|
}
|
|
5370
|
-
var
|
|
5371
|
-
|
|
5866
|
+
var _valid2 = _errs44 === errors;
|
|
5867
|
+
valid10 = valid10 || _valid2;
|
|
5372
5868
|
}
|
|
5373
5869
|
}
|
|
5374
|
-
if (!
|
|
5375
|
-
const
|
|
5870
|
+
if (!valid10) {
|
|
5871
|
+
const err28 = { instancePath: instancePath + "/datasource", schemaPath: "#/properties/datasource/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
5376
5872
|
if (vErrors === null) {
|
|
5377
|
-
vErrors = [
|
|
5873
|
+
vErrors = [err28];
|
|
5378
5874
|
} else {
|
|
5379
|
-
vErrors.push(
|
|
5875
|
+
vErrors.push(err28);
|
|
5380
5876
|
}
|
|
5381
5877
|
errors++;
|
|
5382
5878
|
} else {
|
|
5383
|
-
errors =
|
|
5879
|
+
errors = _errs34;
|
|
5384
5880
|
if (vErrors !== null) {
|
|
5385
|
-
if (
|
|
5386
|
-
vErrors.length =
|
|
5881
|
+
if (_errs34) {
|
|
5882
|
+
vErrors.length = _errs34;
|
|
5387
5883
|
} else {
|
|
5388
5884
|
vErrors = null;
|
|
5389
5885
|
}
|
|
@@ -5391,529 +5887,529 @@ function validate18(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5391
5887
|
}
|
|
5392
5888
|
}
|
|
5393
5889
|
if (data.targets !== void 0) {
|
|
5394
|
-
let
|
|
5395
|
-
if (Array.isArray(
|
|
5396
|
-
const len0 =
|
|
5890
|
+
let data16 = data.targets;
|
|
5891
|
+
if (Array.isArray(data16)) {
|
|
5892
|
+
const len0 = data16.length;
|
|
5397
5893
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
5398
|
-
if (!
|
|
5399
|
-
vErrors = vErrors === null ?
|
|
5894
|
+
if (!validate26(data16[i0], { instancePath: instancePath + "/targets/" + i0, parentData: data16, parentDataProperty: i0, rootData })) {
|
|
5895
|
+
vErrors = vErrors === null ? validate26.errors : vErrors.concat(validate26.errors);
|
|
5400
5896
|
errors = vErrors.length;
|
|
5401
5897
|
}
|
|
5402
5898
|
}
|
|
5403
5899
|
} else {
|
|
5404
|
-
const
|
|
5900
|
+
const err29 = { instancePath: instancePath + "/targets", schemaPath: "#/properties/targets/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
5405
5901
|
if (vErrors === null) {
|
|
5406
|
-
vErrors = [
|
|
5902
|
+
vErrors = [err29];
|
|
5407
5903
|
} else {
|
|
5408
|
-
vErrors.push(
|
|
5904
|
+
vErrors.push(err29);
|
|
5409
5905
|
}
|
|
5410
5906
|
errors++;
|
|
5411
5907
|
}
|
|
5412
5908
|
}
|
|
5413
5909
|
if (data.fieldConfig !== void 0) {
|
|
5414
|
-
let
|
|
5415
|
-
if (
|
|
5416
|
-
if (
|
|
5417
|
-
if (!
|
|
5418
|
-
vErrors = vErrors === null ?
|
|
5910
|
+
let data18 = data.fieldConfig;
|
|
5911
|
+
if (data18 && typeof data18 == "object" && !Array.isArray(data18)) {
|
|
5912
|
+
if (data18.defaults !== void 0) {
|
|
5913
|
+
if (!validate28(data18.defaults, { instancePath: instancePath + "/fieldConfig/defaults", parentData: data18, parentDataProperty: "defaults", rootData })) {
|
|
5914
|
+
vErrors = vErrors === null ? validate28.errors : vErrors.concat(validate28.errors);
|
|
5419
5915
|
errors = vErrors.length;
|
|
5420
5916
|
}
|
|
5421
5917
|
}
|
|
5422
|
-
if (
|
|
5423
|
-
let
|
|
5424
|
-
if (Array.isArray(
|
|
5425
|
-
const len1 =
|
|
5918
|
+
if (data18.overrides !== void 0) {
|
|
5919
|
+
let data20 = data18.overrides;
|
|
5920
|
+
if (Array.isArray(data20)) {
|
|
5921
|
+
const len1 = data20.length;
|
|
5426
5922
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
5427
|
-
let
|
|
5428
|
-
if (
|
|
5429
|
-
if (
|
|
5430
|
-
const
|
|
5923
|
+
let data21 = data20[i1];
|
|
5924
|
+
if (data21 && typeof data21 == "object" && !Array.isArray(data21)) {
|
|
5925
|
+
if (data21.matcher === void 0) {
|
|
5926
|
+
const err30 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1, schemaPath: "#/definitions/FieldOverride/required", keyword: "required", params: { missingProperty: "matcher" }, message: "must have required property 'matcher'" };
|
|
5431
5927
|
if (vErrors === null) {
|
|
5432
|
-
vErrors = [
|
|
5928
|
+
vErrors = [err30];
|
|
5433
5929
|
} else {
|
|
5434
|
-
vErrors.push(
|
|
5930
|
+
vErrors.push(err30);
|
|
5435
5931
|
}
|
|
5436
5932
|
errors++;
|
|
5437
5933
|
}
|
|
5438
|
-
if (
|
|
5439
|
-
const
|
|
5934
|
+
if (data21.properties === void 0) {
|
|
5935
|
+
const err31 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1, schemaPath: "#/definitions/FieldOverride/required", keyword: "required", params: { missingProperty: "properties" }, message: "must have required property 'properties'" };
|
|
5440
5936
|
if (vErrors === null) {
|
|
5441
|
-
vErrors = [
|
|
5937
|
+
vErrors = [err31];
|
|
5442
5938
|
} else {
|
|
5443
|
-
vErrors.push(
|
|
5939
|
+
vErrors.push(err31);
|
|
5444
5940
|
}
|
|
5445
5941
|
errors++;
|
|
5446
5942
|
}
|
|
5447
|
-
if (
|
|
5448
|
-
let
|
|
5449
|
-
if (
|
|
5450
|
-
if (
|
|
5451
|
-
const
|
|
5943
|
+
if (data21.matcher !== void 0) {
|
|
5944
|
+
let data22 = data21.matcher;
|
|
5945
|
+
if (data22 && typeof data22 == "object" && !Array.isArray(data22)) {
|
|
5946
|
+
if (data22.id === void 0) {
|
|
5947
|
+
const err32 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1 + "/matcher", schemaPath: "#/definitions/FieldOverride/properties/matcher/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
|
|
5452
5948
|
if (vErrors === null) {
|
|
5453
|
-
vErrors = [
|
|
5949
|
+
vErrors = [err32];
|
|
5454
5950
|
} else {
|
|
5455
|
-
vErrors.push(
|
|
5951
|
+
vErrors.push(err32);
|
|
5456
5952
|
}
|
|
5457
5953
|
errors++;
|
|
5458
5954
|
}
|
|
5459
|
-
if (
|
|
5460
|
-
if (typeof
|
|
5461
|
-
const
|
|
5955
|
+
if (data22.id !== void 0) {
|
|
5956
|
+
if (typeof data22.id !== "string") {
|
|
5957
|
+
const err33 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1 + "/matcher/id", schemaPath: "#/definitions/FieldOverride/properties/matcher/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5462
5958
|
if (vErrors === null) {
|
|
5463
|
-
vErrors = [
|
|
5959
|
+
vErrors = [err33];
|
|
5464
5960
|
} else {
|
|
5465
|
-
vErrors.push(
|
|
5961
|
+
vErrors.push(err33);
|
|
5466
5962
|
}
|
|
5467
5963
|
errors++;
|
|
5468
5964
|
}
|
|
5469
5965
|
}
|
|
5470
5966
|
} else {
|
|
5471
|
-
const
|
|
5967
|
+
const err34 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1 + "/matcher", schemaPath: "#/definitions/FieldOverride/properties/matcher/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5472
5968
|
if (vErrors === null) {
|
|
5473
|
-
vErrors = [
|
|
5969
|
+
vErrors = [err34];
|
|
5474
5970
|
} else {
|
|
5475
|
-
vErrors.push(
|
|
5971
|
+
vErrors.push(err34);
|
|
5476
5972
|
}
|
|
5477
5973
|
errors++;
|
|
5478
5974
|
}
|
|
5479
5975
|
}
|
|
5480
|
-
if (
|
|
5481
|
-
let
|
|
5482
|
-
if (Array.isArray(
|
|
5483
|
-
const len2 =
|
|
5976
|
+
if (data21.properties !== void 0) {
|
|
5977
|
+
let data24 = data21.properties;
|
|
5978
|
+
if (Array.isArray(data24)) {
|
|
5979
|
+
const len2 = data24.length;
|
|
5484
5980
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
5485
|
-
let
|
|
5486
|
-
if (
|
|
5487
|
-
if (
|
|
5488
|
-
const
|
|
5981
|
+
let data25 = data24[i2];
|
|
5982
|
+
if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
|
|
5983
|
+
if (data25.id === void 0) {
|
|
5984
|
+
const err35 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1 + "/properties/" + i2, schemaPath: "#/definitions/FieldOverride/properties/properties/items/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
|
|
5489
5985
|
if (vErrors === null) {
|
|
5490
|
-
vErrors = [
|
|
5986
|
+
vErrors = [err35];
|
|
5491
5987
|
} else {
|
|
5492
|
-
vErrors.push(
|
|
5988
|
+
vErrors.push(err35);
|
|
5493
5989
|
}
|
|
5494
5990
|
errors++;
|
|
5495
5991
|
}
|
|
5496
|
-
if (
|
|
5497
|
-
if (typeof
|
|
5498
|
-
const
|
|
5992
|
+
if (data25.id !== void 0) {
|
|
5993
|
+
if (typeof data25.id !== "string") {
|
|
5994
|
+
const err36 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1 + "/properties/" + i2 + "/id", schemaPath: "#/definitions/FieldOverride/properties/properties/items/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5499
5995
|
if (vErrors === null) {
|
|
5500
|
-
vErrors = [
|
|
5996
|
+
vErrors = [err36];
|
|
5501
5997
|
} else {
|
|
5502
|
-
vErrors.push(
|
|
5998
|
+
vErrors.push(err36);
|
|
5503
5999
|
}
|
|
5504
6000
|
errors++;
|
|
5505
6001
|
}
|
|
5506
6002
|
}
|
|
5507
6003
|
} else {
|
|
5508
|
-
const
|
|
6004
|
+
const err37 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1 + "/properties/" + i2, schemaPath: "#/definitions/FieldOverride/properties/properties/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5509
6005
|
if (vErrors === null) {
|
|
5510
|
-
vErrors = [
|
|
6006
|
+
vErrors = [err37];
|
|
5511
6007
|
} else {
|
|
5512
|
-
vErrors.push(
|
|
6008
|
+
vErrors.push(err37);
|
|
5513
6009
|
}
|
|
5514
6010
|
errors++;
|
|
5515
6011
|
}
|
|
5516
6012
|
}
|
|
5517
6013
|
} else {
|
|
5518
|
-
const
|
|
6014
|
+
const err38 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1 + "/properties", schemaPath: "#/definitions/FieldOverride/properties/properties/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
5519
6015
|
if (vErrors === null) {
|
|
5520
|
-
vErrors = [
|
|
6016
|
+
vErrors = [err38];
|
|
5521
6017
|
} else {
|
|
5522
|
-
vErrors.push(
|
|
6018
|
+
vErrors.push(err38);
|
|
5523
6019
|
}
|
|
5524
6020
|
errors++;
|
|
5525
6021
|
}
|
|
5526
6022
|
}
|
|
5527
6023
|
} else {
|
|
5528
|
-
const
|
|
6024
|
+
const err39 = { instancePath: instancePath + "/fieldConfig/overrides/" + i1, schemaPath: "#/definitions/FieldOverride/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5529
6025
|
if (vErrors === null) {
|
|
5530
|
-
vErrors = [
|
|
6026
|
+
vErrors = [err39];
|
|
5531
6027
|
} else {
|
|
5532
|
-
vErrors.push(
|
|
6028
|
+
vErrors.push(err39);
|
|
5533
6029
|
}
|
|
5534
6030
|
errors++;
|
|
5535
6031
|
}
|
|
5536
6032
|
}
|
|
5537
6033
|
} else {
|
|
5538
|
-
const
|
|
6034
|
+
const err40 = { instancePath: instancePath + "/fieldConfig/overrides", schemaPath: "#/properties/fieldConfig/properties/overrides/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
5539
6035
|
if (vErrors === null) {
|
|
5540
|
-
vErrors = [
|
|
6036
|
+
vErrors = [err40];
|
|
5541
6037
|
} else {
|
|
5542
|
-
vErrors.push(
|
|
6038
|
+
vErrors.push(err40);
|
|
5543
6039
|
}
|
|
5544
6040
|
errors++;
|
|
5545
6041
|
}
|
|
5546
6042
|
}
|
|
5547
6043
|
} else {
|
|
5548
|
-
const
|
|
6044
|
+
const err41 = { instancePath: instancePath + "/fieldConfig", schemaPath: "#/properties/fieldConfig/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5549
6045
|
if (vErrors === null) {
|
|
5550
|
-
vErrors = [
|
|
6046
|
+
vErrors = [err41];
|
|
5551
6047
|
} else {
|
|
5552
|
-
vErrors.push(
|
|
6048
|
+
vErrors.push(err41);
|
|
5553
6049
|
}
|
|
5554
6050
|
errors++;
|
|
5555
6051
|
}
|
|
5556
6052
|
}
|
|
5557
6053
|
if (data.options !== void 0) {
|
|
5558
|
-
let
|
|
5559
|
-
if (!(
|
|
5560
|
-
const
|
|
6054
|
+
let data27 = data.options;
|
|
6055
|
+
if (!(data27 && typeof data27 == "object" && !Array.isArray(data27))) {
|
|
6056
|
+
const err42 = { instancePath: instancePath + "/options", schemaPath: "#/properties/options/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5561
6057
|
if (vErrors === null) {
|
|
5562
|
-
vErrors = [
|
|
6058
|
+
vErrors = [err42];
|
|
5563
6059
|
} else {
|
|
5564
|
-
vErrors.push(
|
|
6060
|
+
vErrors.push(err42);
|
|
5565
6061
|
}
|
|
5566
6062
|
errors++;
|
|
5567
6063
|
}
|
|
5568
6064
|
}
|
|
5569
6065
|
if (data.transformations !== void 0) {
|
|
5570
|
-
let
|
|
5571
|
-
if (Array.isArray(
|
|
5572
|
-
const len3 =
|
|
6066
|
+
let data28 = data.transformations;
|
|
6067
|
+
if (Array.isArray(data28)) {
|
|
6068
|
+
const len3 = data28.length;
|
|
5573
6069
|
for (let i3 = 0; i3 < len3; i3++) {
|
|
5574
|
-
let
|
|
5575
|
-
if (
|
|
5576
|
-
if (
|
|
5577
|
-
const
|
|
6070
|
+
let data29 = data28[i3];
|
|
6071
|
+
if (data29 && typeof data29 == "object" && !Array.isArray(data29)) {
|
|
6072
|
+
if (data29.id === void 0) {
|
|
6073
|
+
const err43 = { instancePath: instancePath + "/transformations/" + i3, schemaPath: "#/properties/transformations/items/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
|
|
5578
6074
|
if (vErrors === null) {
|
|
5579
|
-
vErrors = [
|
|
6075
|
+
vErrors = [err43];
|
|
5580
6076
|
} else {
|
|
5581
|
-
vErrors.push(
|
|
6077
|
+
vErrors.push(err43);
|
|
5582
6078
|
}
|
|
5583
6079
|
errors++;
|
|
5584
6080
|
}
|
|
5585
|
-
if (
|
|
5586
|
-
if (typeof
|
|
5587
|
-
const
|
|
6081
|
+
if (data29.id !== void 0) {
|
|
6082
|
+
if (typeof data29.id !== "string") {
|
|
6083
|
+
const err44 = { instancePath: instancePath + "/transformations/" + i3 + "/id", schemaPath: "#/properties/transformations/items/properties/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5588
6084
|
if (vErrors === null) {
|
|
5589
|
-
vErrors = [
|
|
6085
|
+
vErrors = [err44];
|
|
5590
6086
|
} else {
|
|
5591
|
-
vErrors.push(
|
|
6087
|
+
vErrors.push(err44);
|
|
5592
6088
|
}
|
|
5593
6089
|
errors++;
|
|
5594
6090
|
}
|
|
5595
6091
|
}
|
|
5596
|
-
if (
|
|
5597
|
-
let
|
|
5598
|
-
if (!(
|
|
5599
|
-
const
|
|
6092
|
+
if (data29.options !== void 0) {
|
|
6093
|
+
let data31 = data29.options;
|
|
6094
|
+
if (!(data31 && typeof data31 == "object" && !Array.isArray(data31))) {
|
|
6095
|
+
const err45 = { instancePath: instancePath + "/transformations/" + i3 + "/options", schemaPath: "#/properties/transformations/items/properties/options/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5600
6096
|
if (vErrors === null) {
|
|
5601
|
-
vErrors = [
|
|
6097
|
+
vErrors = [err45];
|
|
5602
6098
|
} else {
|
|
5603
|
-
vErrors.push(
|
|
6099
|
+
vErrors.push(err45);
|
|
5604
6100
|
}
|
|
5605
6101
|
errors++;
|
|
5606
6102
|
}
|
|
5607
6103
|
}
|
|
5608
|
-
if (
|
|
5609
|
-
if (typeof
|
|
5610
|
-
const
|
|
6104
|
+
if (data29.disabled !== void 0) {
|
|
6105
|
+
if (typeof data29.disabled !== "boolean") {
|
|
6106
|
+
const err46 = { instancePath: instancePath + "/transformations/" + i3 + "/disabled", schemaPath: "#/properties/transformations/items/properties/disabled/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
|
|
5611
6107
|
if (vErrors === null) {
|
|
5612
|
-
vErrors = [
|
|
6108
|
+
vErrors = [err46];
|
|
5613
6109
|
} else {
|
|
5614
|
-
vErrors.push(
|
|
6110
|
+
vErrors.push(err46);
|
|
5615
6111
|
}
|
|
5616
6112
|
errors++;
|
|
5617
6113
|
}
|
|
5618
6114
|
}
|
|
5619
6115
|
} else {
|
|
5620
|
-
const
|
|
6116
|
+
const err47 = { instancePath: instancePath + "/transformations/" + i3, schemaPath: "#/properties/transformations/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5621
6117
|
if (vErrors === null) {
|
|
5622
|
-
vErrors = [
|
|
6118
|
+
vErrors = [err47];
|
|
5623
6119
|
} else {
|
|
5624
|
-
vErrors.push(
|
|
6120
|
+
vErrors.push(err47);
|
|
5625
6121
|
}
|
|
5626
6122
|
errors++;
|
|
5627
6123
|
}
|
|
5628
6124
|
}
|
|
5629
6125
|
} else {
|
|
5630
|
-
const
|
|
6126
|
+
const err48 = { instancePath: instancePath + "/transformations", schemaPath: "#/properties/transformations/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
5631
6127
|
if (vErrors === null) {
|
|
5632
|
-
vErrors = [
|
|
6128
|
+
vErrors = [err48];
|
|
5633
6129
|
} else {
|
|
5634
|
-
vErrors.push(
|
|
6130
|
+
vErrors.push(err48);
|
|
5635
6131
|
}
|
|
5636
6132
|
errors++;
|
|
5637
6133
|
}
|
|
5638
6134
|
}
|
|
5639
6135
|
if (data.collapsed !== void 0) {
|
|
5640
6136
|
if (typeof data.collapsed !== "boolean") {
|
|
5641
|
-
const
|
|
6137
|
+
const err49 = { instancePath: instancePath + "/collapsed", schemaPath: "#/properties/collapsed/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
|
|
5642
6138
|
if (vErrors === null) {
|
|
5643
|
-
vErrors = [
|
|
6139
|
+
vErrors = [err49];
|
|
5644
6140
|
} else {
|
|
5645
|
-
vErrors.push(
|
|
6141
|
+
vErrors.push(err49);
|
|
5646
6142
|
}
|
|
5647
6143
|
errors++;
|
|
5648
6144
|
}
|
|
5649
6145
|
}
|
|
5650
6146
|
if (data.panels !== void 0) {
|
|
5651
|
-
let
|
|
5652
|
-
if (Array.isArray(
|
|
5653
|
-
const len4 =
|
|
6147
|
+
let data34 = data.panels;
|
|
6148
|
+
if (Array.isArray(data34)) {
|
|
6149
|
+
const len4 = data34.length;
|
|
5654
6150
|
for (let i4 = 0; i4 < len4; i4++) {
|
|
5655
|
-
if (!wrapper0.validate(
|
|
6151
|
+
if (!wrapper0.validate(data34[i4], { instancePath: instancePath + "/panels/" + i4, parentData: data34, parentDataProperty: i4, rootData })) {
|
|
5656
6152
|
vErrors = vErrors === null ? wrapper0.validate.errors : vErrors.concat(wrapper0.validate.errors);
|
|
5657
6153
|
errors = vErrors.length;
|
|
5658
6154
|
}
|
|
5659
6155
|
}
|
|
5660
6156
|
} else {
|
|
5661
|
-
const
|
|
6157
|
+
const err50 = { instancePath: instancePath + "/panels", schemaPath: "#/properties/panels/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
5662
6158
|
if (vErrors === null) {
|
|
5663
|
-
vErrors = [
|
|
6159
|
+
vErrors = [err50];
|
|
5664
6160
|
} else {
|
|
5665
|
-
vErrors.push(
|
|
6161
|
+
vErrors.push(err50);
|
|
5666
6162
|
}
|
|
5667
6163
|
errors++;
|
|
5668
6164
|
}
|
|
5669
6165
|
}
|
|
5670
6166
|
if (data.repeat !== void 0) {
|
|
5671
6167
|
if (typeof data.repeat !== "string") {
|
|
5672
|
-
const
|
|
6168
|
+
const err51 = { instancePath: instancePath + "/repeat", schemaPath: "#/properties/repeat/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5673
6169
|
if (vErrors === null) {
|
|
5674
|
-
vErrors = [
|
|
6170
|
+
vErrors = [err51];
|
|
5675
6171
|
} else {
|
|
5676
|
-
vErrors.push(
|
|
6172
|
+
vErrors.push(err51);
|
|
5677
6173
|
}
|
|
5678
6174
|
errors++;
|
|
5679
6175
|
}
|
|
5680
6176
|
}
|
|
5681
6177
|
if (data.repeatDirection !== void 0) {
|
|
5682
|
-
let
|
|
5683
|
-
if (typeof
|
|
5684
|
-
const
|
|
6178
|
+
let data37 = data.repeatDirection;
|
|
6179
|
+
if (typeof data37 !== "string") {
|
|
6180
|
+
const err52 = { instancePath: instancePath + "/repeatDirection", schemaPath: "#/properties/repeatDirection/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5685
6181
|
if (vErrors === null) {
|
|
5686
|
-
vErrors = [
|
|
6182
|
+
vErrors = [err52];
|
|
5687
6183
|
} else {
|
|
5688
|
-
vErrors.push(
|
|
6184
|
+
vErrors.push(err52);
|
|
5689
6185
|
}
|
|
5690
6186
|
errors++;
|
|
5691
6187
|
}
|
|
5692
|
-
if (!(
|
|
5693
|
-
const
|
|
6188
|
+
if (!(data37 === "h" || data37 === "v")) {
|
|
6189
|
+
const err53 = { instancePath: instancePath + "/repeatDirection", schemaPath: "#/properties/repeatDirection/enum", keyword: "enum", params: { allowedValues: schema18.properties.repeatDirection.enum }, message: "must be equal to one of the allowed values" };
|
|
5694
6190
|
if (vErrors === null) {
|
|
5695
|
-
vErrors = [
|
|
6191
|
+
vErrors = [err53];
|
|
5696
6192
|
} else {
|
|
5697
|
-
vErrors.push(
|
|
6193
|
+
vErrors.push(err53);
|
|
5698
6194
|
}
|
|
5699
6195
|
errors++;
|
|
5700
6196
|
}
|
|
5701
6197
|
}
|
|
5702
6198
|
if (data.maxPerRow !== void 0) {
|
|
5703
6199
|
if (!(typeof data.maxPerRow == "number")) {
|
|
5704
|
-
const
|
|
6200
|
+
const err54 = { instancePath: instancePath + "/maxPerRow", schemaPath: "#/properties/maxPerRow/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
5705
6201
|
if (vErrors === null) {
|
|
5706
|
-
vErrors = [
|
|
6202
|
+
vErrors = [err54];
|
|
5707
6203
|
} else {
|
|
5708
|
-
vErrors.push(
|
|
6204
|
+
vErrors.push(err54);
|
|
5709
6205
|
}
|
|
5710
6206
|
errors++;
|
|
5711
6207
|
}
|
|
5712
6208
|
}
|
|
5713
6209
|
if (data.scopedVars !== void 0) {
|
|
5714
|
-
let
|
|
5715
|
-
if (
|
|
5716
|
-
for (const key0 in
|
|
5717
|
-
let
|
|
5718
|
-
if (
|
|
5719
|
-
if (
|
|
5720
|
-
const
|
|
6210
|
+
let data39 = data.scopedVars;
|
|
6211
|
+
if (data39 && typeof data39 == "object" && !Array.isArray(data39)) {
|
|
6212
|
+
for (const key0 in data39) {
|
|
6213
|
+
let data40 = data39[key0];
|
|
6214
|
+
if (data40 && typeof data40 == "object" && !Array.isArray(data40)) {
|
|
6215
|
+
if (data40.text === void 0) {
|
|
6216
|
+
const err55 = { instancePath: instancePath + "/scopedVars/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/scopedVars/additionalProperties/required", keyword: "required", params: { missingProperty: "text" }, message: "must have required property 'text'" };
|
|
5721
6217
|
if (vErrors === null) {
|
|
5722
|
-
vErrors = [
|
|
6218
|
+
vErrors = [err55];
|
|
5723
6219
|
} else {
|
|
5724
|
-
vErrors.push(
|
|
6220
|
+
vErrors.push(err55);
|
|
5725
6221
|
}
|
|
5726
6222
|
errors++;
|
|
5727
6223
|
}
|
|
5728
|
-
if (
|
|
5729
|
-
const
|
|
6224
|
+
if (data40.value === void 0) {
|
|
6225
|
+
const err56 = { instancePath: instancePath + "/scopedVars/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/scopedVars/additionalProperties/required", keyword: "required", params: { missingProperty: "value" }, message: "must have required property 'value'" };
|
|
5730
6226
|
if (vErrors === null) {
|
|
5731
|
-
vErrors = [
|
|
6227
|
+
vErrors = [err56];
|
|
5732
6228
|
} else {
|
|
5733
|
-
vErrors.push(
|
|
6229
|
+
vErrors.push(err56);
|
|
5734
6230
|
}
|
|
5735
6231
|
errors++;
|
|
5736
6232
|
}
|
|
5737
|
-
if (
|
|
5738
|
-
if (typeof
|
|
5739
|
-
const
|
|
6233
|
+
if (data40.text !== void 0) {
|
|
6234
|
+
if (typeof data40.text !== "string") {
|
|
6235
|
+
const err57 = { instancePath: instancePath + "/scopedVars/" + key0.replace(/~/g, "~0").replace(/\//g, "~1") + "/text", schemaPath: "#/properties/scopedVars/additionalProperties/properties/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5740
6236
|
if (vErrors === null) {
|
|
5741
|
-
vErrors = [
|
|
6237
|
+
vErrors = [err57];
|
|
5742
6238
|
} else {
|
|
5743
|
-
vErrors.push(
|
|
6239
|
+
vErrors.push(err57);
|
|
5744
6240
|
}
|
|
5745
6241
|
errors++;
|
|
5746
6242
|
}
|
|
5747
6243
|
}
|
|
5748
|
-
if (
|
|
5749
|
-
if (typeof
|
|
5750
|
-
const
|
|
6244
|
+
if (data40.value !== void 0) {
|
|
6245
|
+
if (typeof data40.value !== "string") {
|
|
6246
|
+
const err58 = { instancePath: instancePath + "/scopedVars/" + key0.replace(/~/g, "~0").replace(/\//g, "~1") + "/value", schemaPath: "#/properties/scopedVars/additionalProperties/properties/value/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5751
6247
|
if (vErrors === null) {
|
|
5752
|
-
vErrors = [
|
|
6248
|
+
vErrors = [err58];
|
|
5753
6249
|
} else {
|
|
5754
|
-
vErrors.push(
|
|
6250
|
+
vErrors.push(err58);
|
|
5755
6251
|
}
|
|
5756
6252
|
errors++;
|
|
5757
6253
|
}
|
|
5758
6254
|
}
|
|
5759
6255
|
} else {
|
|
5760
|
-
const
|
|
6256
|
+
const err59 = { instancePath: instancePath + "/scopedVars/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/scopedVars/additionalProperties/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5761
6257
|
if (vErrors === null) {
|
|
5762
|
-
vErrors = [
|
|
6258
|
+
vErrors = [err59];
|
|
5763
6259
|
} else {
|
|
5764
|
-
vErrors.push(
|
|
6260
|
+
vErrors.push(err59);
|
|
5765
6261
|
}
|
|
5766
6262
|
errors++;
|
|
5767
6263
|
}
|
|
5768
6264
|
}
|
|
5769
6265
|
} else {
|
|
5770
|
-
const
|
|
6266
|
+
const err60 = { instancePath: instancePath + "/scopedVars", schemaPath: "#/properties/scopedVars/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5771
6267
|
if (vErrors === null) {
|
|
5772
|
-
vErrors = [
|
|
6268
|
+
vErrors = [err60];
|
|
5773
6269
|
} else {
|
|
5774
|
-
vErrors.push(
|
|
6270
|
+
vErrors.push(err60);
|
|
5775
6271
|
}
|
|
5776
6272
|
errors++;
|
|
5777
6273
|
}
|
|
5778
6274
|
}
|
|
5779
6275
|
if (data.mobile !== void 0) {
|
|
5780
|
-
let
|
|
5781
|
-
if (
|
|
5782
|
-
if (
|
|
5783
|
-
if (!(typeof
|
|
5784
|
-
const
|
|
6276
|
+
let data43 = data.mobile;
|
|
6277
|
+
if (data43 && typeof data43 == "object" && !Array.isArray(data43)) {
|
|
6278
|
+
if (data43.span !== void 0) {
|
|
6279
|
+
if (!(typeof data43.span == "number")) {
|
|
6280
|
+
const err61 = { instancePath: instancePath + "/mobile/span", schemaPath: "#/definitions/MobileOptions/properties/span/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
5785
6281
|
if (vErrors === null) {
|
|
5786
|
-
vErrors = [
|
|
6282
|
+
vErrors = [err61];
|
|
5787
6283
|
} else {
|
|
5788
|
-
vErrors.push(
|
|
6284
|
+
vErrors.push(err61);
|
|
5789
6285
|
}
|
|
5790
6286
|
errors++;
|
|
5791
6287
|
}
|
|
5792
6288
|
}
|
|
5793
|
-
if (
|
|
5794
|
-
if (!(typeof
|
|
5795
|
-
const
|
|
6289
|
+
if (data43.h !== void 0) {
|
|
6290
|
+
if (!(typeof data43.h == "number")) {
|
|
6291
|
+
const err62 = { instancePath: instancePath + "/mobile/h", schemaPath: "#/definitions/MobileOptions/properties/h/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
5796
6292
|
if (vErrors === null) {
|
|
5797
|
-
vErrors = [
|
|
6293
|
+
vErrors = [err62];
|
|
5798
6294
|
} else {
|
|
5799
|
-
vErrors.push(
|
|
6295
|
+
vErrors.push(err62);
|
|
5800
6296
|
}
|
|
5801
6297
|
errors++;
|
|
5802
6298
|
}
|
|
5803
6299
|
}
|
|
5804
|
-
if (
|
|
5805
|
-
if (typeof
|
|
5806
|
-
const
|
|
6300
|
+
if (data43.hidden !== void 0) {
|
|
6301
|
+
if (typeof data43.hidden !== "boolean") {
|
|
6302
|
+
const err63 = { instancePath: instancePath + "/mobile/hidden", schemaPath: "#/definitions/MobileOptions/properties/hidden/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
|
|
5807
6303
|
if (vErrors === null) {
|
|
5808
|
-
vErrors = [
|
|
6304
|
+
vErrors = [err63];
|
|
5809
6305
|
} else {
|
|
5810
|
-
vErrors.push(
|
|
6306
|
+
vErrors.push(err63);
|
|
5811
6307
|
}
|
|
5812
6308
|
errors++;
|
|
5813
6309
|
}
|
|
5814
6310
|
}
|
|
5815
6311
|
} else {
|
|
5816
|
-
const
|
|
6312
|
+
const err64 = { instancePath: instancePath + "/mobile", schemaPath: "#/definitions/MobileOptions/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5817
6313
|
if (vErrors === null) {
|
|
5818
|
-
vErrors = [
|
|
6314
|
+
vErrors = [err64];
|
|
5819
6315
|
} else {
|
|
5820
|
-
vErrors.push(
|
|
6316
|
+
vErrors.push(err64);
|
|
5821
6317
|
}
|
|
5822
6318
|
errors++;
|
|
5823
6319
|
}
|
|
5824
6320
|
}
|
|
5825
6321
|
if (data.links !== void 0) {
|
|
5826
|
-
let
|
|
5827
|
-
if (Array.isArray(
|
|
5828
|
-
const len5 =
|
|
6322
|
+
let data47 = data.links;
|
|
6323
|
+
if (Array.isArray(data47)) {
|
|
6324
|
+
const len5 = data47.length;
|
|
5829
6325
|
for (let i5 = 0; i5 < len5; i5++) {
|
|
5830
|
-
let
|
|
5831
|
-
if (
|
|
5832
|
-
if (
|
|
5833
|
-
const
|
|
6326
|
+
let data48 = data47[i5];
|
|
6327
|
+
if (data48 && typeof data48 == "object" && !Array.isArray(data48)) {
|
|
6328
|
+
if (data48.title === void 0) {
|
|
6329
|
+
const err65 = { instancePath: instancePath + "/links/" + i5, schemaPath: "#/definitions/DataLink/required", keyword: "required", params: { missingProperty: "title" }, message: "must have required property 'title'" };
|
|
5834
6330
|
if (vErrors === null) {
|
|
5835
|
-
vErrors = [
|
|
6331
|
+
vErrors = [err65];
|
|
5836
6332
|
} else {
|
|
5837
|
-
vErrors.push(
|
|
6333
|
+
vErrors.push(err65);
|
|
5838
6334
|
}
|
|
5839
6335
|
errors++;
|
|
5840
6336
|
}
|
|
5841
|
-
if (
|
|
5842
|
-
const
|
|
6337
|
+
if (data48.url === void 0) {
|
|
6338
|
+
const err66 = { instancePath: instancePath + "/links/" + i5, schemaPath: "#/definitions/DataLink/required", keyword: "required", params: { missingProperty: "url" }, message: "must have required property 'url'" };
|
|
5843
6339
|
if (vErrors === null) {
|
|
5844
|
-
vErrors = [
|
|
6340
|
+
vErrors = [err66];
|
|
5845
6341
|
} else {
|
|
5846
|
-
vErrors.push(
|
|
6342
|
+
vErrors.push(err66);
|
|
5847
6343
|
}
|
|
5848
6344
|
errors++;
|
|
5849
6345
|
}
|
|
5850
|
-
if (
|
|
5851
|
-
if (typeof
|
|
5852
|
-
const
|
|
6346
|
+
if (data48.title !== void 0) {
|
|
6347
|
+
if (typeof data48.title !== "string") {
|
|
6348
|
+
const err67 = { instancePath: instancePath + "/links/" + i5 + "/title", schemaPath: "#/definitions/DataLink/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5853
6349
|
if (vErrors === null) {
|
|
5854
|
-
vErrors = [
|
|
6350
|
+
vErrors = [err67];
|
|
5855
6351
|
} else {
|
|
5856
|
-
vErrors.push(
|
|
6352
|
+
vErrors.push(err67);
|
|
5857
6353
|
}
|
|
5858
6354
|
errors++;
|
|
5859
6355
|
}
|
|
5860
6356
|
}
|
|
5861
|
-
if (
|
|
5862
|
-
if (typeof
|
|
5863
|
-
const
|
|
6357
|
+
if (data48.url !== void 0) {
|
|
6358
|
+
if (typeof data48.url !== "string") {
|
|
6359
|
+
const err68 = { instancePath: instancePath + "/links/" + i5 + "/url", schemaPath: "#/definitions/DataLink/properties/url/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
5864
6360
|
if (vErrors === null) {
|
|
5865
|
-
vErrors = [
|
|
6361
|
+
vErrors = [err68];
|
|
5866
6362
|
} else {
|
|
5867
|
-
vErrors.push(
|
|
6363
|
+
vErrors.push(err68);
|
|
5868
6364
|
}
|
|
5869
6365
|
errors++;
|
|
5870
6366
|
}
|
|
5871
6367
|
}
|
|
5872
|
-
if (
|
|
5873
|
-
if (typeof
|
|
5874
|
-
const
|
|
6368
|
+
if (data48.targetBlank !== void 0) {
|
|
6369
|
+
if (typeof data48.targetBlank !== "boolean") {
|
|
6370
|
+
const err69 = { instancePath: instancePath + "/links/" + i5 + "/targetBlank", schemaPath: "#/definitions/DataLink/properties/targetBlank/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
|
|
5875
6371
|
if (vErrors === null) {
|
|
5876
|
-
vErrors = [
|
|
6372
|
+
vErrors = [err69];
|
|
5877
6373
|
} else {
|
|
5878
|
-
vErrors.push(
|
|
6374
|
+
vErrors.push(err69);
|
|
5879
6375
|
}
|
|
5880
6376
|
errors++;
|
|
5881
6377
|
}
|
|
5882
6378
|
}
|
|
5883
6379
|
} else {
|
|
5884
|
-
const
|
|
6380
|
+
const err70 = { instancePath: instancePath + "/links/" + i5, schemaPath: "#/definitions/DataLink/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5885
6381
|
if (vErrors === null) {
|
|
5886
|
-
vErrors = [
|
|
6382
|
+
vErrors = [err70];
|
|
5887
6383
|
} else {
|
|
5888
|
-
vErrors.push(
|
|
6384
|
+
vErrors.push(err70);
|
|
5889
6385
|
}
|
|
5890
6386
|
errors++;
|
|
5891
6387
|
}
|
|
5892
6388
|
}
|
|
5893
6389
|
} else {
|
|
5894
|
-
const
|
|
6390
|
+
const err71 = { instancePath: instancePath + "/links", schemaPath: "#/properties/links/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
5895
6391
|
if (vErrors === null) {
|
|
5896
|
-
vErrors = [
|
|
6392
|
+
vErrors = [err71];
|
|
5897
6393
|
} else {
|
|
5898
|
-
vErrors.push(
|
|
6394
|
+
vErrors.push(err71);
|
|
5899
6395
|
}
|
|
5900
6396
|
errors++;
|
|
5901
6397
|
}
|
|
5902
6398
|
}
|
|
5903
6399
|
} else {
|
|
5904
|
-
const
|
|
6400
|
+
const err72 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
5905
6401
|
if (vErrors === null) {
|
|
5906
|
-
vErrors = [
|
|
6402
|
+
vErrors = [err72];
|
|
5907
6403
|
} else {
|
|
5908
|
-
vErrors.push(
|
|
6404
|
+
vErrors.push(err72);
|
|
5909
6405
|
}
|
|
5910
6406
|
errors++;
|
|
5911
6407
|
}
|
|
5912
6408
|
validate18.errors = vErrors;
|
|
5913
6409
|
return errors === 0;
|
|
5914
6410
|
}
|
|
5915
|
-
var
|
|
5916
|
-
function
|
|
6411
|
+
var schema39 = { "type": "object", "properties": { "name": { "type": "string" }, "type": { "type": "string" }, "label": { "type": "string" }, "hide": { "type": "number" }, "query": {}, "current": { "type": "object", "properties": { "text": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }, "value": { "anyOf": [{ "type": "string" }, { "type": "array", "items": { "type": "string" } }] }, "selected": { "type": "boolean" } } }, "options": { "type": "array", "items": { "$ref": "#/definitions/VariableOption" } }, "multi": { "type": "boolean" }, "includeAll": { "type": "boolean" }, "allValue": { "type": ["string", "null"] }, "datasource": { "anyOf": [{ "$ref": "#/definitions/DataSourceRef" }, { "type": "string" }, { "type": "null" }], "description": "Query variables: where the options come from." }, "refresh": { "type": "number", "description": "Query variables: 0/missing = never, 1 = on dashboard load, 2 = on time range change." }, "regex": { "type": "string", "description": "Query variables: `/pattern/flags` applied to each option's text." }, "sort": { "type": "number", "description": "Query variables: 0 = query order, 1/2 = alpha, 3/4 = numeric, 5/6 = alpha ignoring case, 7/8 = natural. Odd ascending." } }, "required": ["name", "type"] };
|
|
6412
|
+
function validate33(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
5917
6413
|
let vErrors = null;
|
|
5918
6414
|
let errors = 0;
|
|
5919
6415
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -6332,7 +6828,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6332
6828
|
if (data.allValue !== void 0) {
|
|
6333
6829
|
let data19 = data.allValue;
|
|
6334
6830
|
if (typeof data19 !== "string" && data19 !== null) {
|
|
6335
|
-
const err31 = { instancePath: instancePath + "/allValue", schemaPath: "#/properties/allValue/type", keyword: "type", params: { type:
|
|
6831
|
+
const err31 = { instancePath: instancePath + "/allValue", schemaPath: "#/properties/allValue/type", keyword: "type", params: { type: schema39.properties.allValue.type }, message: "must be string,null" };
|
|
6336
6832
|
if (vErrors === null) {
|
|
6337
6833
|
vErrors = [err31];
|
|
6338
6834
|
} else {
|
|
@@ -6469,10 +6965,10 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6469
6965
|
}
|
|
6470
6966
|
errors++;
|
|
6471
6967
|
}
|
|
6472
|
-
|
|
6968
|
+
validate33.errors = vErrors;
|
|
6473
6969
|
return errors === 0;
|
|
6474
6970
|
}
|
|
6475
|
-
function
|
|
6971
|
+
function validate37(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
6476
6972
|
let vErrors = null;
|
|
6477
6973
|
let errors = 0;
|
|
6478
6974
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -6589,8 +7085,8 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6589
7085
|
if (Array.isArray(data8)) {
|
|
6590
7086
|
const len2 = data8.length;
|
|
6591
7087
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
6592
|
-
if (!
|
|
6593
|
-
vErrors = vErrors === null ?
|
|
7088
|
+
if (!validate33(data8[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data8, parentDataProperty: i2, rootData })) {
|
|
7089
|
+
vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
|
|
6594
7090
|
errors = vErrors.length;
|
|
6595
7091
|
}
|
|
6596
7092
|
}
|
|
@@ -6823,18 +7319,18 @@ function validate32(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6823
7319
|
}
|
|
6824
7320
|
errors++;
|
|
6825
7321
|
}
|
|
6826
|
-
|
|
7322
|
+
validate37.errors = vErrors;
|
|
6827
7323
|
return errors === 0;
|
|
6828
7324
|
}
|
|
6829
|
-
function
|
|
7325
|
+
function validate36(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
6830
7326
|
;
|
|
6831
7327
|
let vErrors = null;
|
|
6832
7328
|
let errors = 0;
|
|
6833
|
-
if (!
|
|
6834
|
-
vErrors = vErrors === null ?
|
|
7329
|
+
if (!validate37(data, { instancePath, parentData, parentDataProperty, rootData })) {
|
|
7330
|
+
vErrors = vErrors === null ? validate37.errors : vErrors.concat(validate37.errors);
|
|
6835
7331
|
errors = vErrors.length;
|
|
6836
7332
|
}
|
|
6837
|
-
|
|
7333
|
+
validate36.errors = vErrors;
|
|
6838
7334
|
return errors === 0;
|
|
6839
7335
|
}
|
|
6840
7336
|
function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
@@ -6971,8 +7467,8 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6971
7467
|
valid4 = valid4 || _valid0;
|
|
6972
7468
|
if (!valid4) {
|
|
6973
7469
|
const _errs15 = errors;
|
|
6974
|
-
if (!
|
|
6975
|
-
vErrors = vErrors === null ?
|
|
7470
|
+
if (!validate36(data5, { instancePath: instancePath + "/documents/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), parentData: data4, parentDataProperty: key1, rootData })) {
|
|
7471
|
+
vErrors = vErrors === null ? validate36.errors : vErrors.concat(validate36.errors);
|
|
6976
7472
|
errors = vErrors.length;
|
|
6977
7473
|
}
|
|
6978
7474
|
var _valid0 = _errs15 === errors;
|
|
@@ -7148,8 +7644,8 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7148
7644
|
if (Array.isArray(data8)) {
|
|
7149
7645
|
const len2 = data8.length;
|
|
7150
7646
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
7151
|
-
if (!
|
|
7152
|
-
vErrors = vErrors === null ?
|
|
7647
|
+
if (!validate33(data8[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data8, parentDataProperty: i2, rootData })) {
|
|
7648
|
+
vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
|
|
7153
7649
|
errors = vErrors.length;
|
|
7154
7650
|
}
|
|
7155
7651
|
}
|
|
@@ -7501,7 +7997,7 @@ function removeAt(root, pointer) {
|
|
|
7501
7997
|
const segs = pointer.split("/").slice(1).map((s) => s.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
7502
7998
|
const last = segs.pop();
|
|
7503
7999
|
let parent = root;
|
|
7504
|
-
for (const s of segs) parent = _optionalChain([parent, 'optionalAccess',
|
|
8000
|
+
for (const s of segs) parent = _optionalChain([parent, 'optionalAccess', _195 => _195[s]]);
|
|
7505
8001
|
if (Array.isArray(parent)) {
|
|
7506
8002
|
parent.splice(Number(last), 1);
|
|
7507
8003
|
return { array: parentOf(pointer), index: Number(last) };
|
|
@@ -7674,7 +8170,7 @@ var STANDARD = [
|
|
|
7674
8170
|
]
|
|
7675
8171
|
}
|
|
7676
8172
|
},
|
|
7677
|
-
{ path: field("color.fixedColor"), label: "Color", category: "Standard options", control: { kind: "color" }, showIf: (p) => _optionalChain([p, 'access',
|
|
8173
|
+
{ path: field("color.fixedColor"), label: "Color", category: "Standard options", control: { kind: "color" }, showIf: (p) => _optionalChain([p, 'access', _196 => _196.fieldConfig, 'optionalAccess', _197 => _197.defaults, 'optionalAccess', _198 => _198.color, 'optionalAccess', _199 => _199.mode]) === "fixed" }
|
|
7678
8174
|
];
|
|
7679
8175
|
var THRESHOLDS = {
|
|
7680
8176
|
path: field("thresholds"),
|
|
@@ -7700,7 +8196,7 @@ var CALC = {
|
|
|
7700
8196
|
default: "lastNotNull",
|
|
7701
8197
|
control: { kind: "select", choices: Object.entries(REDUCER_LABELS).map(([value, label]) => ({ label, value })) },
|
|
7702
8198
|
stored: "string[]",
|
|
7703
|
-
get: (p) => _optionalChain([p, 'access',
|
|
8199
|
+
get: (p) => _optionalChain([p, 'access', _200 => _200.options, 'optionalAccess', _201 => _201.reduceOptions, 'optionalAccess', _202 => _202.calcs, 'optionalAccess', _203 => _203[0]]),
|
|
7704
8200
|
set: (p, v) => setOptionValue(p, "options.reduceOptions.calcs", v === void 0 ? void 0 : [v])
|
|
7705
8201
|
};
|
|
7706
8202
|
var LEGEND = {
|
|
@@ -7710,9 +8206,9 @@ var LEGEND = {
|
|
|
7710
8206
|
help: "When there are two or more series.",
|
|
7711
8207
|
default: true,
|
|
7712
8208
|
control: { kind: "boolean" },
|
|
7713
|
-
get: (p) => _optionalChain([p, 'access',
|
|
8209
|
+
get: (p) => _optionalChain([p, 'access', _204 => _204.options, 'optionalAccess', _205 => _205.legend, 'optionalAccess', _206 => _206.showLegend]) !== false && _optionalChain([p, 'access', _207 => _207.options, 'optionalAccess', _208 => _208.legend, 'optionalAccess', _209 => _209.displayMode]) !== "hidden",
|
|
7714
8210
|
// Grafana's older displayMode "hidden" would otherwise keep it hidden.
|
|
7715
|
-
set: (p, v) => setOptionValue(v ? setOptionValue(p, "options.legend.displayMode", _optionalChain([p, 'access',
|
|
8211
|
+
set: (p, v) => setOptionValue(v ? setOptionValue(p, "options.legend.displayMode", _optionalChain([p, 'access', _210 => _210.options, 'optionalAccess', _211 => _211.legend, 'optionalAccess', _212 => _212.displayMode]) === "hidden" ? void 0 : _optionalChain([p, 'access', _213 => _213.options, 'optionalAccess', _214 => _214.legend, 'optionalAccess', _215 => _215.displayMode])) : p, "options.legend.showLegend", v ? void 0 : false)
|
|
7716
8212
|
};
|
|
7717
8213
|
var AXIS_LABEL = { path: field("custom.axisLabel"), label: "Axis label", category: "Axis", control: { kind: "text" } };
|
|
7718
8214
|
var AXIS_PLACEMENT = {
|
|
@@ -7966,7 +8462,7 @@ function overrideProperties(type) {
|
|
|
7966
8462
|
return out;
|
|
7967
8463
|
}
|
|
7968
8464
|
function panelOverrides(panel) {
|
|
7969
|
-
const o = _optionalChain([panel, 'access',
|
|
8465
|
+
const o = _optionalChain([panel, 'access', _216 => _216.fieldConfig, 'optionalAccess', _217 => _217.overrides]);
|
|
7970
8466
|
return Array.isArray(o) ? o : [];
|
|
7971
8467
|
}
|
|
7972
8468
|
function setOverrides(panel, overrides) {
|
|
@@ -8008,25 +8504,58 @@ function prepareDashboard(json, file) {
|
|
|
8008
8504
|
});
|
|
8009
8505
|
dashboard.panels.forEach((p, i) => {
|
|
8010
8506
|
for (const r of cleanPanelOptions(p)) removed.push({ path: `panels[${i}]${r.path}`, message: r.message });
|
|
8011
|
-
_optionalChain([p, 'access',
|
|
8507
|
+
_optionalChain([p, 'access', _218 => _218.panels, 'optionalAccess', _219 => _219.forEach, 'call', _220 => _220((child, j) => {
|
|
8012
8508
|
for (const r of cleanPanelOptions(child)) removed.push({ path: `panels[${i}].panels[${j}]${r.path}`, message: r.message });
|
|
8013
8509
|
})]);
|
|
8014
8510
|
});
|
|
8015
8511
|
return {
|
|
8016
8512
|
dashboard,
|
|
8017
8513
|
issues: [
|
|
8514
|
+
...groupIssues(dashboard).map((r) => ({ severity: "warning", path: `${file}: ${r.path}`, message: r.message })),
|
|
8018
8515
|
...removed.map((r) => ({ severity: "warning", path: `${file}: ${r.path}`, message: `${r.message}, so it\u2019s ignored` })),
|
|
8019
8516
|
...schemaWarnings(dashboard, file, [])
|
|
8020
8517
|
]
|
|
8021
8518
|
};
|
|
8022
8519
|
}
|
|
8520
|
+
function groupIssues(dashboard) {
|
|
8521
|
+
const out = [];
|
|
8522
|
+
const located2 = dashboard.panels.flatMap((p, i) => [
|
|
8523
|
+
{ p, at: `panels[${i}]` },
|
|
8524
|
+
...p.type === "row" ? (_nullishCoalesce(p.panels, () => ( []))).map((c, j) => ({ p: c, at: `panels[${i}].panels[${j}]` })) : []
|
|
8525
|
+
]);
|
|
8526
|
+
const recordedAt = /* @__PURE__ */ new Map();
|
|
8527
|
+
for (const { p, at } of located2) if (isInputPanel(p) && !recordedAt.has(p.options.metric)) recordedAt.set(p.options.metric, at);
|
|
8528
|
+
for (const { p, at } of located2) {
|
|
8529
|
+
if (p.type !== INPUT_GROUP) continue;
|
|
8530
|
+
const fields = _optionalChain([p, 'access', _221 => _221.options, 'optionalAccess', _222 => _222.fields]);
|
|
8531
|
+
if (!Array.isArray(fields) || !fields.length) {
|
|
8532
|
+
out.push({ path: `${at}.options.fields`, message: "a group needs at least one field" });
|
|
8533
|
+
continue;
|
|
8534
|
+
}
|
|
8535
|
+
const mine = [];
|
|
8536
|
+
fields.forEach((f, k) => {
|
|
8537
|
+
const fat = `${at}.options.fields[${k}]`;
|
|
8538
|
+
if (!isObject3(f) || typeof f.type !== "string" || !isInputType(f.type)) return out.push({ path: `${fat}.type`, message: "must be an input-* type" });
|
|
8539
|
+
if (f.type === "input-counter") return out.push({ path: `${fat}.type`, message: "counters record on tap, so they can\u2019t be in a group" });
|
|
8540
|
+
const metric = isObject3(f.options) ? f.options.metric : void 0;
|
|
8541
|
+
if (typeof metric !== "string" || !metric) return out.push({ path: `${fat}.options.metric`, message: "is required" });
|
|
8542
|
+
const other = recordedAt.get(metric);
|
|
8543
|
+
if (other) out.push({ path: `${fat}.options.metric`, message: `"${metric}" is also recorded by ${other}` });
|
|
8544
|
+
else recordedAt.set(metric, fat);
|
|
8545
|
+
mine.push(metric);
|
|
8546
|
+
});
|
|
8547
|
+
const titleFrom = _optionalChain([p, 'access', _223 => _223.options, 'optionalAccess', _224 => _224.titleFrom]);
|
|
8548
|
+
if (titleFrom !== void 0 && !mine.includes(titleFrom)) out.push({ path: `${at}.options.titleFrom`, message: `must be the metric of one of the group\u2019s fields` });
|
|
8549
|
+
}
|
|
8550
|
+
return out;
|
|
8551
|
+
}
|
|
8023
8552
|
function panelProblem(p) {
|
|
8024
8553
|
if (!isObject3(p)) return { at: "", message: "must be an object", summary: "must be an object" };
|
|
8025
8554
|
if (typeof p.type !== "string") return { at: ".type", message: "must be a string", summary: "has no type" };
|
|
8026
8555
|
const g = p.gridPos;
|
|
8027
8556
|
if (!isObject3(g) || !["x", "y", "w", "h"].every((k) => typeof g[k] === "number"))
|
|
8028
8557
|
return { at: ".gridPos", message: "must have numeric x, y, w and h", summary: "has no usable gridPos" };
|
|
8029
|
-
if (p.type.startsWith("input-") && !nonEmptyString(_optionalChain([p, 'access',
|
|
8558
|
+
if (p.type.startsWith("input-") && p.type !== INPUT_GROUP && !nonEmptyString(_optionalChain([p, 'access', _225 => _225.options, 'optionalAccess', _226 => _226.metric]))) {
|
|
8030
8559
|
const message = `${p.type} needs a metric to record to`;
|
|
8031
8560
|
return { at: ".options.metric", message, summary: message };
|
|
8032
8561
|
}
|
|
@@ -8100,17 +8629,17 @@ function resolveUrl(base, rel) {
|
|
|
8100
8629
|
function httpFetchJson(options = {}) {
|
|
8101
8630
|
const seen = /* @__PURE__ */ new Map();
|
|
8102
8631
|
return async (url, { accept = "application/json", signal } = {}) => {
|
|
8103
|
-
const extra = await _asyncNullishCoalesce(await _optionalChain([options, 'access',
|
|
8632
|
+
const extra = await _asyncNullishCoalesce(await _optionalChain([options, 'access', _227 => _227.headers, 'optionalCall', _228 => _228()]), async () => ( {}));
|
|
8104
8633
|
const key = JSON.stringify([url, accept, extra]);
|
|
8105
8634
|
const last = seen.get(key);
|
|
8106
8635
|
const get = (etag2) => fetch(url, { headers: { Accept: accept, ...extra, ...etag2 && { "If-None-Match": etag2 } }, cache: "no-store", signal });
|
|
8107
|
-
const res = await get(_optionalChain([last, 'optionalAccess',
|
|
8108
|
-
if (!last || _optionalChain([signal, 'optionalAccess',
|
|
8636
|
+
const res = await get(_optionalChain([last, 'optionalAccess', _229 => _229.etag])).catch((e) => {
|
|
8637
|
+
if (!last || _optionalChain([signal, 'optionalAccess', _230 => _230.aborted])) throw e;
|
|
8109
8638
|
seen.delete(key);
|
|
8110
8639
|
return get();
|
|
8111
8640
|
});
|
|
8112
8641
|
if (res.status === 304 && last) return last.json;
|
|
8113
|
-
if (!res.ok) throw new Error(_nullishCoalesce(_optionalChain([options, 'access',
|
|
8642
|
+
if (!res.ok) throw new Error(_nullishCoalesce(_optionalChain([options, 'access', _231 => _231.httpError, 'optionalCall', _232 => _232(res.status)]), () => ( `HTTP ${res.status}`)));
|
|
8114
8643
|
const json = JSON.parse(await res.text());
|
|
8115
8644
|
const etag = res.headers.get("ETag");
|
|
8116
8645
|
if (etag) seen.set(key, { etag, json });
|
|
@@ -8232,8 +8761,8 @@ var ConfigLoader = (_class2 = class {
|
|
|
8232
8761
|
async start() {
|
|
8233
8762
|
const { url, cache: cache2 } = this.options;
|
|
8234
8763
|
if (!url) return;
|
|
8235
|
-
const cached = await _optionalChain([cache2, 'optionalAccess',
|
|
8236
|
-
const bundle = _optionalChain([cached, 'optionalAccess',
|
|
8764
|
+
const cached = await _optionalChain([cache2, 'optionalAccess', _233 => _233.read, 'call', _234 => _234(), 'access', _235 => _235.catch, 'call', _236 => _236(() => null)]);
|
|
8765
|
+
const bundle = _optionalChain([cached, 'optionalAccess', _237 => _237.url]) === url ? revalidateBundle(cached.bundle) : void 0;
|
|
8237
8766
|
if (cached && bundle && !this.snapshot.fetchedAt) {
|
|
8238
8767
|
this.lastJson = JSON.stringify(bundle);
|
|
8239
8768
|
this.set({ bundle, source: "cache", fetchedAt: cached.fetchedAt, revision: cached.revision });
|
|
@@ -8262,7 +8791,7 @@ var ConfigLoader = (_class2 = class {
|
|
|
8262
8791
|
const { bundle, issues, revision, unreachable } = result;
|
|
8263
8792
|
if (!bundle) {
|
|
8264
8793
|
const errors = issues.filter((i) => i.severity === "error").length;
|
|
8265
|
-
const error = unreachable ? _optionalChain([issues, 'access',
|
|
8794
|
+
const error = unreachable ? _optionalChain([issues, 'access', _238 => _238[0], 'optionalAccess', _239 => _239.message]) : errors === 1 ? "1 error" : `${errors} errors`;
|
|
8266
8795
|
return this.set(
|
|
8267
8796
|
{ loading: false, error, unreachable: !!unreachable, issues },
|
|
8268
8797
|
this.snapshot.loading || error !== this.snapshot.error || !!unreachable !== !!this.snapshot.unreachable || !sameIssues(issues, this.snapshot.issues)
|
|
@@ -8272,7 +8801,7 @@ var ConfigLoader = (_class2 = class {
|
|
|
8272
8801
|
const changed = json !== this.lastJson;
|
|
8273
8802
|
this.lastJson = json;
|
|
8274
8803
|
const fetchedAt = Date.now();
|
|
8275
|
-
if (changed || revision !== this.snapshot.revision) _optionalChain([cache2, 'optionalAccess',
|
|
8804
|
+
if (changed || revision !== this.snapshot.revision) _optionalChain([cache2, 'optionalAccess', _240 => _240.write, 'call', _241 => _241({ url, fetchedAt, bundle, revision }), 'access', _242 => _242.catch, 'call', _243 => _243(() => {
|
|
8276
8805
|
})]);
|
|
8277
8806
|
this.set(
|
|
8278
8807
|
{ ...changed && { bundle }, source: "remote", fetchedAt, revision, loading: false, error: void 0, unreachable: void 0, issues },
|
|
@@ -8289,7 +8818,7 @@ var ConfigLoader = (_class2 = class {
|
|
|
8289
8818
|
/** Stops the loader: cancels a fetch in flight, and nothing it does afterwards changes the state or the cache. */
|
|
8290
8819
|
dispose() {
|
|
8291
8820
|
this.disposed = true;
|
|
8292
|
-
_optionalChain([this, 'access',
|
|
8821
|
+
_optionalChain([this, 'access', _244 => _244.controller, 'optionalAccess', _245 => _245.abort, 'call', _246 => _246()]);
|
|
8293
8822
|
this.listeners.clear();
|
|
8294
8823
|
}
|
|
8295
8824
|
/** `notify: false` drops the patch, so the snapshot only changes when listeners hear about it. */
|
|
@@ -8310,7 +8839,7 @@ function tabIdFor(title, taken) {
|
|
|
8310
8839
|
}
|
|
8311
8840
|
function screenOfType(type, from, docs) {
|
|
8312
8841
|
const shown = from ? screenDocuments(from) : [];
|
|
8313
|
-
const firstOf = (ids) => _nullishCoalesce(_nullishCoalesce(_optionalChain([shown, 'access',
|
|
8842
|
+
const firstOf = (ids) => _nullishCoalesce(_nullishCoalesce(_optionalChain([shown, 'access', _247 => _247.find, 'call', _248 => _248((d) => ids.includes(d.id)), 'optionalAccess', _249 => _249.id]), () => ( ids[0])), () => ( ""));
|
|
8314
8843
|
switch (type) {
|
|
8315
8844
|
case "dashboard":
|
|
8316
8845
|
return { type, dashboard: firstOf(docs.dashboards) };
|
|
@@ -8323,7 +8852,7 @@ function screenOfType(type, from, docs) {
|
|
|
8323
8852
|
}
|
|
8324
8853
|
}
|
|
8325
8854
|
function screenDocuments(screen) {
|
|
8326
|
-
switch (_optionalChain([screen, 'optionalAccess',
|
|
8855
|
+
switch (_optionalChain([screen, 'optionalAccess', _250 => _250.type])) {
|
|
8327
8856
|
case "dashboard":
|
|
8328
8857
|
return [{ id: screen.dashboard, kind: "dashboard" }];
|
|
8329
8858
|
case "forms":
|
|
@@ -9738,8 +10267,8 @@ function removeNode(text, path) {
|
|
|
9738
10267
|
const tree = parseTree2(text);
|
|
9739
10268
|
const value = tree && findNodeAtLocation2(tree, path);
|
|
9740
10269
|
if (!value) return text;
|
|
9741
|
-
const node = _optionalChain([value, 'access',
|
|
9742
|
-
const siblings = _nullishCoalesce(_optionalChain([node, 'access',
|
|
10270
|
+
const node = _optionalChain([value, 'access', _251 => _251.parent, 'optionalAccess', _252 => _252.type]) === "property" ? value.parent : value;
|
|
10271
|
+
const siblings = _nullishCoalesce(_optionalChain([node, 'access', _253 => _253.parent, 'optionalAccess', _254 => _254.children]), () => ( []));
|
|
9743
10272
|
const i = siblings.indexOf(node);
|
|
9744
10273
|
const next = siblings[i + 1];
|
|
9745
10274
|
const prev = siblings[i - 1];
|
|
@@ -9822,20 +10351,20 @@ function removeDocumentFromManifest(text, id) {
|
|
|
9822
10351
|
const edits = [];
|
|
9823
10352
|
const removedTabs = [];
|
|
9824
10353
|
for (let i = tabs.length - 1; i >= 0; i--) {
|
|
9825
|
-
const screen = _optionalChain([tabs, 'access',
|
|
10354
|
+
const screen = _optionalChain([tabs, 'access', _255 => _255[i], 'optionalAccess', _256 => _256.screen]);
|
|
9826
10355
|
const at = ["tabs", i, "screen"];
|
|
9827
10356
|
const removeTab = () => {
|
|
9828
10357
|
edits.push({ path: ["tabs", i], remove: true });
|
|
9829
10358
|
removedTabs.unshift(_nullishCoalesce(tabs[i].title, () => ( tabs[i].id)));
|
|
9830
10359
|
};
|
|
9831
|
-
if (_optionalChain([screen, 'optionalAccess',
|
|
9832
|
-
else if (_optionalChain([screen, 'optionalAccess',
|
|
10360
|
+
if (_optionalChain([screen, 'optionalAccess', _257 => _257.type]) === "dashboard" && screen.dashboard === id) removeTab();
|
|
10361
|
+
else if (_optionalChain([screen, 'optionalAccess', _258 => _258.type]) === "forms" && Array.isArray(screen.forms) && screen.forms.includes(id)) {
|
|
9833
10362
|
if (screen.forms.every((f) => f === id)) removeTab();
|
|
9834
10363
|
else for (let j = screen.forms.length - 1; j >= 0; j--) if (screen.forms[j] === id) edits.push({ path: [...at, "forms", j], remove: true });
|
|
9835
|
-
} else if (_optionalChain([screen, 'optionalAccess',
|
|
10364
|
+
} else if (_optionalChain([screen, 'optionalAccess', _259 => _259.type]) === "menu" && Array.isArray(screen.items))
|
|
9836
10365
|
for (let j = screen.items.length - 1; j >= 0; j--) {
|
|
9837
10366
|
const item = screen.items[j];
|
|
9838
|
-
if (_optionalChain([item, 'optionalAccess',
|
|
10367
|
+
if (_optionalChain([item, 'optionalAccess', _260 => _260.dashboard]) === id || _optionalChain([item, 'optionalAccess', _261 => _261.form]) === id) edits.push({ path: [...at, "items", j], remove: true });
|
|
9839
10368
|
}
|
|
9840
10369
|
}
|
|
9841
10370
|
if (tabs.length && removedTabs.length === tabs.length) throw new Error(`Every tab shows only "${id}". Add another tab first`);
|
|
@@ -9848,21 +10377,21 @@ function renameDocumentInManifest(text, from, to, path) {
|
|
|
9848
10377
|
if (to !== from && to in manifest.documents) throw new Error(`There\u2019s already a document "${to}"`);
|
|
9849
10378
|
const edits = [];
|
|
9850
10379
|
(Array.isArray(manifest.tabs) ? manifest.tabs : []).forEach((tab, i) => {
|
|
9851
|
-
const screen = _optionalChain([tab, 'optionalAccess',
|
|
10380
|
+
const screen = _optionalChain([tab, 'optionalAccess', _262 => _262.screen]);
|
|
9852
10381
|
const at = ["tabs", i, "screen"];
|
|
9853
|
-
if (_optionalChain([screen, 'optionalAccess',
|
|
9854
|
-
if (_optionalChain([screen, 'optionalAccess',
|
|
10382
|
+
if (_optionalChain([screen, 'optionalAccess', _263 => _263.type]) === "dashboard" && screen.dashboard === from) edits.push({ path: [...at, "dashboard"], value: to });
|
|
10383
|
+
if (_optionalChain([screen, 'optionalAccess', _264 => _264.type]) === "forms" && Array.isArray(screen.forms))
|
|
9855
10384
|
screen.forms.forEach((f, j) => f === from && edits.push({ path: [...at, "forms", j], value: to }));
|
|
9856
|
-
if (_optionalChain([screen, 'optionalAccess',
|
|
10385
|
+
if (_optionalChain([screen, 'optionalAccess', _265 => _265.type]) === "menu" && Array.isArray(screen.items))
|
|
9857
10386
|
screen.items.forEach((item, j) => {
|
|
9858
|
-
if (_optionalChain([item, 'optionalAccess',
|
|
9859
|
-
if (_optionalChain([item, 'optionalAccess',
|
|
10387
|
+
if (_optionalChain([item, 'optionalAccess', _266 => _266.dashboard]) === from) edits.push({ path: [...at, "items", j, "dashboard"], value: to });
|
|
10388
|
+
if (_optionalChain([item, 'optionalAccess', _267 => _267.form]) === from) edits.push({ path: [...at, "items", j, "form"], value: to });
|
|
9860
10389
|
});
|
|
9861
10390
|
});
|
|
9862
10391
|
if (path !== void 0) edits.push({ path: ["documents", from], value: path });
|
|
9863
10392
|
let out = applyJsonEdits(text, edits);
|
|
9864
10393
|
if (to !== from) {
|
|
9865
|
-
const key = _optionalChain([findNodeAtLocation2, 'call',
|
|
10394
|
+
const key = _optionalChain([findNodeAtLocation2, 'call', _268 => _268(parseTree2(out), ["documents", from]), 'optionalAccess', _269 => _269.parent, 'optionalAccess', _270 => _270.children, 'optionalAccess', _271 => _271[0]]);
|
|
9866
10395
|
if (key) out = out.slice(0, key.offset) + JSON.stringify(to) + out.slice(key.offset + key.length);
|
|
9867
10396
|
}
|
|
9868
10397
|
return out;
|
|
@@ -9880,9 +10409,12 @@ function inputs(text) {
|
|
|
9880
10409
|
const d = parse2(text);
|
|
9881
10410
|
const out = /* @__PURE__ */ new Map();
|
|
9882
10411
|
try {
|
|
9883
|
-
if (d)
|
|
9884
|
-
for (const p of
|
|
9885
|
-
|
|
10412
|
+
if (d)
|
|
10413
|
+
for (const p of d.panels.flatMap((x) => x.type === "row" ? [x, ..._nullishCoalesce(x.panels, () => ( []))] : [x])) {
|
|
10414
|
+
if (typeof p.id !== "number") continue;
|
|
10415
|
+
if (isInputGroup(p)) p.options.fields.forEach((f, i) => typeof _optionalChain([f, 'optionalAccess', _272 => _272.options, 'optionalAccess', _273 => _273.metric]) === "string" && out.set(`${p.id}.${i}`, { metric: f.options.metric, title: f.title }));
|
|
10416
|
+
else if (isInputPanel(p)) out.set(String(p.id), { metric: p.options.metric, title: p.title });
|
|
10417
|
+
}
|
|
9886
10418
|
} catch (e15) {
|
|
9887
10419
|
}
|
|
9888
10420
|
return out;
|
|
@@ -9890,7 +10422,7 @@ function inputs(text) {
|
|
|
9890
10422
|
function reads(text, metric) {
|
|
9891
10423
|
const d = parse2(text);
|
|
9892
10424
|
const panels = d ? d.panels.flatMap((p) => p.type === "row" ? [p, ..._nullishCoalesce(p.panels, () => ( []))] : [p]) : [];
|
|
9893
|
-
return panels.some((p) => (_nullishCoalesce(_optionalChain([p, 'optionalAccess',
|
|
10425
|
+
return panels.some((p) => (_nullishCoalesce(_optionalChain([p, 'optionalAccess', _274 => _274.targets]), () => ( []))).some((t) => t.metric === metric));
|
|
9894
10426
|
}
|
|
9895
10427
|
function metricChanges(before, after) {
|
|
9896
10428
|
const merged = { ...before, ...after };
|
|
@@ -9905,7 +10437,7 @@ function metricChanges(before, after) {
|
|
|
9905
10437
|
for (const [file, text] of Object.entries(after)) {
|
|
9906
10438
|
const old = inputs(before[file]);
|
|
9907
10439
|
for (const [id, input] of inputs(text))
|
|
9908
|
-
if (_optionalChain([old, 'access',
|
|
10440
|
+
if (_optionalChain([old, 'access', _275 => _275.get, 'call', _276 => _276(id), 'optionalAccess', _277 => _277.metric]) === metric && input.metric !== metric) rename ??= { metric, renamedTo: input.metric, file, input: input.title, readBy };
|
|
9909
10441
|
}
|
|
9910
10442
|
changes.push(_nullishCoalesce(rename, () => ( { metric, readBy })));
|
|
9911
10443
|
}
|
|
@@ -9945,14 +10477,14 @@ function variableWithType(v, type) {
|
|
|
9945
10477
|
}
|
|
9946
10478
|
function currentFor(v, value) {
|
|
9947
10479
|
const options = variableOptions({ ...v, current: void 0 });
|
|
9948
|
-
const text = (x) => x === ALL ? "All" : _nullishCoalesce(_optionalChain([options, 'access',
|
|
10480
|
+
const text = (x) => x === ALL ? "All" : _nullishCoalesce(_optionalChain([options, 'access', _278 => _278.find, 'call', _279 => _279((o) => o.value === x), 'optionalAccess', _280 => _280.text]), () => ( x));
|
|
9949
10481
|
return Array.isArray(value) ? { text: value.map(text), value } : { text: text(value), value };
|
|
9950
10482
|
}
|
|
9951
10483
|
function variableWithQuery(v, query) {
|
|
9952
10484
|
const { options: _, current, ...rest } = v;
|
|
9953
10485
|
const next = { ...rest, query };
|
|
9954
10486
|
if (v.type === "textbox" || v.type === "constant") return { ...next, current: { text: query, value: query } };
|
|
9955
|
-
const value = selectValue(next, _optionalChain([current, 'optionalAccess',
|
|
10487
|
+
const value = selectValue(next, _optionalChain([current, 'optionalAccess', _281 => _281.value]), variableOptions(next));
|
|
9956
10488
|
return { ...next, current: currentFor(next, value) };
|
|
9957
10489
|
}
|
|
9958
10490
|
function variableWithCurrent(v, value) {
|
|
@@ -9962,13 +10494,13 @@ function variableWithFlags(v, flags) {
|
|
|
9962
10494
|
const next = { ...v, ...flags };
|
|
9963
10495
|
if (!next.multi) delete next.multi;
|
|
9964
10496
|
if (!next.includeAll) delete next.includeAll;
|
|
9965
|
-
const raw = _optionalChain([v, 'access',
|
|
10497
|
+
const raw = _optionalChain([v, 'access', _282 => _282.current, 'optionalAccess', _283 => _283.value]);
|
|
9966
10498
|
const current = next.multi ? raw == null ? [] : Array.isArray(raw) ? raw : [raw] : Array.isArray(raw) ? raw[0] : raw;
|
|
9967
10499
|
return variableWithCurrent(next, selectValue(next, current, variableOptions({ ...next, current: void 0 })));
|
|
9968
10500
|
}
|
|
9969
10501
|
var refers = (name, flags) => new RegExp(`\\$${name}\\b|\\$\\{${name}(:\\w+)?\\}|\\[\\[${name}(:\\w+)?\\]\\]`, flags);
|
|
9970
10502
|
function allPanels2(dashboard) {
|
|
9971
|
-
return (_nullishCoalesce(dashboard.panels, () => ( []))).flatMap((p) => _optionalChain([p, 'optionalAccess',
|
|
10503
|
+
return (_nullishCoalesce(dashboard.panels, () => ( []))).flatMap((p) => _optionalChain([p, 'optionalAccess', _284 => _284.type]) === "row" ? [p, ..._nullishCoalesce(p.panels, () => ( []))] : [p]).filter((p) => p && typeof p === "object");
|
|
9972
10504
|
}
|
|
9973
10505
|
function variableUses(dashboard, name) {
|
|
9974
10506
|
const re = refers(name);
|
|
@@ -10040,7 +10572,7 @@ function locate(text, tree, path) {
|
|
|
10040
10572
|
for (let n = segs.length; n >= 0; n--) {
|
|
10041
10573
|
const node = findNodeAtLocation2(tree, segs.slice(0, n));
|
|
10042
10574
|
if (!node) continue;
|
|
10043
|
-
const key = _optionalChain([node, 'access',
|
|
10575
|
+
const key = _optionalChain([node, 'access', _285 => _285.parent, 'optionalAccess', _286 => _286.type]) === "property" ? _optionalChain([node, 'access', _287 => _287.parent, 'access', _288 => _288.children, 'optionalAccess', _289 => _289[0]]) : void 0;
|
|
10044
10576
|
if ((node.type === "object" || node.type === "array") && key) return located(text, key.offset, key.length);
|
|
10045
10577
|
if (node.type === "object" || node.type === "array") return located(text, node.offset, 1);
|
|
10046
10578
|
return located(text, node.offset, node.length);
|
|
@@ -10102,12 +10634,19 @@ function setJsonValue(text, path, value) {
|
|
|
10102
10634
|
return applyJsonEdits(text, [{ path, value }]);
|
|
10103
10635
|
}
|
|
10104
10636
|
var PANEL_TYPES = {
|
|
10105
|
-
form: ["input-number", "input-slider", "input-select", "input-toggle", "input-rating", "input-text", "input-counter", "input-duration", "text", "row"],
|
|
10637
|
+
form: ["input-number", "input-slider", "input-select", "input-toggle", "input-rating", "input-text", "input-counter", "input-duration", "input-group", "text", "row"],
|
|
10106
10638
|
dashboard: ["timeseries", "barchart", "stat", "gauge", "bargauge", "piechart", "table", "text", "row"]
|
|
10107
10639
|
};
|
|
10108
10640
|
function newPanel(type, metric = "value") {
|
|
10109
10641
|
const title = type === "row" ? "Section" : metric.replace(/[-_]+/g, " ").replace(/^./, (c) => c.toUpperCase());
|
|
10110
10642
|
if (type === "row") return { type, title, gridPos: { x: 0, y: 0, w: 24, h: 1 } };
|
|
10643
|
+
if (type === INPUT_GROUP) {
|
|
10644
|
+
const fields = [
|
|
10645
|
+
{ type: "input-text", title: "Name", options: { metric: `${metric}-name` } },
|
|
10646
|
+
{ type: "input-number", title: "Amount", options: { metric: `${metric}-amount` } }
|
|
10647
|
+
];
|
|
10648
|
+
return { type, title: "Items", gridPos: { x: 0, y: 0, w: 24, h: 10 }, options: { itemTitle: "Item", fields } };
|
|
10649
|
+
}
|
|
10111
10650
|
if (isInputType(type)) {
|
|
10112
10651
|
const options = { metric };
|
|
10113
10652
|
if (type === "input-select") options.choices = [{ label: "A", value: "a" }, { label: "B", value: "b" }];
|
|
@@ -10165,7 +10704,7 @@ async function errorText(res) {
|
|
|
10165
10704
|
}
|
|
10166
10705
|
}
|
|
10167
10706
|
async function authHeaders(token) {
|
|
10168
|
-
const t = await _optionalChain([token, 'optionalCall',
|
|
10707
|
+
const t = await _optionalChain([token, 'optionalCall', _290 => _290()]);
|
|
10169
10708
|
return t ? { Authorization: `Bearer ${t}` } : {};
|
|
10170
10709
|
}
|
|
10171
10710
|
var HttpConfigFiles = (_class3 = class {
|
|
@@ -10271,14 +10810,14 @@ function fetchJsonWithToken(token) {
|
|
|
10271
10810
|
return httpFetchJson({ headers: () => authHeaders(token), httpError: (status) => status === 401 ? "not signed in" : `HTTP ${status}` });
|
|
10272
10811
|
}
|
|
10273
10812
|
async function readConfigFiles(source) {
|
|
10274
|
-
const all = await _optionalChain([source, 'access',
|
|
10813
|
+
const all = await _optionalChain([source, 'access', _291 => _291.readAll, 'optionalCall', _292 => _292()]);
|
|
10275
10814
|
const read = all ? async (p) => {
|
|
10276
10815
|
if (!(p in all)) throw new Error(NOT_FOUND);
|
|
10277
10816
|
return all[p];
|
|
10278
10817
|
} : (p) => source.read(p);
|
|
10279
10818
|
const files = { [source.manifestPath]: await read(source.manifestPath) };
|
|
10280
10819
|
const { value } = parseJsonText(files[source.manifestPath]);
|
|
10281
|
-
const documents = _nullishCoalesce(_optionalChain([value, 'optionalAccess',
|
|
10820
|
+
const documents = _nullishCoalesce(_optionalChain([value, 'optionalAccess', _293 => _293.documents]), () => ( {}));
|
|
10282
10821
|
const paths = [...new Set(Object.values(documents).filter((d) => typeof d === "string"))];
|
|
10283
10822
|
await Promise.all(
|
|
10284
10823
|
paths.map(async (p) => {
|
|
@@ -10332,7 +10871,7 @@ var CANVAS_ROW_HEADER = 32;
|
|
|
10332
10871
|
function panelSize(panel, mode) {
|
|
10333
10872
|
const p = pos(panel);
|
|
10334
10873
|
if (mode === "grid") return { span: clampW(p.w), h: clampH(p.h) };
|
|
10335
|
-
return { span: panelSpan(panel, "phone"), h: clampH(_nullishCoalesce(_optionalChain([panel, 'access',
|
|
10874
|
+
return { span: panelSpan(panel, "phone"), h: clampH(_nullishCoalesce(_optionalChain([panel, 'access', _294 => _294.mobile, 'optionalAccess', _295 => _295.h]), () => ( p.h))) };
|
|
10336
10875
|
}
|
|
10337
10876
|
function layoutCanvas(panels, order, mode, width, override) {
|
|
10338
10877
|
return mode === "grid" ? layoutGridCanvas(panels, width, override) : layoutPhoneCanvas(panels, order, width, override);
|
|
@@ -10352,7 +10891,7 @@ function layoutGridCanvas(panels, width, override) {
|
|
|
10352
10891
|
boxes = [...boxes];
|
|
10353
10892
|
boxes[override.index] = b;
|
|
10354
10893
|
}
|
|
10355
|
-
const settled = settleBoxes(boxes, _optionalChain([override, 'optionalAccess',
|
|
10894
|
+
const settled = settleBoxes(boxes, _optionalChain([override, 'optionalAccess', _296 => _296.index]));
|
|
10356
10895
|
const items = settled.map((b, index) => {
|
|
10357
10896
|
const row = isRow(panels[index]);
|
|
10358
10897
|
return { index, row, x: b.x * colW, y: gridOffsetPx(b.y), width: b.w * colW - CANVAS_GAP, height: row ? gridUnitsToPx(1) : gridUnitsToPx(b.h), span: b.w, h: b.h };
|
|
@@ -10396,12 +10935,12 @@ function layoutPhoneCanvas(panels, order, width, override) {
|
|
|
10396
10935
|
y += CANVAS_ROW_HEADER + CANVAS_GAP;
|
|
10397
10936
|
continue;
|
|
10398
10937
|
}
|
|
10399
|
-
if (mode === "phone" && _optionalChain([panel, 'access',
|
|
10938
|
+
if (mode === "phone" && _optionalChain([panel, 'access', _297 => _297.mobile, 'optionalAccess', _298 => _298.hidden])) {
|
|
10400
10939
|
hidden.push(index);
|
|
10401
10940
|
continue;
|
|
10402
10941
|
}
|
|
10403
10942
|
const natural = panelSize(panel, mode);
|
|
10404
|
-
const size = _optionalChain([override, 'optionalAccess',
|
|
10943
|
+
const size = _optionalChain([override, 'optionalAccess', _299 => _299.index]) === index ? { span: clampW(_nullishCoalesce(override.span, () => ( natural.span))), h: clampH(_nullishCoalesce(override.h, () => ( natural.h))) } : natural;
|
|
10405
10944
|
if (used + size.span > GRID_COLUMNS) flush();
|
|
10406
10945
|
line.push({ index, row: false, x: 0, y: 0, width: 0, height: 0, ...size });
|
|
10407
10946
|
used += size.span;
|
|
@@ -10419,7 +10958,7 @@ function dropTarget(canvas, x, y, dragging) {
|
|
|
10419
10958
|
for (const c of pool) if (distance(c) < distance(best)) best = c;
|
|
10420
10959
|
const after = best.row ? y > best.y + best.height / 2 : x > best.x + best.width / 2;
|
|
10421
10960
|
if (!after) return best.index;
|
|
10422
|
-
return _nullishCoalesce(_optionalChain([items, 'access',
|
|
10961
|
+
return _nullishCoalesce(_optionalChain([items, 'access', _300 => _300[items.indexOf(best) + 1], 'optionalAccess', _301 => _301.index]), () => ( null));
|
|
10423
10962
|
}
|
|
10424
10963
|
function movePanel(panels, index, before) {
|
|
10425
10964
|
if (before === index) return panels;
|
|
@@ -10611,16 +11150,25 @@ var refers2 = (name) => new RegExp(`\\$${name}\\b|\\$\\{${name}(:\\w+)?\\}|\\[\\
|
|
|
10611
11150
|
var withChildren = (p) => [p, ...isRow(p) ? _nullishCoalesce(p.panels, () => ( [])) : []];
|
|
10612
11151
|
function panelMetrics(p) {
|
|
10613
11152
|
const found = [];
|
|
10614
|
-
if (isInputType(p.type) && typeof _optionalChain([p, 'access',
|
|
11153
|
+
if (isInputType(p.type) && typeof _optionalChain([p, 'access', _302 => _302.options, 'optionalAccess', _303 => _303.metric]) === "string") found.push(p.options.metric);
|
|
11154
|
+
if (p.type === INPUT_GROUP && Array.isArray(_optionalChain([p, 'access', _304 => _304.options, 'optionalAccess', _305 => _305.fields]))) {
|
|
11155
|
+
for (const f of p.options.fields) if (typeof _optionalChain([f, 'optionalAccess', _306 => _306.options, 'optionalAccess', _307 => _307.metric]) === "string") found.push(f.options.metric);
|
|
11156
|
+
}
|
|
10615
11157
|
for (const t of _nullishCoalesce(p.targets, () => ( []))) if (typeof t.metric === "string" && t.metric && !t.metric.startsWith("$")) found.push(t.metric);
|
|
10616
11158
|
return found;
|
|
10617
11159
|
}
|
|
10618
11160
|
function renameMetrics(panels, map) {
|
|
10619
11161
|
const rename = (p) => {
|
|
10620
11162
|
let out = p;
|
|
10621
|
-
if (isInputType(p.type) && typeof _optionalChain([p, 'access',
|
|
10622
|
-
if (_optionalChain([p, 'access',
|
|
10623
|
-
|
|
11163
|
+
if (isInputType(p.type) && typeof _optionalChain([p, 'access', _308 => _308.options, 'optionalAccess', _309 => _309.metric]) === "string" && map[p.options.metric]) out = { ...out, options: { ...out.options, metric: map[p.options.metric] } };
|
|
11164
|
+
if (p.type === INPUT_GROUP && Array.isArray(_optionalChain([p, 'access', _310 => _310.options, 'optionalAccess', _311 => _311.fields]))) {
|
|
11165
|
+
const to = (m) => typeof m === "string" && map[m] || m;
|
|
11166
|
+
const fields = p.options.fields.map((f) => _optionalChain([f, 'optionalAccess', _312 => _312.options]) && to(f.options.metric) !== f.options.metric ? { ...f, options: { ...f.options, metric: to(f.options.metric) } } : f);
|
|
11167
|
+
const titleFrom = to(p.options.titleFrom);
|
|
11168
|
+
out = { ...out, options: { ...out.options, fields, ...titleFrom !== void 0 && { titleFrom } } };
|
|
11169
|
+
}
|
|
11170
|
+
if (_optionalChain([p, 'access', _313 => _313.targets, 'optionalAccess', _314 => _314.some, 'call', _315 => _315((t) => typeof t.metric === "string" && map[t.metric])])) out = { ...out, targets: p.targets.map((t) => typeof t.metric === "string" && map[t.metric] ? { ...t, metric: map[t.metric] } : t) };
|
|
11171
|
+
if (_optionalChain([p, 'access', _316 => _316.panels, 'optionalAccess', _317 => _317.length])) out = { ...out, panels: p.panels.map(rename) };
|
|
10624
11172
|
return out;
|
|
10625
11173
|
};
|
|
10626
11174
|
return panels.map(rename);
|
|
@@ -10640,7 +11188,7 @@ function copyPanels(dashboard, indices) {
|
|
|
10640
11188
|
}
|
|
10641
11189
|
}
|
|
10642
11190
|
const chosen = order.filter((i) => picked.has(i)).map((i) => panels[i]);
|
|
10643
|
-
return snippetOf(chosen, _nullishCoalesce(_optionalChain([dashboard, 'access',
|
|
11191
|
+
return snippetOf(chosen, _nullishCoalesce(_optionalChain([dashboard, 'access', _318 => _318.templating, 'optionalAccess', _319 => _319.list]), () => ( [])));
|
|
10644
11192
|
}
|
|
10645
11193
|
function snippetOf(panels, available) {
|
|
10646
11194
|
const left = Math.min(...panels.map((p) => pos2(p).x));
|
|
@@ -10669,7 +11217,7 @@ function snippetOf(panels, available) {
|
|
|
10669
11217
|
return {
|
|
10670
11218
|
$modelform: "panels",
|
|
10671
11219
|
version: SNIPPET_VERSION,
|
|
10672
|
-
kind: all.some((p) =>
|
|
11220
|
+
kind: all.some((p) => isFormPanelType(p.type)) ? "form" : "dashboard",
|
|
10673
11221
|
panels: out,
|
|
10674
11222
|
variables: available.filter((v) => used.has(v.name)),
|
|
10675
11223
|
metrics: [...new Set(all.flatMap(panelMetrics))]
|
|
@@ -10708,7 +11256,7 @@ var sameVariable = (a, b) => {
|
|
|
10708
11256
|
return strip(a) === strip(b);
|
|
10709
11257
|
};
|
|
10710
11258
|
function previewPaste(dashboard, snippet) {
|
|
10711
|
-
const { added, renamed } = mergeVariables(_nullishCoalesce(_optionalChain([dashboard, 'access',
|
|
11259
|
+
const { added, renamed } = mergeVariables(_nullishCoalesce(_optionalChain([dashboard, 'access', _320 => _320.templating, 'optionalAccess', _321 => _321.list]), () => ( [])), snippet.variables);
|
|
10712
11260
|
return { added, renamed };
|
|
10713
11261
|
}
|
|
10714
11262
|
function mergeVariables(existing, incoming) {
|
|
@@ -10735,17 +11283,17 @@ function mergeVariables(existing, incoming) {
|
|
|
10735
11283
|
}
|
|
10736
11284
|
function pasteSnippet(dashboard, snippet, options = {}) {
|
|
10737
11285
|
const existing = _nullishCoalesce(dashboard.panels, () => ( []));
|
|
10738
|
-
const kind = _nullishCoalesce(options.kind, () => ( (existing.flatMap(withChildren).some((p) =>
|
|
11286
|
+
const kind = _nullishCoalesce(options.kind, () => ( (existing.flatMap(withChildren).some((p) => isFormPanelType(p.type)) ? "form" : "dashboard")));
|
|
10739
11287
|
const skipped = [];
|
|
10740
11288
|
const keep = (p) => {
|
|
10741
|
-
if (kind === "dashboard" &&
|
|
11289
|
+
if (kind === "dashboard" && isFormPanelType(p.type)) {
|
|
10742
11290
|
skipped.push(p.title || p.type);
|
|
10743
11291
|
return false;
|
|
10744
11292
|
}
|
|
10745
11293
|
return true;
|
|
10746
11294
|
};
|
|
10747
11295
|
let incoming = snippet.panels.filter(keep).map((p) => p.panels ? { ...p, panels: p.panels.filter(keep) } : p);
|
|
10748
|
-
const { variables, added, renamed } = mergeVariables(_nullishCoalesce(_optionalChain([dashboard, 'access',
|
|
11296
|
+
const { variables, added, renamed } = mergeVariables(_nullishCoalesce(_optionalChain([dashboard, 'access', _322 => _322.templating, 'optionalAccess', _323 => _323.list]), () => ( [])), snippet.variables);
|
|
10749
11297
|
for (const [from, to] of Object.entries(renamed)) incoming = renameVariableInPanels(incoming, from, to);
|
|
10750
11298
|
if (options.metrics) incoming = renameMetrics(incoming, options.metrics);
|
|
10751
11299
|
const after = options.after != null ? existing[options.after] : void 0;
|
|
@@ -10766,6 +11314,165 @@ function pasteSnippet(dashboard, snippet, options = {}) {
|
|
|
10766
11314
|
};
|
|
10767
11315
|
}
|
|
10768
11316
|
|
|
11317
|
+
// src/core/templates.ts
|
|
11318
|
+
var TEMPLATE_VERSION = 1;
|
|
11319
|
+
var isObject5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
11320
|
+
var allPanels3 = (d) => (_nullishCoalesce(d.panels, () => ( []))).flatMap((p) => [p, ...p.type === "row" ? _nullishCoalesce(p.panels, () => ( [])) : []]);
|
|
11321
|
+
var documentMetrics = (d) => [...new Set(allPanels3(d).flatMap(panelMetrics))];
|
|
11322
|
+
var recordedBy = (d) => inputPanels(d).map((p) => p.options.metric);
|
|
11323
|
+
var metricsOf = (documents) => [...new Set(documents.flatMap((d) => documentMetrics(d.dashboard)))];
|
|
11324
|
+
function tabsShowing(tabs, ids) {
|
|
11325
|
+
return tabs.filter((t) => {
|
|
11326
|
+
const shown = screenDocuments(t.screen);
|
|
11327
|
+
return shown.length > 0 && shown.every((d) => ids.has(d.id));
|
|
11328
|
+
});
|
|
11329
|
+
}
|
|
11330
|
+
function makeTemplate(manifest, documents, ids, meta) {
|
|
11331
|
+
const docs = ids.filter((id) => documents[id]).map((id) => ({ kind: inputPanels(documents[id]).length ? "form" : "dashboard", id, dashboard: structuredClone(documents[id]) }));
|
|
11332
|
+
return {
|
|
11333
|
+
$modelform: "template",
|
|
11334
|
+
version: TEMPLATE_VERSION,
|
|
11335
|
+
title: meta.title,
|
|
11336
|
+
description: _nullishCoalesce(meta.description, () => ( "")),
|
|
11337
|
+
documents: docs,
|
|
11338
|
+
tabs: structuredClone(tabsShowing(_nullishCoalesce(manifest.tabs, () => ( [])), new Set(docs.map((d) => d.id)))),
|
|
11339
|
+
metrics: metricsOf(docs)
|
|
11340
|
+
};
|
|
11341
|
+
}
|
|
11342
|
+
function parseTemplate(text) {
|
|
11343
|
+
let json;
|
|
11344
|
+
try {
|
|
11345
|
+
json = JSON.parse(text);
|
|
11346
|
+
} catch (e20) {
|
|
11347
|
+
return { error: "That isn\u2019t JSON" };
|
|
11348
|
+
}
|
|
11349
|
+
if (!isObject5(json) || json.$modelform !== "template") return { error: "That isn\u2019t a template" };
|
|
11350
|
+
if (typeof json.version !== "number" || json.version > TEMPLATE_VERSION) return { error: "That template comes from a newer version of modelform" };
|
|
11351
|
+
if (typeof json.title !== "string" || !json.title.trim()) return { error: "The template has no title" };
|
|
11352
|
+
if (!Array.isArray(json.documents)) return { error: "The template has no documents list" };
|
|
11353
|
+
const documents = [];
|
|
11354
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11355
|
+
for (const [i, d] of json.documents.entries()) {
|
|
11356
|
+
if (!isObject5(d) || d.kind !== "form" && d.kind !== "dashboard" || typeof d.id !== "string" || !/^[A-Za-z0-9_-]+$/.test(d.id))
|
|
11357
|
+
return { error: `Document ${i + 1} needs a kind (form or dashboard) and an id of letters, digits, - or _` };
|
|
11358
|
+
if (seen.has(d.id)) return { error: `Two documents are called "${d.id}"` };
|
|
11359
|
+
seen.add(d.id);
|
|
11360
|
+
const { dashboard, issues } = prepareDashboard(d.dashboard, d.id);
|
|
11361
|
+
if (!dashboard) return { error: `"${d.id}" can\u2019t be shown: ${_nullishCoalesce(_optionalChain([issues, 'access', _324 => _324.find, 'call', _325 => _325((x) => x.severity === "error"), 'optionalAccess', _326 => _326.message]), () => ( "it isn\u2019t a dashboard"))}` };
|
|
11362
|
+
documents.push({ kind: d.kind, id: d.id, dashboard });
|
|
11363
|
+
}
|
|
11364
|
+
const tabs = Array.isArray(json.tabs) ? json.tabs.filter((t) => isObject5(t) && typeof t.id === "string" && typeof t.title === "string" && isObject5(t.screen)) : [];
|
|
11365
|
+
return {
|
|
11366
|
+
template: {
|
|
11367
|
+
$modelform: "template",
|
|
11368
|
+
version: TEMPLATE_VERSION,
|
|
11369
|
+
title: json.title.trim(),
|
|
11370
|
+
description: typeof json.description === "string" ? json.description : "",
|
|
11371
|
+
documents,
|
|
11372
|
+
tabs: tabsShowing(tabs, seen),
|
|
11373
|
+
metrics: metricsOf(documents)
|
|
11374
|
+
}
|
|
11375
|
+
};
|
|
11376
|
+
}
|
|
11377
|
+
function templateNeeds(template, recorded, chosen, metrics = {}) {
|
|
11378
|
+
const config = new Set(recorded);
|
|
11379
|
+
const docs = template.documents.filter((d) => !chosen || chosen.includes(d.id));
|
|
11380
|
+
const ownForms = new Set(docs.filter((d) => d.kind === "form").flatMap((d) => recordedBy(d.dashboard)));
|
|
11381
|
+
const unknown = [...new Set(docs.flatMap((d) => documentMetrics(d.dashboard)))].filter((m) => !config.has(m) && !ownForms.has(m) && !(m in metrics));
|
|
11382
|
+
const covered = template.documents.filter((d) => d.kind === "form").filter((d) => {
|
|
11383
|
+
const recordedHere = recordedBy(d.dashboard);
|
|
11384
|
+
return recordedHere.length > 0 && recordedHere.every((m) => config.has(_nullishCoalesce(metrics[m], () => ( m))));
|
|
11385
|
+
}).map((d) => d.id);
|
|
11386
|
+
return { unknown, covered };
|
|
11387
|
+
}
|
|
11388
|
+
function unique(base, free) {
|
|
11389
|
+
let id = base;
|
|
11390
|
+
for (let n = 2; !free(id); n++) id = `${base}-${n}`;
|
|
11391
|
+
return id;
|
|
11392
|
+
}
|
|
11393
|
+
function retarget(screen, ids) {
|
|
11394
|
+
switch (screen.type) {
|
|
11395
|
+
case "dashboard":
|
|
11396
|
+
return ids[screen.dashboard] ? { ...screen, dashboard: ids[screen.dashboard] } : null;
|
|
11397
|
+
case "forms": {
|
|
11398
|
+
const forms = screen.forms.filter((f) => ids[f]).map((f) => ids[f]);
|
|
11399
|
+
return forms.length ? { ...screen, forms } : null;
|
|
11400
|
+
}
|
|
11401
|
+
case "menu": {
|
|
11402
|
+
const items = screen.items.filter((i) => i.dashboard && ids[i.dashboard] || i.form && ids[i.form]).map((i) => ({ ...i, ...i.dashboard && { dashboard: ids[i.dashboard] }, ...i.form && { form: ids[i.form] } }));
|
|
11403
|
+
return items.length ? { ...screen, items } : null;
|
|
11404
|
+
}
|
|
11405
|
+
}
|
|
11406
|
+
}
|
|
11407
|
+
function applyTemplate(manifestText, paths, template, options = {}) {
|
|
11408
|
+
let manifest;
|
|
11409
|
+
try {
|
|
11410
|
+
manifest = JSON.parse(manifestText);
|
|
11411
|
+
} catch (e21) {
|
|
11412
|
+
throw new Error("The manifest isn\u2019t valid JSON");
|
|
11413
|
+
}
|
|
11414
|
+
const taken = new Set(Object.keys(_nullishCoalesce(manifest.documents, () => ( {}))));
|
|
11415
|
+
const files = new Set(paths);
|
|
11416
|
+
const folder = (kind) => kind === "form" ? "forms" : "dashboards";
|
|
11417
|
+
const edits = [];
|
|
11418
|
+
const out = {};
|
|
11419
|
+
const ids = {};
|
|
11420
|
+
for (const doc of template.documents) {
|
|
11421
|
+
if (options.documents && !options.documents.includes(doc.id)) continue;
|
|
11422
|
+
const id = unique(doc.id, (c) => !taken.has(c) && !files.has(`${folder(doc.kind)}/${c}.json`));
|
|
11423
|
+
const path = `${folder(doc.kind)}/${id}.json`;
|
|
11424
|
+
taken.add(id);
|
|
11425
|
+
files.add(path);
|
|
11426
|
+
ids[doc.id] = id;
|
|
11427
|
+
const dashboard = options.metrics ? { ...doc.dashboard, panels: renameMetrics(_nullishCoalesce(doc.dashboard.panels, () => ( [])), options.metrics) } : doc.dashboard;
|
|
11428
|
+
out[path] = JSON.stringify(dashboard, null, 2) + "\n";
|
|
11429
|
+
if (manifest.documents) edits.push({ path: ["documents", id], value: path });
|
|
11430
|
+
else {
|
|
11431
|
+
edits.push({ path: ["documents"], value: { [id]: path } });
|
|
11432
|
+
manifest.documents = {};
|
|
11433
|
+
}
|
|
11434
|
+
}
|
|
11435
|
+
const tabIds = (_nullishCoalesce(manifest.tabs, () => ( []))).map((t) => t.id);
|
|
11436
|
+
const added = [];
|
|
11437
|
+
let at = _nullishCoalesce(_optionalChain([manifest, 'access', _327 => _327.tabs, 'optionalAccess', _328 => _328.length]), () => ( 0));
|
|
11438
|
+
for (const tab of template.tabs) {
|
|
11439
|
+
if (!_optionalChain([options, 'access', _329 => _329.tabs, 'optionalAccess', _330 => _330.includes, 'call', _331 => _331(tab.id)])) continue;
|
|
11440
|
+
const screen = retarget(tab.screen, ids);
|
|
11441
|
+
if (!screen) continue;
|
|
11442
|
+
const id = tabIdFor(tab.id, tabIds);
|
|
11443
|
+
tabIds.push(id);
|
|
11444
|
+
added.push(id);
|
|
11445
|
+
const value = { ...tab, id, screen };
|
|
11446
|
+
if (manifest.tabs) edits.push({ path: ["tabs", at++], value, insert: true });
|
|
11447
|
+
else {
|
|
11448
|
+
edits.push({ path: ["tabs"], value: [value] });
|
|
11449
|
+
manifest.tabs = [value];
|
|
11450
|
+
at = 1;
|
|
11451
|
+
}
|
|
11452
|
+
}
|
|
11453
|
+
return { manifest: applyJsonEdits(manifestText, edits), files: out, ids, tabs: added };
|
|
11454
|
+
}
|
|
11455
|
+
|
|
11456
|
+
|
|
11457
|
+
|
|
11458
|
+
|
|
11459
|
+
|
|
11460
|
+
|
|
11461
|
+
|
|
11462
|
+
|
|
11463
|
+
|
|
11464
|
+
|
|
11465
|
+
|
|
11466
|
+
|
|
11467
|
+
|
|
11468
|
+
|
|
11469
|
+
|
|
11470
|
+
|
|
11471
|
+
|
|
11472
|
+
|
|
11473
|
+
|
|
11474
|
+
|
|
11475
|
+
|
|
10769
11476
|
|
|
10770
11477
|
|
|
10771
11478
|
|
|
@@ -10968,4 +11675,4 @@ function pasteSnippet(dashboard, snippet, options = {}) {
|
|
|
10968
11675
|
|
|
10969
11676
|
|
|
10970
11677
|
|
|
10971
|
-
exports.frameLength = frameLength; exports.timeField = timeField; exports.numberFields = numberFields; exports.fieldDisplayName = fieldDisplayName; exports.toSeries = toSeries; exports.toXYSeries = toXYSeries; exports.uniqueNames = uniqueNames; exports.toMillis = toMillis; exports.parseTime = parseTime; exports.parseRange = parseRange; exports.addTime = addTime; exports.startOf = startOf; exports.parseDuration = parseDuration; exports.calculateInterval = calculateInterval; exports.formatDuration = formatDuration; exports.TIME_PRESETS = TIME_PRESETS; exports.RELATIVE_RANGES = RELATIVE_RANGES; exports.parseLocalDateTime = parseLocalDateTime; exports.formatLocalDateTime = formatLocalDateTime; exports.timeExprError = timeExprError; exports.describeRange = describeRange; exports.zoomRange = zoomRange; exports.ALL = ALL; exports.initialVariableValues = initialVariableValues; exports.variableOptions = variableOptions; exports.variableInfo = variableInfo; exports.visibleVariables = visibleVariables; exports.isSqlDatasource = isSqlDatasource; exports.framesToOptions = framesToOptions; exports.refineOptions = refineOptions; exports.selectValue = selectValue; exports.variableReferences = variableReferences; exports.interpolate = interpolate; exports.queryParam = queryParam; exports.interpolateDeep = interpolateDeep; exports.resolveTimezone = resolveTimezone; exports.valueText = valueText; exports.GRID_COLUMNS = GRID_COLUMNS; exports.gridUnitsToPx = gridUnitsToPx; exports.gridOffsetPx = gridOffsetPx; exports.compactGrid = compactGrid; exports.isRow = isRow; exports.layoutDashboard = layoutDashboard; exports.repeatOptions = repeatOptions; exports.panelKey = panelKey; exports.panelSpan = panelSpan; exports.applyTransformations = applyTransformations; exports.DASHBOARD_DS = DASHBOARD_DS; exports.dashboardSourceIds = dashboardSourceIds; exports.panelHasQueries = panelHasQueries; exports.queryPanel = queryPanel; exports.normalizeRef = normalizeRef; exports.refreshedVariables = refreshedVariables; exports.variableDependents = variableDependents; exports.variableOrder = variableOrder; exports.resolveVariables = resolveVariables; exports.REDUCER_LABELS = REDUCER_LABELS; exports.isReducer = isReducer; exports.reduce = reduce; exports.INPUT_OPTION_KEYS = INPUT_OPTION_KEYS; exports.INPUT_TYPES = INPUT_TYPES; exports.isInputType = isInputType; exports.isInputPanel = isInputPanel; exports.inputPanels = inputPanels; exports.parseClockDigits = parseClockDigits; exports.formatClock = formatClock; exports.toEntries = toEntries; exports.inputProblem = inputProblem; exports.entryToInputValue = entryToInputValue; exports.textSuggestions = textSuggestions; exports.entriesSavedWith = entriesSavedWith; exports.formatValue = formatValue; exports.thresholdStep = thresholdStep; exports.NAMED_COLORS = NAMED_COLORS; exports.resolveColor = resolveColor; exports.SERIES_PALETTE = SERIES_PALETTE; exports.seriesColor = seriesColor; exports.mappedResult = mappedResult; exports.formatDisplay = formatDisplay; exports.valueColor = valueColor; exports.resolveFieldConfig = resolveFieldConfig; exports.fieldMatches = fieldMatches; exports.GrafanaError = GrafanaError; exports.GrafanaClient = GrafanaClient; exports.GrafanaDataSource = GrafanaDataSource; exports.fromWire = fromWire; exports.LOCAL_DATASOURCE_TYPE = LOCAL_DATASOURCE_TYPE; exports.isLocalDatasource = isLocalDatasource; exports.LocalDataSource = LocalDataSource; exports.buildFrames = buildFrames; exports.MemoryEntryStore = MemoryEntryStore; exports.DEFAULT_GAZETTEER = DEFAULT_GAZETTEER; exports.parseGazetteer = parseGazetteer; exports.loadGazetteer = loadGazetteer; exports.resolveLinks = resolveLinks; exports.parseDashboardLink = parseDashboardLink; exports.applyDashboardLink = applyDashboardLink; exports.appSchema = appSchema; exports.dashboardSchema = dashboardSchema; exports.pointerToPath = pointerToPath; exports.manifestSchemaIssues = manifestSchemaIssues; exports.dashboardSchemaIssues = dashboardSchemaIssues; exports.cleanDashboard = cleanDashboard; exports.MAPPING_TYPES = MAPPING_TYPES; exports.SPECIAL_MATCHES = SPECIAL_MATCHES; exports.mappingRows = mappingRows; exports.rowsToMappings = rowsToMappings; exports.mappingRow = mappingRow; exports.mappingProblem = mappingProblem; exports.OPTION_CATEGORIES = OPTION_CATEGORIES; exports.UNIT_CHOICES = UNIT_CHOICES; exports.panelOptions = panelOptions; exports.getPath = getPath; exports.optionValue = optionValue; exports.setOption = setOption; exports.setOptionValue = setOptionValue; exports.cleanPanelOptions = cleanPanelOptions; exports.OVERRIDE_MATCHERS = OVERRIDE_MATCHERS; exports.overrideProperties = overrideProperties; exports.panelOverrides = panelOverrides; exports.setOverrides = setOverrides; exports.MANIFEST_VERSION = MANIFEST_VERSION; exports.validateManifest = validateManifest; exports.prepareDashboard = prepareDashboard; exports.validateDashboard = validateDashboard2; exports.validateBundle = validateBundle; exports.resolveUrl = resolveUrl; exports.httpFetchJson = httpFetchJson; exports.defaultFetchJson = defaultFetchJson; exports.BUNDLE_TYPE = BUNDLE_TYPE; exports.BUNDLE_ACCEPT = BUNDLE_ACCEPT; exports.isBundleResponse = isBundleResponse; exports.bundleRoot = bundleRoot; exports.assembleFromResponse = assembleFromResponse; exports.assembleBundle = assembleBundle; exports.fetchBundle = fetchBundle; exports.revalidateBundle = revalidateBundle; exports.ConfigLoader = ConfigLoader; exports.tabIdFor = tabIdFor; exports.screenOfType = screenOfType; exports.screenDocuments = screenDocuments; exports.documentUses = documentUses; exports.stringifyCompact = stringifyCompact; exports.applyJsonEdits = applyJsonEdits; exports.diffJson = diffJson; exports.documentIdFor = documentIdFor; exports.removeDocumentFromManifest = removeDocumentFromManifest; exports.renameDocumentInManifest = renameDocumentInManifest; exports.metricChanges = metricChanges; exports.REFRESH_CHOICES = REFRESH_CHOICES; exports.EDITABLE_VARIABLE_TYPES = EDITABLE_VARIABLE_TYPES; exports.isEditableVariableType = isEditableVariableType; exports.variableNameError = variableNameError; exports.newVariable = newVariable; exports.variableWithType = variableWithType; exports.variableWithQuery = variableWithQuery; exports.variableWithCurrent = variableWithCurrent; exports.variableWithFlags = variableWithFlags; exports.variableUses = variableUses; exports.renameVariableInPanels = renameVariableInPanels; exports.lineColumn = lineColumn; exports.parseJsonText = parseJsonText; exports.splitPath = splitPath; exports.locate = locate; exports.checkFiles = checkFiles; exports.bundleFromFiles = bundleFromFiles; exports.formatJsonText = formatJsonText; exports.setJsonValue = setJsonValue; exports.PANEL_TYPES = PANEL_TYPES; exports.newPanel = newPanel; exports.newDocument = newDocument; exports.SaveConflictError = SaveConflictError; exports.HttpConfigFiles = HttpConfigFiles; exports.fetchJsonWithToken = fetchJsonWithToken; exports.readConfigFiles = readConfigFiles; exports.readingOrder = readingOrder; exports.repack = repack; exports.CANVAS_GAP = CANVAS_GAP; exports.CANVAS_ROW_HEADER = CANVAS_ROW_HEADER; exports.panelSize = panelSize; exports.layoutCanvas = layoutCanvas; exports.dropTarget = dropTarget; exports.movePanel = movePanel; exports.resizePanel = resizePanel; exports.setHiddenOnPhones = setHiddenOnPhones; exports.nextPanelId = nextPanelId; exports.insertPanel = insertPanel; exports.duplicatePanel = duplicatePanel; exports.removePanel = removePanel; exports.expandRow = expandRow; exports.collapseRow = collapseRow; exports.settleLayout = settleLayout; exports.placePanel = placePanel; exports.snapToGrid = snapToGrid; exports.panelEdits = panelEdits; exports.sampleEntries = sampleEntries; exports.SNIPPET_VERSION = SNIPPET_VERSION; exports.copyPanels = copyPanels; exports.parseSnippet = parseSnippet; exports.previewPaste = previewPaste; exports.pasteSnippet = pasteSnippet;
|
|
11678
|
+
exports.frameLength = frameLength; exports.timeField = timeField; exports.numberFields = numberFields; exports.fieldDisplayName = fieldDisplayName; exports.toSeries = toSeries; exports.toXYSeries = toXYSeries; exports.uniqueNames = uniqueNames; exports.toMillis = toMillis; exports.parseTime = parseTime; exports.parseRange = parseRange; exports.addTime = addTime; exports.startOf = startOf; exports.parseDuration = parseDuration; exports.calculateInterval = calculateInterval; exports.formatDuration = formatDuration; exports.TIME_PRESETS = TIME_PRESETS; exports.RELATIVE_RANGES = RELATIVE_RANGES; exports.parseLocalDateTime = parseLocalDateTime; exports.formatLocalDateTime = formatLocalDateTime; exports.timeExprError = timeExprError; exports.describeRange = describeRange; exports.zoomRange = zoomRange; exports.ALL = ALL; exports.initialVariableValues = initialVariableValues; exports.variableOptions = variableOptions; exports.variableInfo = variableInfo; exports.visibleVariables = visibleVariables; exports.isSqlDatasource = isSqlDatasource; exports.framesToOptions = framesToOptions; exports.refineOptions = refineOptions; exports.selectValue = selectValue; exports.variableReferences = variableReferences; exports.interpolate = interpolate; exports.queryParam = queryParam; exports.interpolateDeep = interpolateDeep; exports.resolveTimezone = resolveTimezone; exports.valueText = valueText; exports.GRID_COLUMNS = GRID_COLUMNS; exports.gridUnitsToPx = gridUnitsToPx; exports.gridOffsetPx = gridOffsetPx; exports.compactGrid = compactGrid; exports.isRow = isRow; exports.layoutDashboard = layoutDashboard; exports.repeatOptions = repeatOptions; exports.panelKey = panelKey; exports.panelSpan = panelSpan; exports.applyTransformations = applyTransformations; exports.DASHBOARD_DS = DASHBOARD_DS; exports.dashboardSourceIds = dashboardSourceIds; exports.panelHasQueries = panelHasQueries; exports.queryPanel = queryPanel; exports.normalizeRef = normalizeRef; exports.refreshedVariables = refreshedVariables; exports.variableDependents = variableDependents; exports.variableOrder = variableOrder; exports.resolveVariables = resolveVariables; exports.REDUCER_LABELS = REDUCER_LABELS; exports.isReducer = isReducer; exports.reduce = reduce; exports.INPUT_OPTION_KEYS = INPUT_OPTION_KEYS; exports.INPUT_TYPES = INPUT_TYPES; exports.isInputType = isInputType; exports.isInputPanel = isInputPanel; exports.INPUT_GROUP = INPUT_GROUP; exports.isFormPanelType = isFormPanelType; exports.isInputGroup = isInputGroup; exports.GROUP_FIELD_TYPES = GROUP_FIELD_TYPES; exports.groupFields = groupFields; exports.inputPanels = inputPanels; exports.inputGroups = inputGroups; exports.plainInputPanels = plainInputPanels; exports.parseClockDigits = parseClockDigits; exports.formatClock = formatClock; exports.toEntries = toEntries; exports.newSaveId = newSaveId; exports.isEmptyItem = isEmptyItem; exports.groupToEntries = groupToEntries; exports.entriesToItems = entriesToItems; exports.groupProblems = groupProblems; exports.sameSave = sameSave; exports.inputProblem = inputProblem; exports.entryToInputValue = entryToInputValue; exports.textSuggestions = textSuggestions; exports.entriesSavedWith = entriesSavedWith; exports.formatValue = formatValue; exports.thresholdStep = thresholdStep; exports.NAMED_COLORS = NAMED_COLORS; exports.resolveColor = resolveColor; exports.SERIES_PALETTE = SERIES_PALETTE; exports.seriesColor = seriesColor; exports.mappedResult = mappedResult; exports.formatDisplay = formatDisplay; exports.valueColor = valueColor; exports.resolveFieldConfig = resolveFieldConfig; exports.fieldMatches = fieldMatches; exports.GrafanaError = GrafanaError; exports.GrafanaClient = GrafanaClient; exports.GrafanaDataSource = GrafanaDataSource; exports.fromWire = fromWire; exports.LOCAL_DATASOURCE_TYPE = LOCAL_DATASOURCE_TYPE; exports.isLocalDatasource = isLocalDatasource; exports.LocalDataSource = LocalDataSource; exports.buildFrames = buildFrames; exports.MemoryEntryStore = MemoryEntryStore; exports.DEFAULT_GAZETTEER = DEFAULT_GAZETTEER; exports.parseGazetteer = parseGazetteer; exports.loadGazetteer = loadGazetteer; exports.resolveLinks = resolveLinks; exports.parseDashboardLink = parseDashboardLink; exports.applyDashboardLink = applyDashboardLink; exports.appSchema = appSchema; exports.dashboardSchema = dashboardSchema; exports.pointerToPath = pointerToPath; exports.manifestSchemaIssues = manifestSchemaIssues; exports.dashboardSchemaIssues = dashboardSchemaIssues; exports.cleanDashboard = cleanDashboard; exports.MAPPING_TYPES = MAPPING_TYPES; exports.SPECIAL_MATCHES = SPECIAL_MATCHES; exports.mappingRows = mappingRows; exports.rowsToMappings = rowsToMappings; exports.mappingRow = mappingRow; exports.mappingProblem = mappingProblem; exports.OPTION_CATEGORIES = OPTION_CATEGORIES; exports.UNIT_CHOICES = UNIT_CHOICES; exports.panelOptions = panelOptions; exports.getPath = getPath; exports.optionValue = optionValue; exports.setOption = setOption; exports.setOptionValue = setOptionValue; exports.cleanPanelOptions = cleanPanelOptions; exports.OVERRIDE_MATCHERS = OVERRIDE_MATCHERS; exports.overrideProperties = overrideProperties; exports.panelOverrides = panelOverrides; exports.setOverrides = setOverrides; exports.MANIFEST_VERSION = MANIFEST_VERSION; exports.validateManifest = validateManifest; exports.prepareDashboard = prepareDashboard; exports.validateDashboard = validateDashboard2; exports.validateBundle = validateBundle; exports.resolveUrl = resolveUrl; exports.httpFetchJson = httpFetchJson; exports.defaultFetchJson = defaultFetchJson; exports.BUNDLE_TYPE = BUNDLE_TYPE; exports.BUNDLE_ACCEPT = BUNDLE_ACCEPT; exports.isBundleResponse = isBundleResponse; exports.bundleRoot = bundleRoot; exports.assembleFromResponse = assembleFromResponse; exports.assembleBundle = assembleBundle; exports.fetchBundle = fetchBundle; exports.revalidateBundle = revalidateBundle; exports.ConfigLoader = ConfigLoader; exports.tabIdFor = tabIdFor; exports.screenOfType = screenOfType; exports.screenDocuments = screenDocuments; exports.documentUses = documentUses; exports.stringifyCompact = stringifyCompact; exports.applyJsonEdits = applyJsonEdits; exports.diffJson = diffJson; exports.documentIdFor = documentIdFor; exports.removeDocumentFromManifest = removeDocumentFromManifest; exports.renameDocumentInManifest = renameDocumentInManifest; exports.metricChanges = metricChanges; exports.REFRESH_CHOICES = REFRESH_CHOICES; exports.EDITABLE_VARIABLE_TYPES = EDITABLE_VARIABLE_TYPES; exports.isEditableVariableType = isEditableVariableType; exports.variableNameError = variableNameError; exports.newVariable = newVariable; exports.variableWithType = variableWithType; exports.variableWithQuery = variableWithQuery; exports.variableWithCurrent = variableWithCurrent; exports.variableWithFlags = variableWithFlags; exports.variableUses = variableUses; exports.renameVariableInPanels = renameVariableInPanels; exports.lineColumn = lineColumn; exports.parseJsonText = parseJsonText; exports.splitPath = splitPath; exports.locate = locate; exports.checkFiles = checkFiles; exports.bundleFromFiles = bundleFromFiles; exports.formatJsonText = formatJsonText; exports.setJsonValue = setJsonValue; exports.PANEL_TYPES = PANEL_TYPES; exports.newPanel = newPanel; exports.newDocument = newDocument; exports.SaveConflictError = SaveConflictError; exports.HttpConfigFiles = HttpConfigFiles; exports.fetchJsonWithToken = fetchJsonWithToken; exports.readConfigFiles = readConfigFiles; exports.readingOrder = readingOrder; exports.repack = repack; exports.CANVAS_GAP = CANVAS_GAP; exports.CANVAS_ROW_HEADER = CANVAS_ROW_HEADER; exports.panelSize = panelSize; exports.layoutCanvas = layoutCanvas; exports.dropTarget = dropTarget; exports.movePanel = movePanel; exports.resizePanel = resizePanel; exports.setHiddenOnPhones = setHiddenOnPhones; exports.nextPanelId = nextPanelId; exports.insertPanel = insertPanel; exports.duplicatePanel = duplicatePanel; exports.removePanel = removePanel; exports.expandRow = expandRow; exports.collapseRow = collapseRow; exports.settleLayout = settleLayout; exports.placePanel = placePanel; exports.snapToGrid = snapToGrid; exports.panelEdits = panelEdits; exports.sampleEntries = sampleEntries; exports.SNIPPET_VERSION = SNIPPET_VERSION; exports.panelMetrics = panelMetrics; exports.renameMetrics = renameMetrics; exports.copyPanels = copyPanels; exports.parseSnippet = parseSnippet; exports.previewPaste = previewPaste; exports.pasteSnippet = pasteSnippet; exports.TEMPLATE_VERSION = TEMPLATE_VERSION; exports.makeTemplate = makeTemplate; exports.parseTemplate = parseTemplate; exports.templateNeeds = templateNeeds; exports.applyTemplate = applyTemplate;
|