@modelform/react-native 0.7.0 → 0.9.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 +7 -1
- package/dist/{chunk-YUXA7I4J.js → chunk-FBZDJWT2.js} +431 -315
- package/dist/{chunk-BW6HKFAB.mjs → chunk-KOCUG6GH.mjs} +430 -314
- package/dist/core/index.js +6 -2
- package/dist/core/index.mjs +5 -1
- package/dist/core/inputs.d.ts +6 -1
- package/dist/core/local.d.ts +20 -4
- package/dist/core/manifest.d.ts +4 -1
- package/dist/core/schema.d.ts +8 -1
- package/dist/index.js +159 -155
- package/dist/index.mjs +5 -1
- package/package.json +1 -1
- package/schema/dashboard.schema.json +12 -1
|
@@ -1001,6 +1001,10 @@ var panelsOf = (dashboard) => dashboard.panels.flatMap((p) => p.type === "row" ?
|
|
|
1001
1001
|
function inputPanels(dashboard) {
|
|
1002
1002
|
return panelsOf(dashboard).flatMap((p) => isInputGroup(p) ? groupFields(p) : isInputPanel(p) ? [p] : []);
|
|
1003
1003
|
}
|
|
1004
|
+
function documentKind(dashboard) {
|
|
1005
|
+
if (dashboard.kind === "form" || dashboard.kind === "dashboard") return dashboard.kind;
|
|
1006
|
+
return Array.isArray(dashboard.panels) && inputPanels(dashboard).length ? "form" : "dashboard";
|
|
1007
|
+
}
|
|
1004
1008
|
function inputGroups(dashboard) {
|
|
1005
1009
|
return panelsOf(dashboard).filter(isInputGroup);
|
|
1006
1010
|
}
|
|
@@ -1579,7 +1583,7 @@ var LocalDataSource = class {
|
|
|
1579
1583
|
async query(request) {
|
|
1580
1584
|
const targets = request.targets.filter((t) => typeof t.metric === "string" && t.metric);
|
|
1581
1585
|
const entries = await this.store.list({
|
|
1582
|
-
metrics: [...new Set(targets.
|
|
1586
|
+
metrics: [...new Set(targets.flatMap((t) => [t.metric, groupField(t)]).filter((m) => !!m))],
|
|
1583
1587
|
from: request.range.from,
|
|
1584
1588
|
to: request.range.to
|
|
1585
1589
|
});
|
|
@@ -1588,20 +1592,34 @@ var LocalDataSource = class {
|
|
|
1588
1592
|
return targets.flatMap((t) => {
|
|
1589
1593
|
const own = entries.filter((e) => e.metric === t.metric);
|
|
1590
1594
|
const prior = carried.includes(t.metric) ? before.filter((e) => e.metric === t.metric && e.value != null).at(-1) : void 0;
|
|
1591
|
-
|
|
1595
|
+
const field2 = groupField(t);
|
|
1596
|
+
const siblings = field2 ? entries.filter((e) => e.metric === field2) : void 0;
|
|
1597
|
+
return buildFrames(t, prior ? [prior, ...own] : own, request, this.options.label, siblings);
|
|
1592
1598
|
});
|
|
1593
1599
|
}
|
|
1594
1600
|
};
|
|
1595
|
-
function
|
|
1601
|
+
function groupField(target) {
|
|
1602
|
+
const g = target.groupBy;
|
|
1603
|
+
return typeof g === "object" && g && typeof g.field === "string" && g.field ? g.field : void 0;
|
|
1604
|
+
}
|
|
1605
|
+
var saveOf = (e) => e.save ?? `@${e.ts}`;
|
|
1606
|
+
var placeOf = (e) => `${saveOf(e)}#${e.item ?? ""}`;
|
|
1607
|
+
function buildFrames(target, entries, request, label, siblings = []) {
|
|
1596
1608
|
const sorted = [...entries].sort((a, b) => a.ts - b.ts);
|
|
1609
|
+
const field2 = groupField(target);
|
|
1610
|
+
const byPlace = /* @__PURE__ */ new Map();
|
|
1611
|
+
if (field2) for (const s of siblings) byPlace.set(placeOf(s), s.text ?? String(s.value));
|
|
1612
|
+
const split = target.groupBy === "text" || !!field2;
|
|
1597
1613
|
const groups = /* @__PURE__ */ new Map();
|
|
1598
1614
|
for (const e of sorted) {
|
|
1599
|
-
const key = target.groupBy === "text" ? e.text ?? String(e.value) : void 0;
|
|
1615
|
+
const key = target.groupBy === "text" ? e.text ?? String(e.value) : field2 ? byPlace.get(placeOf(e)) : void 0;
|
|
1616
|
+
if (field2 && key === void 0) continue;
|
|
1600
1617
|
groups.set(key, [...groups.get(key) ?? [], e]);
|
|
1601
1618
|
}
|
|
1602
|
-
if (!groups.size &&
|
|
1619
|
+
if (!groups.size && !split) groups.set(void 0, []);
|
|
1603
1620
|
const aggregate = target.aggregate ?? (target.groupBy === "text" ? "count" : "none");
|
|
1604
1621
|
const name = target.alias ?? target.metric;
|
|
1622
|
+
const labelKey = field2 ?? target.metric;
|
|
1605
1623
|
return [...groups].map(([group, rows]) => {
|
|
1606
1624
|
let times;
|
|
1607
1625
|
let values;
|
|
@@ -1618,12 +1636,14 @@ function buildFrames(target, entries, request, label) {
|
|
|
1618
1636
|
values.push(values[values.length - 1]);
|
|
1619
1637
|
}
|
|
1620
1638
|
}
|
|
1639
|
+
} else if (target.bucket === "save") {
|
|
1640
|
+
({ times, values } = perSave(rows, aggregate));
|
|
1621
1641
|
} else {
|
|
1622
1642
|
const bucket = !target.bucket || target.bucket === "auto" ? request.intervalMs : target.bucket;
|
|
1623
1643
|
const fill = target.fillZero ?? (aggregate === "sum" || aggregate === "count");
|
|
1624
1644
|
({ times, values } = bucketize(rows, aggregate, bucket, request.range, fill));
|
|
1625
1645
|
}
|
|
1626
|
-
const display = group == null ? name : label?.(
|
|
1646
|
+
const display = group == null ? name : label?.(labelKey, group) ?? group;
|
|
1627
1647
|
return {
|
|
1628
1648
|
name,
|
|
1629
1649
|
refId: target.refId,
|
|
@@ -1633,13 +1653,40 @@ function buildFrames(target, entries, request, label) {
|
|
|
1633
1653
|
name: display,
|
|
1634
1654
|
type: "number",
|
|
1635
1655
|
values,
|
|
1636
|
-
labels: group != null ? { [
|
|
1656
|
+
labels: group != null ? { [labelKey]: group } : void 0,
|
|
1637
1657
|
config: { displayName: display }
|
|
1638
1658
|
}
|
|
1639
1659
|
]
|
|
1640
1660
|
};
|
|
1641
1661
|
});
|
|
1642
1662
|
}
|
|
1663
|
+
function perSave(rows, aggregate) {
|
|
1664
|
+
const saves = /* @__PURE__ */ new Map();
|
|
1665
|
+
for (const e of rows) {
|
|
1666
|
+
const v = aggregate === "count" ? 1 : e.value;
|
|
1667
|
+
if (v == null) continue;
|
|
1668
|
+
const s = saves.get(saveOf(e)) ?? { ts: e.ts, values: [] };
|
|
1669
|
+
s.values.push(v);
|
|
1670
|
+
saves.set(saveOf(e), s);
|
|
1671
|
+
}
|
|
1672
|
+
const points = [...saves.values()].sort((a, b) => a.ts - b.ts);
|
|
1673
|
+
return { times: points.map((p) => p.ts), values: points.map((p) => reduce2(p.values, aggregate)) };
|
|
1674
|
+
}
|
|
1675
|
+
function reduce2(vs, aggregate) {
|
|
1676
|
+
switch (aggregate) {
|
|
1677
|
+
case "sum":
|
|
1678
|
+
case "count":
|
|
1679
|
+
return vs.reduce((a, b) => a + b, 0);
|
|
1680
|
+
case "avg":
|
|
1681
|
+
return vs.reduce((a, b) => a + b, 0) / vs.length;
|
|
1682
|
+
case "min":
|
|
1683
|
+
return Math.min(...vs);
|
|
1684
|
+
case "max":
|
|
1685
|
+
return Math.max(...vs);
|
|
1686
|
+
case "last":
|
|
1687
|
+
return vs[vs.length - 1];
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1643
1690
|
function bucketize(rows, aggregate, bucket, range, fillZero) {
|
|
1644
1691
|
const step = bucketStepper(bucket);
|
|
1645
1692
|
const sums = /* @__PURE__ */ new Map();
|
|
@@ -1652,20 +1699,7 @@ function bucketize(rows, aggregate, bucket, range, fillZero) {
|
|
|
1652
1699
|
const keys = fillZero ? step.range(range.from, range.to) : [...sums.keys()].sort((a, b) => a - b);
|
|
1653
1700
|
const values = keys.map((k) => {
|
|
1654
1701
|
const vs = sums.get(k);
|
|
1655
|
-
|
|
1656
|
-
switch (aggregate) {
|
|
1657
|
-
case "sum":
|
|
1658
|
-
case "count":
|
|
1659
|
-
return vs.reduce((a, b) => a + b, 0);
|
|
1660
|
-
case "avg":
|
|
1661
|
-
return vs.reduce((a, b) => a + b, 0) / vs.length;
|
|
1662
|
-
case "min":
|
|
1663
|
-
return Math.min(...vs);
|
|
1664
|
-
case "max":
|
|
1665
|
-
return Math.max(...vs);
|
|
1666
|
-
case "last":
|
|
1667
|
-
return vs[vs.length - 1];
|
|
1668
|
-
}
|
|
1702
|
+
return vs?.length ? reduce2(vs, aggregate) : fillZero ? 0 : null;
|
|
1669
1703
|
});
|
|
1670
1704
|
return { times: keys, values };
|
|
1671
1705
|
}
|
|
@@ -2132,6 +2166,10 @@ var dashboard_schema_default = {
|
|
|
2132
2166
|
Dashboard: {
|
|
2133
2167
|
type: "object",
|
|
2134
2168
|
properties: {
|
|
2169
|
+
kind: {
|
|
2170
|
+
$ref: "#/definitions/DocumentKind",
|
|
2171
|
+
description: "Whether this document is a form (for recording entries) or a dashboard (for showing them). Without it, a document with input-* panels counts as a form. See documentKind()."
|
|
2172
|
+
},
|
|
2135
2173
|
uid: {
|
|
2136
2174
|
type: "string"
|
|
2137
2175
|
},
|
|
@@ -2223,8 +2261,15 @@ var dashboard_schema_default = {
|
|
|
2223
2261
|
required: [
|
|
2224
2262
|
"title",
|
|
2225
2263
|
"panels"
|
|
2264
|
+
]
|
|
2265
|
+
},
|
|
2266
|
+
DocumentKind: {
|
|
2267
|
+
type: "string",
|
|
2268
|
+
enum: [
|
|
2269
|
+
"form",
|
|
2270
|
+
"dashboard"
|
|
2226
2271
|
],
|
|
2227
|
-
description: "The subset of the Grafana dashboard JSON model that modelform understands. Unknown keys are tolerated and ignored, so dashboards exported from Grafana load as-is. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/view-dashboard-json-model/\n\nmodelform adds
|
|
2272
|
+
description: "The subset of the Grafana dashboard JSON model that modelform understands. Unknown keys are tolerated and ignored, so dashboards exported from Grafana load as-is. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/view-dashboard-json-model/\n\nmodelform adds three extensions, all of which Grafana ignores: - `kind` to say whether the document is a form or a dashboard - `panel.mobile` to tune phone layout per panel - `input-*` panel types for data entry forms (see inputs.ts)"
|
|
2228
2273
|
},
|
|
2229
2274
|
Panel: {
|
|
2230
2275
|
type: "object",
|
|
@@ -3727,10 +3772,11 @@ function validate12(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3727
3772
|
validate12.errors = vErrors;
|
|
3728
3773
|
return errors === 0;
|
|
3729
3774
|
}
|
|
3730
|
-
var schema18 = { "type": "
|
|
3775
|
+
var schema18 = { "type": "string", "enum": ["form", "dashboard"], "description": "The subset of the Grafana dashboard JSON model that modelform understands. Unknown keys are tolerated and ignored, so dashboards exported from Grafana load as-is. See https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/view-dashboard-json-model/\n\nmodelform adds three extensions, all of which Grafana ignores: - `kind` to say whether the document is a form or a dashboard - `panel.mobile` to tune phone layout per panel - `input-*` panel types for data entry forms (see inputs.ts)" };
|
|
3776
|
+
var schema19 = { "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
3777
|
var pattern1 = new RegExp("^input-(?!group$)", "u");
|
|
3732
|
-
var
|
|
3733
|
-
var
|
|
3778
|
+
var schema20 = { "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"] };
|
|
3779
|
+
var schema21 = { "type": "object", "properties": { "label": { "type": "string" }, "value": { "type": ["number", "string"] } }, "required": ["label", "value"] };
|
|
3734
3780
|
function validate19(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3735
3781
|
let vErrors = null;
|
|
3736
3782
|
let errors = 0;
|
|
@@ -3933,7 +3979,7 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3933
3979
|
errors++;
|
|
3934
3980
|
}
|
|
3935
3981
|
if (!(data9 === "changed" || data9 === "always")) {
|
|
3936
|
-
const err16 = { instancePath: instancePath + "/record", schemaPath: "#/properties/record/enum", keyword: "enum", params: { allowedValues:
|
|
3982
|
+
const err16 = { instancePath: instancePath + "/record", schemaPath: "#/properties/record/enum", keyword: "enum", params: { allowedValues: schema20.properties.record.enum }, message: "must be equal to one of the allowed values" };
|
|
3937
3983
|
if (vErrors === null) {
|
|
3938
3984
|
vErrors = [err16];
|
|
3939
3985
|
} else {
|
|
@@ -3992,7 +4038,7 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3992
4038
|
if (data12.value !== void 0) {
|
|
3993
4039
|
let data14 = data12.value;
|
|
3994
4040
|
if (!(typeof data14 == "number") && typeof data14 !== "string") {
|
|
3995
|
-
const err21 = { instancePath: instancePath + "/choices/" + i1 + "/value", schemaPath: "#/definitions/InputChoice/properties/value/type", keyword: "type", params: { type:
|
|
4041
|
+
const err21 = { instancePath: instancePath + "/choices/" + i1 + "/value", schemaPath: "#/definitions/InputChoice/properties/value/type", keyword: "type", params: { type: schema21.properties.value.type }, message: "must be number,string" };
|
|
3996
4042
|
if (vErrors === null) {
|
|
3997
4043
|
vErrors = [err21];
|
|
3998
4044
|
} else {
|
|
@@ -4088,7 +4134,7 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4088
4134
|
validate19.errors = vErrors;
|
|
4089
4135
|
return errors === 0;
|
|
4090
4136
|
}
|
|
4091
|
-
var
|
|
4137
|
+
var schema24 = { "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
4138
|
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
4093
4139
|
let vErrors = null;
|
|
4094
4140
|
let errors = 0;
|
|
@@ -4123,7 +4169,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4123
4169
|
errors++;
|
|
4124
4170
|
}
|
|
4125
4171
|
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:
|
|
4172
|
+
const err3 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/InputType/enum", keyword: "enum", params: { allowedValues: schema24.enum }, message: "must be equal to one of the allowed values" };
|
|
4127
4173
|
if (vErrors === null) {
|
|
4128
4174
|
vErrors = [err3];
|
|
4129
4175
|
} else {
|
|
@@ -4496,9 +4542,9 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4496
4542
|
validate26.errors = vErrors;
|
|
4497
4543
|
return errors === 0;
|
|
4498
4544
|
}
|
|
4499
|
-
var
|
|
4500
|
-
var
|
|
4501
|
-
var
|
|
4545
|
+
var schema29 = { "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": {} };
|
|
4546
|
+
var schema30 = { "type": "object", "properties": { "value": { "type": ["number", "null"] }, "color": { "type": "string" } }, "required": ["value", "color"] };
|
|
4547
|
+
var schema31 = { "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
4548
|
function validate29(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
4503
4549
|
let vErrors = null;
|
|
4504
4550
|
let errors = 0;
|
|
@@ -4672,7 +4718,7 @@ function validate29(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4672
4718
|
if (data7.from !== void 0) {
|
|
4673
4719
|
let data8 = data7.from;
|
|
4674
4720
|
if (!(typeof data8 == "number") && data8 !== null) {
|
|
4675
|
-
const err15 = { instancePath: instancePath + "/options/from", schemaPath: "#/anyOf/1/properties/options/properties/from/type", keyword: "type", params: { type:
|
|
4721
|
+
const err15 = { instancePath: instancePath + "/options/from", schemaPath: "#/anyOf/1/properties/options/properties/from/type", keyword: "type", params: { type: schema31.anyOf[1].properties.options.properties.from.type }, message: "must be number,null" };
|
|
4676
4722
|
if (vErrors === null) {
|
|
4677
4723
|
vErrors = [err15];
|
|
4678
4724
|
} else {
|
|
@@ -4684,7 +4730,7 @@ function validate29(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4684
4730
|
if (data7.to !== void 0) {
|
|
4685
4731
|
let data9 = data7.to;
|
|
4686
4732
|
if (!(typeof data9 == "number") && data9 !== null) {
|
|
4687
|
-
const err16 = { instancePath: instancePath + "/options/to", schemaPath: "#/anyOf/1/properties/options/properties/to/type", keyword: "type", params: { type:
|
|
4733
|
+
const err16 = { instancePath: instancePath + "/options/to", schemaPath: "#/anyOf/1/properties/options/properties/to/type", keyword: "type", params: { type: schema31.anyOf[1].properties.options.properties.to.type }, message: "must be number,null" };
|
|
4688
4734
|
if (vErrors === null) {
|
|
4689
4735
|
vErrors = [err16];
|
|
4690
4736
|
} else {
|
|
@@ -4976,7 +5022,7 @@ function validate29(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4976
5022
|
errors++;
|
|
4977
5023
|
}
|
|
4978
5024
|
if (!(data23 === "null" || data23 === "nan" || data23 === "null+nan" || data23 === "true" || data23 === "false" || data23 === "empty")) {
|
|
4979
|
-
const err43 = { instancePath: instancePath + "/options/match", schemaPath: "#/anyOf/3/properties/options/properties/match/enum", keyword: "enum", params: { allowedValues:
|
|
5025
|
+
const err43 = { instancePath: instancePath + "/options/match", schemaPath: "#/anyOf/3/properties/options/properties/match/enum", keyword: "enum", params: { allowedValues: schema31.anyOf[3].properties.options.properties.match.enum }, message: "must be equal to one of the allowed values" };
|
|
4980
5026
|
if (vErrors === null) {
|
|
4981
5027
|
vErrors = [err43];
|
|
4982
5028
|
} else {
|
|
@@ -5229,7 +5275,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5229
5275
|
errors++;
|
|
5230
5276
|
}
|
|
5231
5277
|
if (!(data9 === "absolute" || data9 === "percentage")) {
|
|
5232
|
-
const err10 = { instancePath: instancePath + "/thresholds/mode", schemaPath: "#/properties/thresholds/properties/mode/enum", keyword: "enum", params: { allowedValues:
|
|
5278
|
+
const err10 = { instancePath: instancePath + "/thresholds/mode", schemaPath: "#/properties/thresholds/properties/mode/enum", keyword: "enum", params: { allowedValues: schema29.properties.thresholds.properties.mode.enum }, message: "must be equal to one of the allowed values" };
|
|
5233
5279
|
if (vErrors === null) {
|
|
5234
5280
|
vErrors = [err10];
|
|
5235
5281
|
} else {
|
|
@@ -5266,7 +5312,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5266
5312
|
if (data11.value !== void 0) {
|
|
5267
5313
|
let data12 = data11.value;
|
|
5268
5314
|
if (!(typeof data12 == "number") && data12 !== null) {
|
|
5269
|
-
const err13 = { instancePath: instancePath + "/thresholds/steps/" + i0 + "/value", schemaPath: "#/definitions/ThresholdStep/properties/value/type", keyword: "type", params: { type:
|
|
5315
|
+
const err13 = { instancePath: instancePath + "/thresholds/steps/" + i0 + "/value", schemaPath: "#/definitions/ThresholdStep/properties/value/type", keyword: "type", params: { type: schema30.properties.value.type }, message: "must be number,null" };
|
|
5270
5316
|
if (vErrors === null) {
|
|
5271
5317
|
vErrors = [err13];
|
|
5272
5318
|
} else {
|
|
@@ -5429,7 +5475,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5429
5475
|
errors++;
|
|
5430
5476
|
}
|
|
5431
5477
|
if (!(data22 === "line" || data22 === "bars" || data22 === "points")) {
|
|
5432
|
-
const err27 = { instancePath: instancePath + "/custom/drawStyle", schemaPath: "#/properties/custom/properties/drawStyle/enum", keyword: "enum", params: { allowedValues:
|
|
5478
|
+
const err27 = { instancePath: instancePath + "/custom/drawStyle", schemaPath: "#/properties/custom/properties/drawStyle/enum", keyword: "enum", params: { allowedValues: schema29.properties.custom.properties.drawStyle.enum }, message: "must be equal to one of the allowed values" };
|
|
5433
5479
|
if (vErrors === null) {
|
|
5434
5480
|
vErrors = [err27];
|
|
5435
5481
|
} else {
|
|
@@ -5472,7 +5518,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5472
5518
|
errors++;
|
|
5473
5519
|
}
|
|
5474
5520
|
if (!(data25 === "auto" || data25 === "always" || data25 === "never")) {
|
|
5475
|
-
const err31 = { instancePath: instancePath + "/custom/showPoints", schemaPath: "#/properties/custom/properties/showPoints/enum", keyword: "enum", params: { allowedValues:
|
|
5521
|
+
const err31 = { instancePath: instancePath + "/custom/showPoints", schemaPath: "#/properties/custom/properties/showPoints/enum", keyword: "enum", params: { allowedValues: schema29.properties.custom.properties.showPoints.enum }, message: "must be equal to one of the allowed values" };
|
|
5476
5522
|
if (vErrors === null) {
|
|
5477
5523
|
vErrors = [err31];
|
|
5478
5524
|
} else {
|
|
@@ -6186,7 +6232,7 @@ function validate18(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6186
6232
|
errors++;
|
|
6187
6233
|
}
|
|
6188
6234
|
if (!(data37 === "h" || data37 === "v")) {
|
|
6189
|
-
const err53 = { instancePath: instancePath + "/repeatDirection", schemaPath: "#/properties/repeatDirection/enum", keyword: "enum", params: { allowedValues:
|
|
6235
|
+
const err53 = { instancePath: instancePath + "/repeatDirection", schemaPath: "#/properties/repeatDirection/enum", keyword: "enum", params: { allowedValues: schema19.properties.repeatDirection.enum }, message: "must be equal to one of the allowed values" };
|
|
6190
6236
|
if (vErrors === null) {
|
|
6191
6237
|
vErrors = [err53];
|
|
6192
6238
|
} else {
|
|
@@ -6408,7 +6454,7 @@ function validate18(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6408
6454
|
validate18.errors = vErrors;
|
|
6409
6455
|
return errors === 0;
|
|
6410
6456
|
}
|
|
6411
|
-
var
|
|
6457
|
+
var schema40 = { "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
6458
|
function validate33(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
6413
6459
|
let vErrors = null;
|
|
6414
6460
|
let errors = 0;
|
|
@@ -6828,7 +6874,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6828
6874
|
if (data.allValue !== void 0) {
|
|
6829
6875
|
let data19 = data.allValue;
|
|
6830
6876
|
if (typeof data19 !== "string" && data19 !== null) {
|
|
6831
|
-
const err31 = { instancePath: instancePath + "/allValue", schemaPath: "#/properties/allValue/type", keyword: "type", params: { type:
|
|
6877
|
+
const err31 = { instancePath: instancePath + "/allValue", schemaPath: "#/properties/allValue/type", keyword: "type", params: { type: schema40.properties.allValue.type }, message: "must be string,null" };
|
|
6832
6878
|
if (vErrors === null) {
|
|
6833
6879
|
vErrors = [err31];
|
|
6834
6880
|
} else {
|
|
@@ -6990,9 +7036,10 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6990
7036
|
}
|
|
6991
7037
|
errors++;
|
|
6992
7038
|
}
|
|
6993
|
-
if (data.
|
|
6994
|
-
|
|
6995
|
-
|
|
7039
|
+
if (data.kind !== void 0) {
|
|
7040
|
+
let data0 = data.kind;
|
|
7041
|
+
if (typeof data0 !== "string") {
|
|
7042
|
+
const err2 = { instancePath: instancePath + "/kind", schemaPath: "#/definitions/DocumentKind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
6996
7043
|
if (vErrors === null) {
|
|
6997
7044
|
vErrors = [err2];
|
|
6998
7045
|
} else {
|
|
@@ -7000,232 +7047,252 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7000
7047
|
}
|
|
7001
7048
|
errors++;
|
|
7002
7049
|
}
|
|
7050
|
+
if (!(data0 === "form" || data0 === "dashboard")) {
|
|
7051
|
+
const err3 = { instancePath: instancePath + "/kind", schemaPath: "#/definitions/DocumentKind/enum", keyword: "enum", params: { allowedValues: schema18.enum }, message: "must be equal to one of the allowed values" };
|
|
7052
|
+
if (vErrors === null) {
|
|
7053
|
+
vErrors = [err3];
|
|
7054
|
+
} else {
|
|
7055
|
+
vErrors.push(err3);
|
|
7056
|
+
}
|
|
7057
|
+
errors++;
|
|
7058
|
+
}
|
|
7059
|
+
}
|
|
7060
|
+
if (data.uid !== void 0) {
|
|
7061
|
+
if (typeof data.uid !== "string") {
|
|
7062
|
+
const err4 = { instancePath: instancePath + "/uid", schemaPath: "#/properties/uid/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7063
|
+
if (vErrors === null) {
|
|
7064
|
+
vErrors = [err4];
|
|
7065
|
+
} else {
|
|
7066
|
+
vErrors.push(err4);
|
|
7067
|
+
}
|
|
7068
|
+
errors++;
|
|
7069
|
+
}
|
|
7003
7070
|
}
|
|
7004
7071
|
if (data.title !== void 0) {
|
|
7005
7072
|
if (typeof data.title !== "string") {
|
|
7006
|
-
const
|
|
7073
|
+
const err5 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7007
7074
|
if (vErrors === null) {
|
|
7008
|
-
vErrors = [
|
|
7075
|
+
vErrors = [err5];
|
|
7009
7076
|
} else {
|
|
7010
|
-
vErrors.push(
|
|
7077
|
+
vErrors.push(err5);
|
|
7011
7078
|
}
|
|
7012
7079
|
errors++;
|
|
7013
7080
|
}
|
|
7014
7081
|
}
|
|
7015
7082
|
if (data.description !== void 0) {
|
|
7016
7083
|
if (typeof data.description !== "string") {
|
|
7017
|
-
const
|
|
7084
|
+
const err6 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7018
7085
|
if (vErrors === null) {
|
|
7019
|
-
vErrors = [
|
|
7086
|
+
vErrors = [err6];
|
|
7020
7087
|
} else {
|
|
7021
|
-
vErrors.push(
|
|
7088
|
+
vErrors.push(err6);
|
|
7022
7089
|
}
|
|
7023
7090
|
errors++;
|
|
7024
7091
|
}
|
|
7025
7092
|
}
|
|
7026
7093
|
if (data.tags !== void 0) {
|
|
7027
|
-
let
|
|
7028
|
-
if (Array.isArray(
|
|
7029
|
-
const len0 =
|
|
7094
|
+
let data4 = data.tags;
|
|
7095
|
+
if (Array.isArray(data4)) {
|
|
7096
|
+
const len0 = data4.length;
|
|
7030
7097
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
7031
|
-
if (typeof
|
|
7032
|
-
const
|
|
7098
|
+
if (typeof data4[i0] !== "string") {
|
|
7099
|
+
const err7 = { instancePath: instancePath + "/tags/" + i0, schemaPath: "#/properties/tags/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7033
7100
|
if (vErrors === null) {
|
|
7034
|
-
vErrors = [
|
|
7101
|
+
vErrors = [err7];
|
|
7035
7102
|
} else {
|
|
7036
|
-
vErrors.push(
|
|
7103
|
+
vErrors.push(err7);
|
|
7037
7104
|
}
|
|
7038
7105
|
errors++;
|
|
7039
7106
|
}
|
|
7040
7107
|
}
|
|
7041
7108
|
} else {
|
|
7042
|
-
const
|
|
7109
|
+
const err8 = { instancePath: instancePath + "/tags", schemaPath: "#/properties/tags/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7043
7110
|
if (vErrors === null) {
|
|
7044
|
-
vErrors = [
|
|
7111
|
+
vErrors = [err8];
|
|
7045
7112
|
} else {
|
|
7046
|
-
vErrors.push(
|
|
7113
|
+
vErrors.push(err8);
|
|
7047
7114
|
}
|
|
7048
7115
|
errors++;
|
|
7049
7116
|
}
|
|
7050
7117
|
}
|
|
7051
7118
|
if (data.panels !== void 0) {
|
|
7052
|
-
let
|
|
7053
|
-
if (Array.isArray(
|
|
7054
|
-
const len1 =
|
|
7119
|
+
let data6 = data.panels;
|
|
7120
|
+
if (Array.isArray(data6)) {
|
|
7121
|
+
const len1 = data6.length;
|
|
7055
7122
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
7056
|
-
if (!validate18(
|
|
7123
|
+
if (!validate18(data6[i1], { instancePath: instancePath + "/panels/" + i1, parentData: data6, parentDataProperty: i1, rootData })) {
|
|
7057
7124
|
vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);
|
|
7058
7125
|
errors = vErrors.length;
|
|
7059
7126
|
}
|
|
7060
7127
|
}
|
|
7061
7128
|
} else {
|
|
7062
|
-
const
|
|
7129
|
+
const err9 = { instancePath: instancePath + "/panels", schemaPath: "#/properties/panels/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7063
7130
|
if (vErrors === null) {
|
|
7064
|
-
vErrors = [
|
|
7131
|
+
vErrors = [err9];
|
|
7065
7132
|
} else {
|
|
7066
|
-
vErrors.push(
|
|
7133
|
+
vErrors.push(err9);
|
|
7067
7134
|
}
|
|
7068
7135
|
errors++;
|
|
7069
7136
|
}
|
|
7070
7137
|
}
|
|
7071
7138
|
if (data.templating !== void 0) {
|
|
7072
|
-
let
|
|
7073
|
-
if (
|
|
7074
|
-
if (
|
|
7075
|
-
const
|
|
7139
|
+
let data8 = data.templating;
|
|
7140
|
+
if (data8 && typeof data8 == "object" && !Array.isArray(data8)) {
|
|
7141
|
+
if (data8.list === void 0) {
|
|
7142
|
+
const err10 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/required", keyword: "required", params: { missingProperty: "list" }, message: "must have required property 'list'" };
|
|
7076
7143
|
if (vErrors === null) {
|
|
7077
|
-
vErrors = [
|
|
7144
|
+
vErrors = [err10];
|
|
7078
7145
|
} else {
|
|
7079
|
-
vErrors.push(
|
|
7146
|
+
vErrors.push(err10);
|
|
7080
7147
|
}
|
|
7081
7148
|
errors++;
|
|
7082
7149
|
}
|
|
7083
|
-
if (
|
|
7084
|
-
let
|
|
7085
|
-
if (Array.isArray(
|
|
7086
|
-
const len2 =
|
|
7150
|
+
if (data8.list !== void 0) {
|
|
7151
|
+
let data9 = data8.list;
|
|
7152
|
+
if (Array.isArray(data9)) {
|
|
7153
|
+
const len2 = data9.length;
|
|
7087
7154
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
7088
|
-
if (!validate33(
|
|
7155
|
+
if (!validate33(data9[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data9, parentDataProperty: i2, rootData })) {
|
|
7089
7156
|
vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
|
|
7090
7157
|
errors = vErrors.length;
|
|
7091
7158
|
}
|
|
7092
7159
|
}
|
|
7093
7160
|
} else {
|
|
7094
|
-
const
|
|
7161
|
+
const err11 = { instancePath: instancePath + "/templating/list", schemaPath: "#/properties/templating/properties/list/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7095
7162
|
if (vErrors === null) {
|
|
7096
|
-
vErrors = [
|
|
7163
|
+
vErrors = [err11];
|
|
7097
7164
|
} else {
|
|
7098
|
-
vErrors.push(
|
|
7165
|
+
vErrors.push(err11);
|
|
7099
7166
|
}
|
|
7100
7167
|
errors++;
|
|
7101
7168
|
}
|
|
7102
7169
|
}
|
|
7103
7170
|
} else {
|
|
7104
|
-
const
|
|
7171
|
+
const err12 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7105
7172
|
if (vErrors === null) {
|
|
7106
|
-
vErrors = [
|
|
7173
|
+
vErrors = [err12];
|
|
7107
7174
|
} else {
|
|
7108
|
-
vErrors.push(
|
|
7175
|
+
vErrors.push(err12);
|
|
7109
7176
|
}
|
|
7110
7177
|
errors++;
|
|
7111
7178
|
}
|
|
7112
7179
|
}
|
|
7113
7180
|
if (data.time !== void 0) {
|
|
7114
|
-
let
|
|
7115
|
-
if (
|
|
7116
|
-
if (
|
|
7117
|
-
const
|
|
7181
|
+
let data11 = data.time;
|
|
7182
|
+
if (data11 && typeof data11 == "object" && !Array.isArray(data11)) {
|
|
7183
|
+
if (data11.from === void 0) {
|
|
7184
|
+
const err13 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "from" }, message: "must have required property 'from'" };
|
|
7118
7185
|
if (vErrors === null) {
|
|
7119
|
-
vErrors = [
|
|
7186
|
+
vErrors = [err13];
|
|
7120
7187
|
} else {
|
|
7121
|
-
vErrors.push(
|
|
7188
|
+
vErrors.push(err13);
|
|
7122
7189
|
}
|
|
7123
7190
|
errors++;
|
|
7124
7191
|
}
|
|
7125
|
-
if (
|
|
7126
|
-
const
|
|
7192
|
+
if (data11.to === void 0) {
|
|
7193
|
+
const err14 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "to" }, message: "must have required property 'to'" };
|
|
7127
7194
|
if (vErrors === null) {
|
|
7128
|
-
vErrors = [
|
|
7195
|
+
vErrors = [err14];
|
|
7129
7196
|
} else {
|
|
7130
|
-
vErrors.push(
|
|
7197
|
+
vErrors.push(err14);
|
|
7131
7198
|
}
|
|
7132
7199
|
errors++;
|
|
7133
7200
|
}
|
|
7134
|
-
if (
|
|
7135
|
-
if (typeof
|
|
7136
|
-
const
|
|
7201
|
+
if (data11.from !== void 0) {
|
|
7202
|
+
if (typeof data11.from !== "string") {
|
|
7203
|
+
const err15 = { instancePath: instancePath + "/time/from", schemaPath: "#/properties/time/properties/from/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7137
7204
|
if (vErrors === null) {
|
|
7138
|
-
vErrors = [
|
|
7205
|
+
vErrors = [err15];
|
|
7139
7206
|
} else {
|
|
7140
|
-
vErrors.push(
|
|
7207
|
+
vErrors.push(err15);
|
|
7141
7208
|
}
|
|
7142
7209
|
errors++;
|
|
7143
7210
|
}
|
|
7144
7211
|
}
|
|
7145
|
-
if (
|
|
7146
|
-
if (typeof
|
|
7147
|
-
const
|
|
7212
|
+
if (data11.to !== void 0) {
|
|
7213
|
+
if (typeof data11.to !== "string") {
|
|
7214
|
+
const err16 = { instancePath: instancePath + "/time/to", schemaPath: "#/properties/time/properties/to/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7148
7215
|
if (vErrors === null) {
|
|
7149
|
-
vErrors = [
|
|
7216
|
+
vErrors = [err16];
|
|
7150
7217
|
} else {
|
|
7151
|
-
vErrors.push(
|
|
7218
|
+
vErrors.push(err16);
|
|
7152
7219
|
}
|
|
7153
7220
|
errors++;
|
|
7154
7221
|
}
|
|
7155
7222
|
}
|
|
7156
7223
|
} else {
|
|
7157
|
-
const
|
|
7224
|
+
const err17 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7158
7225
|
if (vErrors === null) {
|
|
7159
|
-
vErrors = [
|
|
7226
|
+
vErrors = [err17];
|
|
7160
7227
|
} else {
|
|
7161
|
-
vErrors.push(
|
|
7228
|
+
vErrors.push(err17);
|
|
7162
7229
|
}
|
|
7163
7230
|
errors++;
|
|
7164
7231
|
}
|
|
7165
7232
|
}
|
|
7166
7233
|
if (data.timezone !== void 0) {
|
|
7167
7234
|
if (typeof data.timezone !== "string") {
|
|
7168
|
-
const
|
|
7235
|
+
const err18 = { instancePath: instancePath + "/timezone", schemaPath: "#/properties/timezone/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7169
7236
|
if (vErrors === null) {
|
|
7170
|
-
vErrors = [
|
|
7237
|
+
vErrors = [err18];
|
|
7171
7238
|
} else {
|
|
7172
|
-
vErrors.push(
|
|
7239
|
+
vErrors.push(err18);
|
|
7173
7240
|
}
|
|
7174
7241
|
errors++;
|
|
7175
7242
|
}
|
|
7176
7243
|
}
|
|
7177
7244
|
if (data.refresh !== void 0) {
|
|
7178
|
-
let
|
|
7179
|
-
const
|
|
7180
|
-
let
|
|
7181
|
-
const
|
|
7182
|
-
if (typeof
|
|
7183
|
-
const
|
|
7245
|
+
let data15 = data.refresh;
|
|
7246
|
+
const _errs31 = errors;
|
|
7247
|
+
let valid10 = false;
|
|
7248
|
+
const _errs32 = errors;
|
|
7249
|
+
if (typeof data15 !== "string") {
|
|
7250
|
+
const err19 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7184
7251
|
if (vErrors === null) {
|
|
7185
|
-
vErrors = [
|
|
7252
|
+
vErrors = [err19];
|
|
7186
7253
|
} else {
|
|
7187
|
-
vErrors.push(
|
|
7254
|
+
vErrors.push(err19);
|
|
7188
7255
|
}
|
|
7189
7256
|
errors++;
|
|
7190
7257
|
}
|
|
7191
|
-
var _valid0 =
|
|
7192
|
-
|
|
7193
|
-
if (!
|
|
7194
|
-
const
|
|
7195
|
-
if (typeof
|
|
7196
|
-
const
|
|
7258
|
+
var _valid0 = _errs32 === errors;
|
|
7259
|
+
valid10 = valid10 || _valid0;
|
|
7260
|
+
if (!valid10) {
|
|
7261
|
+
const _errs34 = errors;
|
|
7262
|
+
if (typeof data15 !== "boolean") {
|
|
7263
|
+
const err20 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
|
|
7197
7264
|
if (vErrors === null) {
|
|
7198
|
-
vErrors = [
|
|
7265
|
+
vErrors = [err20];
|
|
7199
7266
|
} else {
|
|
7200
|
-
vErrors.push(
|
|
7267
|
+
vErrors.push(err20);
|
|
7201
7268
|
}
|
|
7202
7269
|
errors++;
|
|
7203
7270
|
}
|
|
7204
|
-
if (false !==
|
|
7205
|
-
const
|
|
7271
|
+
if (false !== data15) {
|
|
7272
|
+
const err21 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/const", keyword: "const", params: { allowedValue: false }, message: "must be equal to constant" };
|
|
7206
7273
|
if (vErrors === null) {
|
|
7207
|
-
vErrors = [
|
|
7274
|
+
vErrors = [err21];
|
|
7208
7275
|
} else {
|
|
7209
|
-
vErrors.push(
|
|
7276
|
+
vErrors.push(err21);
|
|
7210
7277
|
}
|
|
7211
7278
|
errors++;
|
|
7212
7279
|
}
|
|
7213
|
-
var _valid0 =
|
|
7214
|
-
|
|
7280
|
+
var _valid0 = _errs34 === errors;
|
|
7281
|
+
valid10 = valid10 || _valid0;
|
|
7215
7282
|
}
|
|
7216
|
-
if (!
|
|
7217
|
-
const
|
|
7283
|
+
if (!valid10) {
|
|
7284
|
+
const err22 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
7218
7285
|
if (vErrors === null) {
|
|
7219
|
-
vErrors = [
|
|
7286
|
+
vErrors = [err22];
|
|
7220
7287
|
} else {
|
|
7221
|
-
vErrors.push(
|
|
7288
|
+
vErrors.push(err22);
|
|
7222
7289
|
}
|
|
7223
7290
|
errors++;
|
|
7224
7291
|
} else {
|
|
7225
|
-
errors =
|
|
7292
|
+
errors = _errs31;
|
|
7226
7293
|
if (vErrors !== null) {
|
|
7227
|
-
if (
|
|
7228
|
-
vErrors.length =
|
|
7294
|
+
if (_errs31) {
|
|
7295
|
+
vErrors.length = _errs31;
|
|
7229
7296
|
} else {
|
|
7230
7297
|
vErrors = null;
|
|
7231
7298
|
}
|
|
@@ -7233,89 +7300,89 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7233
7300
|
}
|
|
7234
7301
|
}
|
|
7235
7302
|
if (data.__inputs !== void 0) {
|
|
7236
|
-
let
|
|
7237
|
-
if (Array.isArray(
|
|
7238
|
-
const len3 =
|
|
7303
|
+
let data16 = data.__inputs;
|
|
7304
|
+
if (Array.isArray(data16)) {
|
|
7305
|
+
const len3 = data16.length;
|
|
7239
7306
|
for (let i3 = 0; i3 < len3; i3++) {
|
|
7240
|
-
let
|
|
7241
|
-
if (
|
|
7242
|
-
if (
|
|
7243
|
-
const
|
|
7307
|
+
let data17 = data16[i3];
|
|
7308
|
+
if (data17 && typeof data17 == "object" && !Array.isArray(data17)) {
|
|
7309
|
+
if (data17.name === void 0) {
|
|
7310
|
+
const err23 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
|
|
7244
7311
|
if (vErrors === null) {
|
|
7245
|
-
vErrors = [
|
|
7312
|
+
vErrors = [err23];
|
|
7246
7313
|
} else {
|
|
7247
|
-
vErrors.push(
|
|
7314
|
+
vErrors.push(err23);
|
|
7248
7315
|
}
|
|
7249
7316
|
errors++;
|
|
7250
7317
|
}
|
|
7251
|
-
if (
|
|
7252
|
-
const
|
|
7318
|
+
if (data17.type === void 0) {
|
|
7319
|
+
const err24 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
7253
7320
|
if (vErrors === null) {
|
|
7254
|
-
vErrors = [
|
|
7321
|
+
vErrors = [err24];
|
|
7255
7322
|
} else {
|
|
7256
|
-
vErrors.push(
|
|
7323
|
+
vErrors.push(err24);
|
|
7257
7324
|
}
|
|
7258
7325
|
errors++;
|
|
7259
7326
|
}
|
|
7260
|
-
if (
|
|
7261
|
-
if (typeof
|
|
7262
|
-
const
|
|
7327
|
+
if (data17.name !== void 0) {
|
|
7328
|
+
if (typeof data17.name !== "string") {
|
|
7329
|
+
const err25 = { instancePath: instancePath + "/__inputs/" + i3 + "/name", schemaPath: "#/properties/__inputs/items/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7263
7330
|
if (vErrors === null) {
|
|
7264
|
-
vErrors = [
|
|
7331
|
+
vErrors = [err25];
|
|
7265
7332
|
} else {
|
|
7266
|
-
vErrors.push(
|
|
7333
|
+
vErrors.push(err25);
|
|
7267
7334
|
}
|
|
7268
7335
|
errors++;
|
|
7269
7336
|
}
|
|
7270
7337
|
}
|
|
7271
|
-
if (
|
|
7272
|
-
if (typeof
|
|
7273
|
-
const
|
|
7338
|
+
if (data17.type !== void 0) {
|
|
7339
|
+
if (typeof data17.type !== "string") {
|
|
7340
|
+
const err26 = { instancePath: instancePath + "/__inputs/" + i3 + "/type", schemaPath: "#/properties/__inputs/items/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7274
7341
|
if (vErrors === null) {
|
|
7275
|
-
vErrors = [
|
|
7342
|
+
vErrors = [err26];
|
|
7276
7343
|
} else {
|
|
7277
|
-
vErrors.push(
|
|
7344
|
+
vErrors.push(err26);
|
|
7278
7345
|
}
|
|
7279
7346
|
errors++;
|
|
7280
7347
|
}
|
|
7281
7348
|
}
|
|
7282
|
-
if (
|
|
7283
|
-
if (typeof
|
|
7284
|
-
const
|
|
7349
|
+
if (data17.pluginId !== void 0) {
|
|
7350
|
+
if (typeof data17.pluginId !== "string") {
|
|
7351
|
+
const err27 = { instancePath: instancePath + "/__inputs/" + i3 + "/pluginId", schemaPath: "#/properties/__inputs/items/properties/pluginId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7285
7352
|
if (vErrors === null) {
|
|
7286
|
-
vErrors = [
|
|
7353
|
+
vErrors = [err27];
|
|
7287
7354
|
} else {
|
|
7288
|
-
vErrors.push(
|
|
7355
|
+
vErrors.push(err27);
|
|
7289
7356
|
}
|
|
7290
7357
|
errors++;
|
|
7291
7358
|
}
|
|
7292
7359
|
}
|
|
7293
7360
|
} else {
|
|
7294
|
-
const
|
|
7361
|
+
const err28 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7295
7362
|
if (vErrors === null) {
|
|
7296
|
-
vErrors = [
|
|
7363
|
+
vErrors = [err28];
|
|
7297
7364
|
} else {
|
|
7298
|
-
vErrors.push(
|
|
7365
|
+
vErrors.push(err28);
|
|
7299
7366
|
}
|
|
7300
7367
|
errors++;
|
|
7301
7368
|
}
|
|
7302
7369
|
}
|
|
7303
7370
|
} else {
|
|
7304
|
-
const
|
|
7371
|
+
const err29 = { instancePath: instancePath + "/__inputs", schemaPath: "#/properties/__inputs/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7305
7372
|
if (vErrors === null) {
|
|
7306
|
-
vErrors = [
|
|
7373
|
+
vErrors = [err29];
|
|
7307
7374
|
} else {
|
|
7308
|
-
vErrors.push(
|
|
7375
|
+
vErrors.push(err29);
|
|
7309
7376
|
}
|
|
7310
7377
|
errors++;
|
|
7311
7378
|
}
|
|
7312
7379
|
}
|
|
7313
7380
|
} else {
|
|
7314
|
-
const
|
|
7381
|
+
const err30 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7315
7382
|
if (vErrors === null) {
|
|
7316
|
-
vErrors = [
|
|
7383
|
+
vErrors = [err30];
|
|
7317
7384
|
} else {
|
|
7318
|
-
vErrors.push(
|
|
7385
|
+
vErrors.push(err30);
|
|
7319
7386
|
}
|
|
7320
7387
|
errors++;
|
|
7321
7388
|
}
|
|
@@ -7549,9 +7616,10 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7549
7616
|
}
|
|
7550
7617
|
errors++;
|
|
7551
7618
|
}
|
|
7552
|
-
if (data.
|
|
7553
|
-
|
|
7554
|
-
|
|
7619
|
+
if (data.kind !== void 0) {
|
|
7620
|
+
let data0 = data.kind;
|
|
7621
|
+
if (typeof data0 !== "string") {
|
|
7622
|
+
const err2 = { instancePath: instancePath + "/kind", schemaPath: "#/definitions/DocumentKind/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7555
7623
|
if (vErrors === null) {
|
|
7556
7624
|
vErrors = [err2];
|
|
7557
7625
|
} else {
|
|
@@ -7559,232 +7627,252 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7559
7627
|
}
|
|
7560
7628
|
errors++;
|
|
7561
7629
|
}
|
|
7630
|
+
if (!(data0 === "form" || data0 === "dashboard")) {
|
|
7631
|
+
const err3 = { instancePath: instancePath + "/kind", schemaPath: "#/definitions/DocumentKind/enum", keyword: "enum", params: { allowedValues: schema18.enum }, message: "must be equal to one of the allowed values" };
|
|
7632
|
+
if (vErrors === null) {
|
|
7633
|
+
vErrors = [err3];
|
|
7634
|
+
} else {
|
|
7635
|
+
vErrors.push(err3);
|
|
7636
|
+
}
|
|
7637
|
+
errors++;
|
|
7638
|
+
}
|
|
7639
|
+
}
|
|
7640
|
+
if (data.uid !== void 0) {
|
|
7641
|
+
if (typeof data.uid !== "string") {
|
|
7642
|
+
const err4 = { instancePath: instancePath + "/uid", schemaPath: "#/properties/uid/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7643
|
+
if (vErrors === null) {
|
|
7644
|
+
vErrors = [err4];
|
|
7645
|
+
} else {
|
|
7646
|
+
vErrors.push(err4);
|
|
7647
|
+
}
|
|
7648
|
+
errors++;
|
|
7649
|
+
}
|
|
7562
7650
|
}
|
|
7563
7651
|
if (data.title !== void 0) {
|
|
7564
7652
|
if (typeof data.title !== "string") {
|
|
7565
|
-
const
|
|
7653
|
+
const err5 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7566
7654
|
if (vErrors === null) {
|
|
7567
|
-
vErrors = [
|
|
7655
|
+
vErrors = [err5];
|
|
7568
7656
|
} else {
|
|
7569
|
-
vErrors.push(
|
|
7657
|
+
vErrors.push(err5);
|
|
7570
7658
|
}
|
|
7571
7659
|
errors++;
|
|
7572
7660
|
}
|
|
7573
7661
|
}
|
|
7574
7662
|
if (data.description !== void 0) {
|
|
7575
7663
|
if (typeof data.description !== "string") {
|
|
7576
|
-
const
|
|
7664
|
+
const err6 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7577
7665
|
if (vErrors === null) {
|
|
7578
|
-
vErrors = [
|
|
7666
|
+
vErrors = [err6];
|
|
7579
7667
|
} else {
|
|
7580
|
-
vErrors.push(
|
|
7668
|
+
vErrors.push(err6);
|
|
7581
7669
|
}
|
|
7582
7670
|
errors++;
|
|
7583
7671
|
}
|
|
7584
7672
|
}
|
|
7585
7673
|
if (data.tags !== void 0) {
|
|
7586
|
-
let
|
|
7587
|
-
if (Array.isArray(
|
|
7588
|
-
const len0 =
|
|
7674
|
+
let data4 = data.tags;
|
|
7675
|
+
if (Array.isArray(data4)) {
|
|
7676
|
+
const len0 = data4.length;
|
|
7589
7677
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
7590
|
-
if (typeof
|
|
7591
|
-
const
|
|
7678
|
+
if (typeof data4[i0] !== "string") {
|
|
7679
|
+
const err7 = { instancePath: instancePath + "/tags/" + i0, schemaPath: "#/properties/tags/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7592
7680
|
if (vErrors === null) {
|
|
7593
|
-
vErrors = [
|
|
7681
|
+
vErrors = [err7];
|
|
7594
7682
|
} else {
|
|
7595
|
-
vErrors.push(
|
|
7683
|
+
vErrors.push(err7);
|
|
7596
7684
|
}
|
|
7597
7685
|
errors++;
|
|
7598
7686
|
}
|
|
7599
7687
|
}
|
|
7600
7688
|
} else {
|
|
7601
|
-
const
|
|
7689
|
+
const err8 = { instancePath: instancePath + "/tags", schemaPath: "#/properties/tags/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7602
7690
|
if (vErrors === null) {
|
|
7603
|
-
vErrors = [
|
|
7691
|
+
vErrors = [err8];
|
|
7604
7692
|
} else {
|
|
7605
|
-
vErrors.push(
|
|
7693
|
+
vErrors.push(err8);
|
|
7606
7694
|
}
|
|
7607
7695
|
errors++;
|
|
7608
7696
|
}
|
|
7609
7697
|
}
|
|
7610
7698
|
if (data.panels !== void 0) {
|
|
7611
|
-
let
|
|
7612
|
-
if (Array.isArray(
|
|
7613
|
-
const len1 =
|
|
7699
|
+
let data6 = data.panels;
|
|
7700
|
+
if (Array.isArray(data6)) {
|
|
7701
|
+
const len1 = data6.length;
|
|
7614
7702
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
7615
|
-
if (!validate18(
|
|
7703
|
+
if (!validate18(data6[i1], { instancePath: instancePath + "/panels/" + i1, parentData: data6, parentDataProperty: i1, rootData })) {
|
|
7616
7704
|
vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);
|
|
7617
7705
|
errors = vErrors.length;
|
|
7618
7706
|
}
|
|
7619
7707
|
}
|
|
7620
7708
|
} else {
|
|
7621
|
-
const
|
|
7709
|
+
const err9 = { instancePath: instancePath + "/panels", schemaPath: "#/properties/panels/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7622
7710
|
if (vErrors === null) {
|
|
7623
|
-
vErrors = [
|
|
7711
|
+
vErrors = [err9];
|
|
7624
7712
|
} else {
|
|
7625
|
-
vErrors.push(
|
|
7713
|
+
vErrors.push(err9);
|
|
7626
7714
|
}
|
|
7627
7715
|
errors++;
|
|
7628
7716
|
}
|
|
7629
7717
|
}
|
|
7630
7718
|
if (data.templating !== void 0) {
|
|
7631
|
-
let
|
|
7632
|
-
if (
|
|
7633
|
-
if (
|
|
7634
|
-
const
|
|
7719
|
+
let data8 = data.templating;
|
|
7720
|
+
if (data8 && typeof data8 == "object" && !Array.isArray(data8)) {
|
|
7721
|
+
if (data8.list === void 0) {
|
|
7722
|
+
const err10 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/required", keyword: "required", params: { missingProperty: "list" }, message: "must have required property 'list'" };
|
|
7635
7723
|
if (vErrors === null) {
|
|
7636
|
-
vErrors = [
|
|
7724
|
+
vErrors = [err10];
|
|
7637
7725
|
} else {
|
|
7638
|
-
vErrors.push(
|
|
7726
|
+
vErrors.push(err10);
|
|
7639
7727
|
}
|
|
7640
7728
|
errors++;
|
|
7641
7729
|
}
|
|
7642
|
-
if (
|
|
7643
|
-
let
|
|
7644
|
-
if (Array.isArray(
|
|
7645
|
-
const len2 =
|
|
7730
|
+
if (data8.list !== void 0) {
|
|
7731
|
+
let data9 = data8.list;
|
|
7732
|
+
if (Array.isArray(data9)) {
|
|
7733
|
+
const len2 = data9.length;
|
|
7646
7734
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
7647
|
-
if (!validate33(
|
|
7735
|
+
if (!validate33(data9[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data9, parentDataProperty: i2, rootData })) {
|
|
7648
7736
|
vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
|
|
7649
7737
|
errors = vErrors.length;
|
|
7650
7738
|
}
|
|
7651
7739
|
}
|
|
7652
7740
|
} else {
|
|
7653
|
-
const
|
|
7741
|
+
const err11 = { instancePath: instancePath + "/templating/list", schemaPath: "#/properties/templating/properties/list/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7654
7742
|
if (vErrors === null) {
|
|
7655
|
-
vErrors = [
|
|
7743
|
+
vErrors = [err11];
|
|
7656
7744
|
} else {
|
|
7657
|
-
vErrors.push(
|
|
7745
|
+
vErrors.push(err11);
|
|
7658
7746
|
}
|
|
7659
7747
|
errors++;
|
|
7660
7748
|
}
|
|
7661
7749
|
}
|
|
7662
7750
|
} else {
|
|
7663
|
-
const
|
|
7751
|
+
const err12 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7664
7752
|
if (vErrors === null) {
|
|
7665
|
-
vErrors = [
|
|
7753
|
+
vErrors = [err12];
|
|
7666
7754
|
} else {
|
|
7667
|
-
vErrors.push(
|
|
7755
|
+
vErrors.push(err12);
|
|
7668
7756
|
}
|
|
7669
7757
|
errors++;
|
|
7670
7758
|
}
|
|
7671
7759
|
}
|
|
7672
7760
|
if (data.time !== void 0) {
|
|
7673
|
-
let
|
|
7674
|
-
if (
|
|
7675
|
-
if (
|
|
7676
|
-
const
|
|
7761
|
+
let data11 = data.time;
|
|
7762
|
+
if (data11 && typeof data11 == "object" && !Array.isArray(data11)) {
|
|
7763
|
+
if (data11.from === void 0) {
|
|
7764
|
+
const err13 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "from" }, message: "must have required property 'from'" };
|
|
7677
7765
|
if (vErrors === null) {
|
|
7678
|
-
vErrors = [
|
|
7766
|
+
vErrors = [err13];
|
|
7679
7767
|
} else {
|
|
7680
|
-
vErrors.push(
|
|
7768
|
+
vErrors.push(err13);
|
|
7681
7769
|
}
|
|
7682
7770
|
errors++;
|
|
7683
7771
|
}
|
|
7684
|
-
if (
|
|
7685
|
-
const
|
|
7772
|
+
if (data11.to === void 0) {
|
|
7773
|
+
const err14 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/required", keyword: "required", params: { missingProperty: "to" }, message: "must have required property 'to'" };
|
|
7686
7774
|
if (vErrors === null) {
|
|
7687
|
-
vErrors = [
|
|
7775
|
+
vErrors = [err14];
|
|
7688
7776
|
} else {
|
|
7689
|
-
vErrors.push(
|
|
7777
|
+
vErrors.push(err14);
|
|
7690
7778
|
}
|
|
7691
7779
|
errors++;
|
|
7692
7780
|
}
|
|
7693
|
-
if (
|
|
7694
|
-
if (typeof
|
|
7695
|
-
const
|
|
7781
|
+
if (data11.from !== void 0) {
|
|
7782
|
+
if (typeof data11.from !== "string") {
|
|
7783
|
+
const err15 = { instancePath: instancePath + "/time/from", schemaPath: "#/properties/time/properties/from/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7696
7784
|
if (vErrors === null) {
|
|
7697
|
-
vErrors = [
|
|
7785
|
+
vErrors = [err15];
|
|
7698
7786
|
} else {
|
|
7699
|
-
vErrors.push(
|
|
7787
|
+
vErrors.push(err15);
|
|
7700
7788
|
}
|
|
7701
7789
|
errors++;
|
|
7702
7790
|
}
|
|
7703
7791
|
}
|
|
7704
|
-
if (
|
|
7705
|
-
if (typeof
|
|
7706
|
-
const
|
|
7792
|
+
if (data11.to !== void 0) {
|
|
7793
|
+
if (typeof data11.to !== "string") {
|
|
7794
|
+
const err16 = { instancePath: instancePath + "/time/to", schemaPath: "#/properties/time/properties/to/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7707
7795
|
if (vErrors === null) {
|
|
7708
|
-
vErrors = [
|
|
7796
|
+
vErrors = [err16];
|
|
7709
7797
|
} else {
|
|
7710
|
-
vErrors.push(
|
|
7798
|
+
vErrors.push(err16);
|
|
7711
7799
|
}
|
|
7712
7800
|
errors++;
|
|
7713
7801
|
}
|
|
7714
7802
|
}
|
|
7715
7803
|
} else {
|
|
7716
|
-
const
|
|
7804
|
+
const err17 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7717
7805
|
if (vErrors === null) {
|
|
7718
|
-
vErrors = [
|
|
7806
|
+
vErrors = [err17];
|
|
7719
7807
|
} else {
|
|
7720
|
-
vErrors.push(
|
|
7808
|
+
vErrors.push(err17);
|
|
7721
7809
|
}
|
|
7722
7810
|
errors++;
|
|
7723
7811
|
}
|
|
7724
7812
|
}
|
|
7725
7813
|
if (data.timezone !== void 0) {
|
|
7726
7814
|
if (typeof data.timezone !== "string") {
|
|
7727
|
-
const
|
|
7815
|
+
const err18 = { instancePath: instancePath + "/timezone", schemaPath: "#/properties/timezone/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7728
7816
|
if (vErrors === null) {
|
|
7729
|
-
vErrors = [
|
|
7817
|
+
vErrors = [err18];
|
|
7730
7818
|
} else {
|
|
7731
|
-
vErrors.push(
|
|
7819
|
+
vErrors.push(err18);
|
|
7732
7820
|
}
|
|
7733
7821
|
errors++;
|
|
7734
7822
|
}
|
|
7735
7823
|
}
|
|
7736
7824
|
if (data.refresh !== void 0) {
|
|
7737
|
-
let
|
|
7738
|
-
const
|
|
7739
|
-
let
|
|
7740
|
-
const
|
|
7741
|
-
if (typeof
|
|
7742
|
-
const
|
|
7825
|
+
let data15 = data.refresh;
|
|
7826
|
+
const _errs31 = errors;
|
|
7827
|
+
let valid10 = false;
|
|
7828
|
+
const _errs32 = errors;
|
|
7829
|
+
if (typeof data15 !== "string") {
|
|
7830
|
+
const err19 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7743
7831
|
if (vErrors === null) {
|
|
7744
|
-
vErrors = [
|
|
7832
|
+
vErrors = [err19];
|
|
7745
7833
|
} else {
|
|
7746
|
-
vErrors.push(
|
|
7834
|
+
vErrors.push(err19);
|
|
7747
7835
|
}
|
|
7748
7836
|
errors++;
|
|
7749
7837
|
}
|
|
7750
|
-
var _valid0 =
|
|
7751
|
-
|
|
7752
|
-
if (!
|
|
7753
|
-
const
|
|
7754
|
-
if (typeof
|
|
7755
|
-
const
|
|
7838
|
+
var _valid0 = _errs32 === errors;
|
|
7839
|
+
valid10 = valid10 || _valid0;
|
|
7840
|
+
if (!valid10) {
|
|
7841
|
+
const _errs34 = errors;
|
|
7842
|
+
if (typeof data15 !== "boolean") {
|
|
7843
|
+
const err20 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" };
|
|
7756
7844
|
if (vErrors === null) {
|
|
7757
|
-
vErrors = [
|
|
7845
|
+
vErrors = [err20];
|
|
7758
7846
|
} else {
|
|
7759
|
-
vErrors.push(
|
|
7847
|
+
vErrors.push(err20);
|
|
7760
7848
|
}
|
|
7761
7849
|
errors++;
|
|
7762
7850
|
}
|
|
7763
|
-
if (false !==
|
|
7764
|
-
const
|
|
7851
|
+
if (false !== data15) {
|
|
7852
|
+
const err21 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf/1/const", keyword: "const", params: { allowedValue: false }, message: "must be equal to constant" };
|
|
7765
7853
|
if (vErrors === null) {
|
|
7766
|
-
vErrors = [
|
|
7854
|
+
vErrors = [err21];
|
|
7767
7855
|
} else {
|
|
7768
|
-
vErrors.push(
|
|
7856
|
+
vErrors.push(err21);
|
|
7769
7857
|
}
|
|
7770
7858
|
errors++;
|
|
7771
7859
|
}
|
|
7772
|
-
var _valid0 =
|
|
7773
|
-
|
|
7860
|
+
var _valid0 = _errs34 === errors;
|
|
7861
|
+
valid10 = valid10 || _valid0;
|
|
7774
7862
|
}
|
|
7775
|
-
if (!
|
|
7776
|
-
const
|
|
7863
|
+
if (!valid10) {
|
|
7864
|
+
const err22 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
7777
7865
|
if (vErrors === null) {
|
|
7778
|
-
vErrors = [
|
|
7866
|
+
vErrors = [err22];
|
|
7779
7867
|
} else {
|
|
7780
|
-
vErrors.push(
|
|
7868
|
+
vErrors.push(err22);
|
|
7781
7869
|
}
|
|
7782
7870
|
errors++;
|
|
7783
7871
|
} else {
|
|
7784
|
-
errors =
|
|
7872
|
+
errors = _errs31;
|
|
7785
7873
|
if (vErrors !== null) {
|
|
7786
|
-
if (
|
|
7787
|
-
vErrors.length =
|
|
7874
|
+
if (_errs31) {
|
|
7875
|
+
vErrors.length = _errs31;
|
|
7788
7876
|
} else {
|
|
7789
7877
|
vErrors = null;
|
|
7790
7878
|
}
|
|
@@ -7792,89 +7880,89 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7792
7880
|
}
|
|
7793
7881
|
}
|
|
7794
7882
|
if (data.__inputs !== void 0) {
|
|
7795
|
-
let
|
|
7796
|
-
if (Array.isArray(
|
|
7797
|
-
const len3 =
|
|
7883
|
+
let data16 = data.__inputs;
|
|
7884
|
+
if (Array.isArray(data16)) {
|
|
7885
|
+
const len3 = data16.length;
|
|
7798
7886
|
for (let i3 = 0; i3 < len3; i3++) {
|
|
7799
|
-
let
|
|
7800
|
-
if (
|
|
7801
|
-
if (
|
|
7802
|
-
const
|
|
7887
|
+
let data17 = data16[i3];
|
|
7888
|
+
if (data17 && typeof data17 == "object" && !Array.isArray(data17)) {
|
|
7889
|
+
if (data17.name === void 0) {
|
|
7890
|
+
const err23 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "name" }, message: "must have required property 'name'" };
|
|
7803
7891
|
if (vErrors === null) {
|
|
7804
|
-
vErrors = [
|
|
7892
|
+
vErrors = [err23];
|
|
7805
7893
|
} else {
|
|
7806
|
-
vErrors.push(
|
|
7894
|
+
vErrors.push(err23);
|
|
7807
7895
|
}
|
|
7808
7896
|
errors++;
|
|
7809
7897
|
}
|
|
7810
|
-
if (
|
|
7811
|
-
const
|
|
7898
|
+
if (data17.type === void 0) {
|
|
7899
|
+
const err24 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
7812
7900
|
if (vErrors === null) {
|
|
7813
|
-
vErrors = [
|
|
7901
|
+
vErrors = [err24];
|
|
7814
7902
|
} else {
|
|
7815
|
-
vErrors.push(
|
|
7903
|
+
vErrors.push(err24);
|
|
7816
7904
|
}
|
|
7817
7905
|
errors++;
|
|
7818
7906
|
}
|
|
7819
|
-
if (
|
|
7820
|
-
if (typeof
|
|
7821
|
-
const
|
|
7907
|
+
if (data17.name !== void 0) {
|
|
7908
|
+
if (typeof data17.name !== "string") {
|
|
7909
|
+
const err25 = { instancePath: instancePath + "/__inputs/" + i3 + "/name", schemaPath: "#/properties/__inputs/items/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7822
7910
|
if (vErrors === null) {
|
|
7823
|
-
vErrors = [
|
|
7911
|
+
vErrors = [err25];
|
|
7824
7912
|
} else {
|
|
7825
|
-
vErrors.push(
|
|
7913
|
+
vErrors.push(err25);
|
|
7826
7914
|
}
|
|
7827
7915
|
errors++;
|
|
7828
7916
|
}
|
|
7829
7917
|
}
|
|
7830
|
-
if (
|
|
7831
|
-
if (typeof
|
|
7832
|
-
const
|
|
7918
|
+
if (data17.type !== void 0) {
|
|
7919
|
+
if (typeof data17.type !== "string") {
|
|
7920
|
+
const err26 = { instancePath: instancePath + "/__inputs/" + i3 + "/type", schemaPath: "#/properties/__inputs/items/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7833
7921
|
if (vErrors === null) {
|
|
7834
|
-
vErrors = [
|
|
7922
|
+
vErrors = [err26];
|
|
7835
7923
|
} else {
|
|
7836
|
-
vErrors.push(
|
|
7924
|
+
vErrors.push(err26);
|
|
7837
7925
|
}
|
|
7838
7926
|
errors++;
|
|
7839
7927
|
}
|
|
7840
7928
|
}
|
|
7841
|
-
if (
|
|
7842
|
-
if (typeof
|
|
7843
|
-
const
|
|
7929
|
+
if (data17.pluginId !== void 0) {
|
|
7930
|
+
if (typeof data17.pluginId !== "string") {
|
|
7931
|
+
const err27 = { instancePath: instancePath + "/__inputs/" + i3 + "/pluginId", schemaPath: "#/properties/__inputs/items/properties/pluginId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7844
7932
|
if (vErrors === null) {
|
|
7845
|
-
vErrors = [
|
|
7933
|
+
vErrors = [err27];
|
|
7846
7934
|
} else {
|
|
7847
|
-
vErrors.push(
|
|
7935
|
+
vErrors.push(err27);
|
|
7848
7936
|
}
|
|
7849
7937
|
errors++;
|
|
7850
7938
|
}
|
|
7851
7939
|
}
|
|
7852
7940
|
} else {
|
|
7853
|
-
const
|
|
7941
|
+
const err28 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7854
7942
|
if (vErrors === null) {
|
|
7855
|
-
vErrors = [
|
|
7943
|
+
vErrors = [err28];
|
|
7856
7944
|
} else {
|
|
7857
|
-
vErrors.push(
|
|
7945
|
+
vErrors.push(err28);
|
|
7858
7946
|
}
|
|
7859
7947
|
errors++;
|
|
7860
7948
|
}
|
|
7861
7949
|
}
|
|
7862
7950
|
} else {
|
|
7863
|
-
const
|
|
7951
|
+
const err29 = { instancePath: instancePath + "/__inputs", schemaPath: "#/properties/__inputs/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7864
7952
|
if (vErrors === null) {
|
|
7865
|
-
vErrors = [
|
|
7953
|
+
vErrors = [err29];
|
|
7866
7954
|
} else {
|
|
7867
|
-
vErrors.push(
|
|
7955
|
+
vErrors.push(err29);
|
|
7868
7956
|
}
|
|
7869
7957
|
errors++;
|
|
7870
7958
|
}
|
|
7871
7959
|
}
|
|
7872
7960
|
} else {
|
|
7873
|
-
const
|
|
7961
|
+
const err30 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7874
7962
|
if (vErrors === null) {
|
|
7875
|
-
vErrors = [
|
|
7963
|
+
vErrors = [err30];
|
|
7876
7964
|
} else {
|
|
7877
|
-
vErrors.push(
|
|
7965
|
+
vErrors.push(err30);
|
|
7878
7966
|
}
|
|
7879
7967
|
errors++;
|
|
7880
7968
|
}
|
|
@@ -8606,6 +8694,8 @@ function validateBundle(bundle, file = "manifest") {
|
|
|
8606
8694
|
const doc = bundle.documents[ref.id];
|
|
8607
8695
|
if (!doc && ref.id in bundle.manifest.documents) continue;
|
|
8608
8696
|
if (!doc) issues.push({ severity: "error", path: `${file}: ${ref.path}`, message: `no document "${ref.id}" in documents` });
|
|
8697
|
+
else if (doc.kind && doc.kind !== ref.kind)
|
|
8698
|
+
issues.push({ severity: "warning", path: `${file}: ${ref.path}`, message: `"${ref.id}" is a ${doc.kind}, shown here as a ${ref.kind}` });
|
|
8609
8699
|
else if (ref.kind === "form" && !inputPanels(doc).length)
|
|
8610
8700
|
issues.push({ severity: "warning", path: `${file}: ${ref.path}`, message: `"${ref.id}" has no input-* panels to fill in` });
|
|
8611
8701
|
}
|
|
@@ -10665,9 +10755,11 @@ function newPanel(type, metric = "value") {
|
|
|
10665
10755
|
}
|
|
10666
10756
|
function newDocument(kind, title) {
|
|
10667
10757
|
const doc = kind === "form" ? {
|
|
10758
|
+
kind,
|
|
10668
10759
|
title,
|
|
10669
10760
|
panels: [{ id: 1, type: "input-number", title: "Value", gridPos: { x: 0, y: 0, w: 24, h: 3 }, options: { metric: "value", step: 1 } }]
|
|
10670
10761
|
} : {
|
|
10762
|
+
kind,
|
|
10671
10763
|
title,
|
|
10672
10764
|
time: { from: "now-30d", to: "now" },
|
|
10673
10765
|
panels: [
|
|
@@ -11129,7 +11221,27 @@ function sampleEntries(forms, metrics, now = Date.now(), days = 180) {
|
|
|
11129
11221
|
const makers = /* @__PURE__ */ new Map();
|
|
11130
11222
|
for (const form of forms) for (const p of inputPanels(form)) if (!makers.has(p.options.metric)) makers.set(p.options.metric, maker(p.type, p.options));
|
|
11131
11223
|
const out = [];
|
|
11224
|
+
const grouped = /* @__PURE__ */ new Set();
|
|
11225
|
+
for (const form of forms)
|
|
11226
|
+
for (const g of inputGroups(form)) {
|
|
11227
|
+
const fields = groupFields(g).filter((f) => !grouped.has(f.options.metric));
|
|
11228
|
+
if (!fields.length) continue;
|
|
11229
|
+
fields.forEach((f) => grouped.add(f.options.metric));
|
|
11230
|
+
const next = random(fields.map((f) => f.options.metric).join("|"));
|
|
11231
|
+
for (let d = days - 1; d >= 0; d--) {
|
|
11232
|
+
if (next() < 0.2) continue;
|
|
11233
|
+
const ts = Math.min(now, Math.floor(now / DAY - d) * DAY + (7 + next() * 14) * 36e5);
|
|
11234
|
+
const save = `sample-${fields[0].options.metric}-${d}`;
|
|
11235
|
+
const items = 1 + Math.floor(next() * 4);
|
|
11236
|
+
for (let item = 0; item < items; item++)
|
|
11237
|
+
for (const f of fields) {
|
|
11238
|
+
const [e] = makers.get(f.options.metric)(next, d);
|
|
11239
|
+
if (e) out.push({ metric: f.options.metric, ts, ...e, save, item });
|
|
11240
|
+
}
|
|
11241
|
+
}
|
|
11242
|
+
}
|
|
11132
11243
|
for (const metric of /* @__PURE__ */ new Set([...metrics, ...makers.keys()])) {
|
|
11244
|
+
if (grouped.has(metric)) continue;
|
|
11133
11245
|
const next = random(metric);
|
|
11134
11246
|
const make = makers.get(metric) ?? walk(40, 80);
|
|
11135
11247
|
for (let d = days - 1; d >= 0; d--) {
|
|
@@ -11328,7 +11440,7 @@ function tabsShowing(tabs, ids) {
|
|
|
11328
11440
|
});
|
|
11329
11441
|
}
|
|
11330
11442
|
function makeTemplate(manifest, documents, ids, meta) {
|
|
11331
|
-
const docs = ids.filter((id) => documents[id]).map((id) => ({ kind:
|
|
11443
|
+
const docs = ids.filter((id) => documents[id]).map((id) => ({ kind: documentKind(documents[id]), id, dashboard: structuredClone(documents[id]) }));
|
|
11332
11444
|
return {
|
|
11333
11445
|
$modelform: "template",
|
|
11334
11446
|
version: TEMPLATE_VERSION,
|
|
@@ -11359,6 +11471,7 @@ function parseTemplate(text) {
|
|
|
11359
11471
|
seen.add(d.id);
|
|
11360
11472
|
const { dashboard, issues } = prepareDashboard(d.dashboard, d.id);
|
|
11361
11473
|
if (!dashboard) return { error: `"${d.id}" can\u2019t be shown: ${issues.find((x) => x.severity === "error")?.message ?? "it isn\u2019t a dashboard"}` };
|
|
11474
|
+
if (dashboard.kind && dashboard.kind !== d.kind) return { error: `"${d.id}" is listed as a ${d.kind} but says it\u2019s a ${dashboard.kind}` };
|
|
11362
11475
|
documents.push({ kind: d.kind, id: d.id, dashboard });
|
|
11363
11476
|
}
|
|
11364
11477
|
const tabs = Array.isArray(json.tabs) ? json.tabs.filter((t) => isObject5(t) && typeof t.id === "string" && typeof t.title === "string" && isObject5(t.screen)) : [];
|
|
@@ -11424,7 +11537,8 @@ function applyTemplate(manifestText, paths, template, options = {}) {
|
|
|
11424
11537
|
taken.add(id);
|
|
11425
11538
|
files.add(path);
|
|
11426
11539
|
ids[doc.id] = id;
|
|
11427
|
-
const
|
|
11540
|
+
const { kind: _kind, ...rest } = doc.dashboard;
|
|
11541
|
+
const dashboard = { kind: doc.kind, ...rest, ...options.metrics && { panels: renameMetrics(doc.dashboard.panels ?? [], options.metrics) } };
|
|
11428
11542
|
out[path] = JSON.stringify(dashboard, null, 2) + "\n";
|
|
11429
11543
|
if (manifest.documents) edits.push({ path: ["documents", id], value: path });
|
|
11430
11544
|
else {
|
|
@@ -11523,6 +11637,7 @@ export {
|
|
|
11523
11637
|
GROUP_FIELD_TYPES,
|
|
11524
11638
|
groupFields,
|
|
11525
11639
|
inputPanels,
|
|
11640
|
+
documentKind,
|
|
11526
11641
|
inputGroups,
|
|
11527
11642
|
plainInputPanels,
|
|
11528
11643
|
parseClockDigits,
|
|
@@ -11556,6 +11671,7 @@ export {
|
|
|
11556
11671
|
LOCAL_DATASOURCE_TYPE,
|
|
11557
11672
|
isLocalDatasource,
|
|
11558
11673
|
LocalDataSource,
|
|
11674
|
+
groupField,
|
|
11559
11675
|
buildFrames,
|
|
11560
11676
|
MemoryEntryStore,
|
|
11561
11677
|
DEFAULT_GAZETTEER,
|