@modelform/react-native 0.8.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 +2 -1
- package/dist/{chunk-QIBL3YUL.js → chunk-FBZDJWT2.js} +359 -294
- package/dist/{chunk-AQO56KS2.mjs → chunk-KOCUG6GH.mjs} +358 -293
- package/dist/core/index.js +4 -2
- package/dist/core/index.mjs +3 -1
- package/dist/core/inputs.d.ts +6 -1
- package/dist/core/manifest.d.ts +4 -1
- package/dist/core/schema.d.ts +8 -1
- package/dist/index.js +157 -155
- package/dist/index.mjs +3 -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
|
}
|
|
@@ -2162,6 +2166,10 @@ var dashboard_schema_default = {
|
|
|
2162
2166
|
Dashboard: {
|
|
2163
2167
|
type: "object",
|
|
2164
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
|
+
},
|
|
2165
2173
|
uid: {
|
|
2166
2174
|
type: "string"
|
|
2167
2175
|
},
|
|
@@ -2253,8 +2261,15 @@ var dashboard_schema_default = {
|
|
|
2253
2261
|
required: [
|
|
2254
2262
|
"title",
|
|
2255
2263
|
"panels"
|
|
2264
|
+
]
|
|
2265
|
+
},
|
|
2266
|
+
DocumentKind: {
|
|
2267
|
+
type: "string",
|
|
2268
|
+
enum: [
|
|
2269
|
+
"form",
|
|
2270
|
+
"dashboard"
|
|
2256
2271
|
],
|
|
2257
|
-
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)"
|
|
2258
2273
|
},
|
|
2259
2274
|
Panel: {
|
|
2260
2275
|
type: "object",
|
|
@@ -3757,10 +3772,11 @@ function validate12(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3757
3772
|
validate12.errors = vErrors;
|
|
3758
3773
|
return errors === 0;
|
|
3759
3774
|
}
|
|
3760
|
-
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" } } } }] };
|
|
3761
3777
|
var pattern1 = new RegExp("^input-(?!group$)", "u");
|
|
3762
|
-
var
|
|
3763
|
-
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"] };
|
|
3764
3780
|
function validate19(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3765
3781
|
let vErrors = null;
|
|
3766
3782
|
let errors = 0;
|
|
@@ -3963,7 +3979,7 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3963
3979
|
errors++;
|
|
3964
3980
|
}
|
|
3965
3981
|
if (!(data9 === "changed" || data9 === "always")) {
|
|
3966
|
-
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" };
|
|
3967
3983
|
if (vErrors === null) {
|
|
3968
3984
|
vErrors = [err16];
|
|
3969
3985
|
} else {
|
|
@@ -4022,7 +4038,7 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4022
4038
|
if (data12.value !== void 0) {
|
|
4023
4039
|
let data14 = data12.value;
|
|
4024
4040
|
if (!(typeof data14 == "number") && typeof data14 !== "string") {
|
|
4025
|
-
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" };
|
|
4026
4042
|
if (vErrors === null) {
|
|
4027
4043
|
vErrors = [err21];
|
|
4028
4044
|
} else {
|
|
@@ -4118,7 +4134,7 @@ function validate19(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4118
4134
|
validate19.errors = vErrors;
|
|
4119
4135
|
return errors === 0;
|
|
4120
4136
|
}
|
|
4121
|
-
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" } }' };
|
|
4122
4138
|
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
4123
4139
|
let vErrors = null;
|
|
4124
4140
|
let errors = 0;
|
|
@@ -4153,7 +4169,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4153
4169
|
errors++;
|
|
4154
4170
|
}
|
|
4155
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")) {
|
|
4156
|
-
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" };
|
|
4157
4173
|
if (vErrors === null) {
|
|
4158
4174
|
vErrors = [err3];
|
|
4159
4175
|
} else {
|
|
@@ -4526,9 +4542,9 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4526
4542
|
validate26.errors = vErrors;
|
|
4527
4543
|
return errors === 0;
|
|
4528
4544
|
}
|
|
4529
|
-
var
|
|
4530
|
-
var
|
|
4531
|
-
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." };
|
|
4532
4548
|
function validate29(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
4533
4549
|
let vErrors = null;
|
|
4534
4550
|
let errors = 0;
|
|
@@ -4702,7 +4718,7 @@ function validate29(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4702
4718
|
if (data7.from !== void 0) {
|
|
4703
4719
|
let data8 = data7.from;
|
|
4704
4720
|
if (!(typeof data8 == "number") && data8 !== null) {
|
|
4705
|
-
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" };
|
|
4706
4722
|
if (vErrors === null) {
|
|
4707
4723
|
vErrors = [err15];
|
|
4708
4724
|
} else {
|
|
@@ -4714,7 +4730,7 @@ function validate29(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4714
4730
|
if (data7.to !== void 0) {
|
|
4715
4731
|
let data9 = data7.to;
|
|
4716
4732
|
if (!(typeof data9 == "number") && data9 !== null) {
|
|
4717
|
-
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" };
|
|
4718
4734
|
if (vErrors === null) {
|
|
4719
4735
|
vErrors = [err16];
|
|
4720
4736
|
} else {
|
|
@@ -5006,7 +5022,7 @@ function validate29(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5006
5022
|
errors++;
|
|
5007
5023
|
}
|
|
5008
5024
|
if (!(data23 === "null" || data23 === "nan" || data23 === "null+nan" || data23 === "true" || data23 === "false" || data23 === "empty")) {
|
|
5009
|
-
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" };
|
|
5010
5026
|
if (vErrors === null) {
|
|
5011
5027
|
vErrors = [err43];
|
|
5012
5028
|
} else {
|
|
@@ -5259,7 +5275,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5259
5275
|
errors++;
|
|
5260
5276
|
}
|
|
5261
5277
|
if (!(data9 === "absolute" || data9 === "percentage")) {
|
|
5262
|
-
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" };
|
|
5263
5279
|
if (vErrors === null) {
|
|
5264
5280
|
vErrors = [err10];
|
|
5265
5281
|
} else {
|
|
@@ -5296,7 +5312,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5296
5312
|
if (data11.value !== void 0) {
|
|
5297
5313
|
let data12 = data11.value;
|
|
5298
5314
|
if (!(typeof data12 == "number") && data12 !== null) {
|
|
5299
|
-
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" };
|
|
5300
5316
|
if (vErrors === null) {
|
|
5301
5317
|
vErrors = [err13];
|
|
5302
5318
|
} else {
|
|
@@ -5459,7 +5475,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5459
5475
|
errors++;
|
|
5460
5476
|
}
|
|
5461
5477
|
if (!(data22 === "line" || data22 === "bars" || data22 === "points")) {
|
|
5462
|
-
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" };
|
|
5463
5479
|
if (vErrors === null) {
|
|
5464
5480
|
vErrors = [err27];
|
|
5465
5481
|
} else {
|
|
@@ -5502,7 +5518,7 @@ function validate28(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
5502
5518
|
errors++;
|
|
5503
5519
|
}
|
|
5504
5520
|
if (!(data25 === "auto" || data25 === "always" || data25 === "never")) {
|
|
5505
|
-
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" };
|
|
5506
5522
|
if (vErrors === null) {
|
|
5507
5523
|
vErrors = [err31];
|
|
5508
5524
|
} else {
|
|
@@ -6216,7 +6232,7 @@ function validate18(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6216
6232
|
errors++;
|
|
6217
6233
|
}
|
|
6218
6234
|
if (!(data37 === "h" || data37 === "v")) {
|
|
6219
|
-
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" };
|
|
6220
6236
|
if (vErrors === null) {
|
|
6221
6237
|
vErrors = [err53];
|
|
6222
6238
|
} else {
|
|
@@ -6438,7 +6454,7 @@ function validate18(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6438
6454
|
validate18.errors = vErrors;
|
|
6439
6455
|
return errors === 0;
|
|
6440
6456
|
}
|
|
6441
|
-
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"] };
|
|
6442
6458
|
function validate33(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
6443
6459
|
let vErrors = null;
|
|
6444
6460
|
let errors = 0;
|
|
@@ -6858,7 +6874,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
6858
6874
|
if (data.allValue !== void 0) {
|
|
6859
6875
|
let data19 = data.allValue;
|
|
6860
6876
|
if (typeof data19 !== "string" && data19 !== null) {
|
|
6861
|
-
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" };
|
|
6862
6878
|
if (vErrors === null) {
|
|
6863
6879
|
vErrors = [err31];
|
|
6864
6880
|
} else {
|
|
@@ -7020,9 +7036,10 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7020
7036
|
}
|
|
7021
7037
|
errors++;
|
|
7022
7038
|
}
|
|
7023
|
-
if (data.
|
|
7024
|
-
|
|
7025
|
-
|
|
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" };
|
|
7026
7043
|
if (vErrors === null) {
|
|
7027
7044
|
vErrors = [err2];
|
|
7028
7045
|
} else {
|
|
@@ -7030,232 +7047,252 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7030
7047
|
}
|
|
7031
7048
|
errors++;
|
|
7032
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
|
+
}
|
|
7033
7070
|
}
|
|
7034
7071
|
if (data.title !== void 0) {
|
|
7035
7072
|
if (typeof data.title !== "string") {
|
|
7036
|
-
const
|
|
7073
|
+
const err5 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7037
7074
|
if (vErrors === null) {
|
|
7038
|
-
vErrors = [
|
|
7075
|
+
vErrors = [err5];
|
|
7039
7076
|
} else {
|
|
7040
|
-
vErrors.push(
|
|
7077
|
+
vErrors.push(err5);
|
|
7041
7078
|
}
|
|
7042
7079
|
errors++;
|
|
7043
7080
|
}
|
|
7044
7081
|
}
|
|
7045
7082
|
if (data.description !== void 0) {
|
|
7046
7083
|
if (typeof data.description !== "string") {
|
|
7047
|
-
const
|
|
7084
|
+
const err6 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7048
7085
|
if (vErrors === null) {
|
|
7049
|
-
vErrors = [
|
|
7086
|
+
vErrors = [err6];
|
|
7050
7087
|
} else {
|
|
7051
|
-
vErrors.push(
|
|
7088
|
+
vErrors.push(err6);
|
|
7052
7089
|
}
|
|
7053
7090
|
errors++;
|
|
7054
7091
|
}
|
|
7055
7092
|
}
|
|
7056
7093
|
if (data.tags !== void 0) {
|
|
7057
|
-
let
|
|
7058
|
-
if (Array.isArray(
|
|
7059
|
-
const len0 =
|
|
7094
|
+
let data4 = data.tags;
|
|
7095
|
+
if (Array.isArray(data4)) {
|
|
7096
|
+
const len0 = data4.length;
|
|
7060
7097
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
7061
|
-
if (typeof
|
|
7062
|
-
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" };
|
|
7063
7100
|
if (vErrors === null) {
|
|
7064
|
-
vErrors = [
|
|
7101
|
+
vErrors = [err7];
|
|
7065
7102
|
} else {
|
|
7066
|
-
vErrors.push(
|
|
7103
|
+
vErrors.push(err7);
|
|
7067
7104
|
}
|
|
7068
7105
|
errors++;
|
|
7069
7106
|
}
|
|
7070
7107
|
}
|
|
7071
7108
|
} else {
|
|
7072
|
-
const
|
|
7109
|
+
const err8 = { instancePath: instancePath + "/tags", schemaPath: "#/properties/tags/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7073
7110
|
if (vErrors === null) {
|
|
7074
|
-
vErrors = [
|
|
7111
|
+
vErrors = [err8];
|
|
7075
7112
|
} else {
|
|
7076
|
-
vErrors.push(
|
|
7113
|
+
vErrors.push(err8);
|
|
7077
7114
|
}
|
|
7078
7115
|
errors++;
|
|
7079
7116
|
}
|
|
7080
7117
|
}
|
|
7081
7118
|
if (data.panels !== void 0) {
|
|
7082
|
-
let
|
|
7083
|
-
if (Array.isArray(
|
|
7084
|
-
const len1 =
|
|
7119
|
+
let data6 = data.panels;
|
|
7120
|
+
if (Array.isArray(data6)) {
|
|
7121
|
+
const len1 = data6.length;
|
|
7085
7122
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
7086
|
-
if (!validate18(
|
|
7123
|
+
if (!validate18(data6[i1], { instancePath: instancePath + "/panels/" + i1, parentData: data6, parentDataProperty: i1, rootData })) {
|
|
7087
7124
|
vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);
|
|
7088
7125
|
errors = vErrors.length;
|
|
7089
7126
|
}
|
|
7090
7127
|
}
|
|
7091
7128
|
} else {
|
|
7092
|
-
const
|
|
7129
|
+
const err9 = { instancePath: instancePath + "/panels", schemaPath: "#/properties/panels/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7093
7130
|
if (vErrors === null) {
|
|
7094
|
-
vErrors = [
|
|
7131
|
+
vErrors = [err9];
|
|
7095
7132
|
} else {
|
|
7096
|
-
vErrors.push(
|
|
7133
|
+
vErrors.push(err9);
|
|
7097
7134
|
}
|
|
7098
7135
|
errors++;
|
|
7099
7136
|
}
|
|
7100
7137
|
}
|
|
7101
7138
|
if (data.templating !== void 0) {
|
|
7102
|
-
let
|
|
7103
|
-
if (
|
|
7104
|
-
if (
|
|
7105
|
-
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'" };
|
|
7106
7143
|
if (vErrors === null) {
|
|
7107
|
-
vErrors = [
|
|
7144
|
+
vErrors = [err10];
|
|
7108
7145
|
} else {
|
|
7109
|
-
vErrors.push(
|
|
7146
|
+
vErrors.push(err10);
|
|
7110
7147
|
}
|
|
7111
7148
|
errors++;
|
|
7112
7149
|
}
|
|
7113
|
-
if (
|
|
7114
|
-
let
|
|
7115
|
-
if (Array.isArray(
|
|
7116
|
-
const len2 =
|
|
7150
|
+
if (data8.list !== void 0) {
|
|
7151
|
+
let data9 = data8.list;
|
|
7152
|
+
if (Array.isArray(data9)) {
|
|
7153
|
+
const len2 = data9.length;
|
|
7117
7154
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
7118
|
-
if (!validate33(
|
|
7155
|
+
if (!validate33(data9[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data9, parentDataProperty: i2, rootData })) {
|
|
7119
7156
|
vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
|
|
7120
7157
|
errors = vErrors.length;
|
|
7121
7158
|
}
|
|
7122
7159
|
}
|
|
7123
7160
|
} else {
|
|
7124
|
-
const
|
|
7161
|
+
const err11 = { instancePath: instancePath + "/templating/list", schemaPath: "#/properties/templating/properties/list/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7125
7162
|
if (vErrors === null) {
|
|
7126
|
-
vErrors = [
|
|
7163
|
+
vErrors = [err11];
|
|
7127
7164
|
} else {
|
|
7128
|
-
vErrors.push(
|
|
7165
|
+
vErrors.push(err11);
|
|
7129
7166
|
}
|
|
7130
7167
|
errors++;
|
|
7131
7168
|
}
|
|
7132
7169
|
}
|
|
7133
7170
|
} else {
|
|
7134
|
-
const
|
|
7171
|
+
const err12 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7135
7172
|
if (vErrors === null) {
|
|
7136
|
-
vErrors = [
|
|
7173
|
+
vErrors = [err12];
|
|
7137
7174
|
} else {
|
|
7138
|
-
vErrors.push(
|
|
7175
|
+
vErrors.push(err12);
|
|
7139
7176
|
}
|
|
7140
7177
|
errors++;
|
|
7141
7178
|
}
|
|
7142
7179
|
}
|
|
7143
7180
|
if (data.time !== void 0) {
|
|
7144
|
-
let
|
|
7145
|
-
if (
|
|
7146
|
-
if (
|
|
7147
|
-
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'" };
|
|
7148
7185
|
if (vErrors === null) {
|
|
7149
|
-
vErrors = [
|
|
7186
|
+
vErrors = [err13];
|
|
7150
7187
|
} else {
|
|
7151
|
-
vErrors.push(
|
|
7188
|
+
vErrors.push(err13);
|
|
7152
7189
|
}
|
|
7153
7190
|
errors++;
|
|
7154
7191
|
}
|
|
7155
|
-
if (
|
|
7156
|
-
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'" };
|
|
7157
7194
|
if (vErrors === null) {
|
|
7158
|
-
vErrors = [
|
|
7195
|
+
vErrors = [err14];
|
|
7159
7196
|
} else {
|
|
7160
|
-
vErrors.push(
|
|
7197
|
+
vErrors.push(err14);
|
|
7161
7198
|
}
|
|
7162
7199
|
errors++;
|
|
7163
7200
|
}
|
|
7164
|
-
if (
|
|
7165
|
-
if (typeof
|
|
7166
|
-
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" };
|
|
7167
7204
|
if (vErrors === null) {
|
|
7168
|
-
vErrors = [
|
|
7205
|
+
vErrors = [err15];
|
|
7169
7206
|
} else {
|
|
7170
|
-
vErrors.push(
|
|
7207
|
+
vErrors.push(err15);
|
|
7171
7208
|
}
|
|
7172
7209
|
errors++;
|
|
7173
7210
|
}
|
|
7174
7211
|
}
|
|
7175
|
-
if (
|
|
7176
|
-
if (typeof
|
|
7177
|
-
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" };
|
|
7178
7215
|
if (vErrors === null) {
|
|
7179
|
-
vErrors = [
|
|
7216
|
+
vErrors = [err16];
|
|
7180
7217
|
} else {
|
|
7181
|
-
vErrors.push(
|
|
7218
|
+
vErrors.push(err16);
|
|
7182
7219
|
}
|
|
7183
7220
|
errors++;
|
|
7184
7221
|
}
|
|
7185
7222
|
}
|
|
7186
7223
|
} else {
|
|
7187
|
-
const
|
|
7224
|
+
const err17 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7188
7225
|
if (vErrors === null) {
|
|
7189
|
-
vErrors = [
|
|
7226
|
+
vErrors = [err17];
|
|
7190
7227
|
} else {
|
|
7191
|
-
vErrors.push(
|
|
7228
|
+
vErrors.push(err17);
|
|
7192
7229
|
}
|
|
7193
7230
|
errors++;
|
|
7194
7231
|
}
|
|
7195
7232
|
}
|
|
7196
7233
|
if (data.timezone !== void 0) {
|
|
7197
7234
|
if (typeof data.timezone !== "string") {
|
|
7198
|
-
const
|
|
7235
|
+
const err18 = { instancePath: instancePath + "/timezone", schemaPath: "#/properties/timezone/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7199
7236
|
if (vErrors === null) {
|
|
7200
|
-
vErrors = [
|
|
7237
|
+
vErrors = [err18];
|
|
7201
7238
|
} else {
|
|
7202
|
-
vErrors.push(
|
|
7239
|
+
vErrors.push(err18);
|
|
7203
7240
|
}
|
|
7204
7241
|
errors++;
|
|
7205
7242
|
}
|
|
7206
7243
|
}
|
|
7207
7244
|
if (data.refresh !== void 0) {
|
|
7208
|
-
let
|
|
7209
|
-
const
|
|
7210
|
-
let
|
|
7211
|
-
const
|
|
7212
|
-
if (typeof
|
|
7213
|
-
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" };
|
|
7214
7251
|
if (vErrors === null) {
|
|
7215
|
-
vErrors = [
|
|
7252
|
+
vErrors = [err19];
|
|
7216
7253
|
} else {
|
|
7217
|
-
vErrors.push(
|
|
7254
|
+
vErrors.push(err19);
|
|
7218
7255
|
}
|
|
7219
7256
|
errors++;
|
|
7220
7257
|
}
|
|
7221
|
-
var _valid0 =
|
|
7222
|
-
|
|
7223
|
-
if (!
|
|
7224
|
-
const
|
|
7225
|
-
if (typeof
|
|
7226
|
-
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" };
|
|
7227
7264
|
if (vErrors === null) {
|
|
7228
|
-
vErrors = [
|
|
7265
|
+
vErrors = [err20];
|
|
7229
7266
|
} else {
|
|
7230
|
-
vErrors.push(
|
|
7267
|
+
vErrors.push(err20);
|
|
7231
7268
|
}
|
|
7232
7269
|
errors++;
|
|
7233
7270
|
}
|
|
7234
|
-
if (false !==
|
|
7235
|
-
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" };
|
|
7236
7273
|
if (vErrors === null) {
|
|
7237
|
-
vErrors = [
|
|
7274
|
+
vErrors = [err21];
|
|
7238
7275
|
} else {
|
|
7239
|
-
vErrors.push(
|
|
7276
|
+
vErrors.push(err21);
|
|
7240
7277
|
}
|
|
7241
7278
|
errors++;
|
|
7242
7279
|
}
|
|
7243
|
-
var _valid0 =
|
|
7244
|
-
|
|
7280
|
+
var _valid0 = _errs34 === errors;
|
|
7281
|
+
valid10 = valid10 || _valid0;
|
|
7245
7282
|
}
|
|
7246
|
-
if (!
|
|
7247
|
-
const
|
|
7283
|
+
if (!valid10) {
|
|
7284
|
+
const err22 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
7248
7285
|
if (vErrors === null) {
|
|
7249
|
-
vErrors = [
|
|
7286
|
+
vErrors = [err22];
|
|
7250
7287
|
} else {
|
|
7251
|
-
vErrors.push(
|
|
7288
|
+
vErrors.push(err22);
|
|
7252
7289
|
}
|
|
7253
7290
|
errors++;
|
|
7254
7291
|
} else {
|
|
7255
|
-
errors =
|
|
7292
|
+
errors = _errs31;
|
|
7256
7293
|
if (vErrors !== null) {
|
|
7257
|
-
if (
|
|
7258
|
-
vErrors.length =
|
|
7294
|
+
if (_errs31) {
|
|
7295
|
+
vErrors.length = _errs31;
|
|
7259
7296
|
} else {
|
|
7260
7297
|
vErrors = null;
|
|
7261
7298
|
}
|
|
@@ -7263,89 +7300,89 @@ function validate37(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7263
7300
|
}
|
|
7264
7301
|
}
|
|
7265
7302
|
if (data.__inputs !== void 0) {
|
|
7266
|
-
let
|
|
7267
|
-
if (Array.isArray(
|
|
7268
|
-
const len3 =
|
|
7303
|
+
let data16 = data.__inputs;
|
|
7304
|
+
if (Array.isArray(data16)) {
|
|
7305
|
+
const len3 = data16.length;
|
|
7269
7306
|
for (let i3 = 0; i3 < len3; i3++) {
|
|
7270
|
-
let
|
|
7271
|
-
if (
|
|
7272
|
-
if (
|
|
7273
|
-
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'" };
|
|
7274
7311
|
if (vErrors === null) {
|
|
7275
|
-
vErrors = [
|
|
7312
|
+
vErrors = [err23];
|
|
7276
7313
|
} else {
|
|
7277
|
-
vErrors.push(
|
|
7314
|
+
vErrors.push(err23);
|
|
7278
7315
|
}
|
|
7279
7316
|
errors++;
|
|
7280
7317
|
}
|
|
7281
|
-
if (
|
|
7282
|
-
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'" };
|
|
7283
7320
|
if (vErrors === null) {
|
|
7284
|
-
vErrors = [
|
|
7321
|
+
vErrors = [err24];
|
|
7285
7322
|
} else {
|
|
7286
|
-
vErrors.push(
|
|
7323
|
+
vErrors.push(err24);
|
|
7287
7324
|
}
|
|
7288
7325
|
errors++;
|
|
7289
7326
|
}
|
|
7290
|
-
if (
|
|
7291
|
-
if (typeof
|
|
7292
|
-
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" };
|
|
7293
7330
|
if (vErrors === null) {
|
|
7294
|
-
vErrors = [
|
|
7331
|
+
vErrors = [err25];
|
|
7295
7332
|
} else {
|
|
7296
|
-
vErrors.push(
|
|
7333
|
+
vErrors.push(err25);
|
|
7297
7334
|
}
|
|
7298
7335
|
errors++;
|
|
7299
7336
|
}
|
|
7300
7337
|
}
|
|
7301
|
-
if (
|
|
7302
|
-
if (typeof
|
|
7303
|
-
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" };
|
|
7304
7341
|
if (vErrors === null) {
|
|
7305
|
-
vErrors = [
|
|
7342
|
+
vErrors = [err26];
|
|
7306
7343
|
} else {
|
|
7307
|
-
vErrors.push(
|
|
7344
|
+
vErrors.push(err26);
|
|
7308
7345
|
}
|
|
7309
7346
|
errors++;
|
|
7310
7347
|
}
|
|
7311
7348
|
}
|
|
7312
|
-
if (
|
|
7313
|
-
if (typeof
|
|
7314
|
-
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" };
|
|
7315
7352
|
if (vErrors === null) {
|
|
7316
|
-
vErrors = [
|
|
7353
|
+
vErrors = [err27];
|
|
7317
7354
|
} else {
|
|
7318
|
-
vErrors.push(
|
|
7355
|
+
vErrors.push(err27);
|
|
7319
7356
|
}
|
|
7320
7357
|
errors++;
|
|
7321
7358
|
}
|
|
7322
7359
|
}
|
|
7323
7360
|
} else {
|
|
7324
|
-
const
|
|
7361
|
+
const err28 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7325
7362
|
if (vErrors === null) {
|
|
7326
|
-
vErrors = [
|
|
7363
|
+
vErrors = [err28];
|
|
7327
7364
|
} else {
|
|
7328
|
-
vErrors.push(
|
|
7365
|
+
vErrors.push(err28);
|
|
7329
7366
|
}
|
|
7330
7367
|
errors++;
|
|
7331
7368
|
}
|
|
7332
7369
|
}
|
|
7333
7370
|
} else {
|
|
7334
|
-
const
|
|
7371
|
+
const err29 = { instancePath: instancePath + "/__inputs", schemaPath: "#/properties/__inputs/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7335
7372
|
if (vErrors === null) {
|
|
7336
|
-
vErrors = [
|
|
7373
|
+
vErrors = [err29];
|
|
7337
7374
|
} else {
|
|
7338
|
-
vErrors.push(
|
|
7375
|
+
vErrors.push(err29);
|
|
7339
7376
|
}
|
|
7340
7377
|
errors++;
|
|
7341
7378
|
}
|
|
7342
7379
|
}
|
|
7343
7380
|
} else {
|
|
7344
|
-
const
|
|
7381
|
+
const err30 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7345
7382
|
if (vErrors === null) {
|
|
7346
|
-
vErrors = [
|
|
7383
|
+
vErrors = [err30];
|
|
7347
7384
|
} else {
|
|
7348
|
-
vErrors.push(
|
|
7385
|
+
vErrors.push(err30);
|
|
7349
7386
|
}
|
|
7350
7387
|
errors++;
|
|
7351
7388
|
}
|
|
@@ -7579,9 +7616,10 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7579
7616
|
}
|
|
7580
7617
|
errors++;
|
|
7581
7618
|
}
|
|
7582
|
-
if (data.
|
|
7583
|
-
|
|
7584
|
-
|
|
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" };
|
|
7585
7623
|
if (vErrors === null) {
|
|
7586
7624
|
vErrors = [err2];
|
|
7587
7625
|
} else {
|
|
@@ -7589,232 +7627,252 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7589
7627
|
}
|
|
7590
7628
|
errors++;
|
|
7591
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
|
+
}
|
|
7592
7650
|
}
|
|
7593
7651
|
if (data.title !== void 0) {
|
|
7594
7652
|
if (typeof data.title !== "string") {
|
|
7595
|
-
const
|
|
7653
|
+
const err5 = { instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7596
7654
|
if (vErrors === null) {
|
|
7597
|
-
vErrors = [
|
|
7655
|
+
vErrors = [err5];
|
|
7598
7656
|
} else {
|
|
7599
|
-
vErrors.push(
|
|
7657
|
+
vErrors.push(err5);
|
|
7600
7658
|
}
|
|
7601
7659
|
errors++;
|
|
7602
7660
|
}
|
|
7603
7661
|
}
|
|
7604
7662
|
if (data.description !== void 0) {
|
|
7605
7663
|
if (typeof data.description !== "string") {
|
|
7606
|
-
const
|
|
7664
|
+
const err6 = { instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7607
7665
|
if (vErrors === null) {
|
|
7608
|
-
vErrors = [
|
|
7666
|
+
vErrors = [err6];
|
|
7609
7667
|
} else {
|
|
7610
|
-
vErrors.push(
|
|
7668
|
+
vErrors.push(err6);
|
|
7611
7669
|
}
|
|
7612
7670
|
errors++;
|
|
7613
7671
|
}
|
|
7614
7672
|
}
|
|
7615
7673
|
if (data.tags !== void 0) {
|
|
7616
|
-
let
|
|
7617
|
-
if (Array.isArray(
|
|
7618
|
-
const len0 =
|
|
7674
|
+
let data4 = data.tags;
|
|
7675
|
+
if (Array.isArray(data4)) {
|
|
7676
|
+
const len0 = data4.length;
|
|
7619
7677
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
7620
|
-
if (typeof
|
|
7621
|
-
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" };
|
|
7622
7680
|
if (vErrors === null) {
|
|
7623
|
-
vErrors = [
|
|
7681
|
+
vErrors = [err7];
|
|
7624
7682
|
} else {
|
|
7625
|
-
vErrors.push(
|
|
7683
|
+
vErrors.push(err7);
|
|
7626
7684
|
}
|
|
7627
7685
|
errors++;
|
|
7628
7686
|
}
|
|
7629
7687
|
}
|
|
7630
7688
|
} else {
|
|
7631
|
-
const
|
|
7689
|
+
const err8 = { instancePath: instancePath + "/tags", schemaPath: "#/properties/tags/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7632
7690
|
if (vErrors === null) {
|
|
7633
|
-
vErrors = [
|
|
7691
|
+
vErrors = [err8];
|
|
7634
7692
|
} else {
|
|
7635
|
-
vErrors.push(
|
|
7693
|
+
vErrors.push(err8);
|
|
7636
7694
|
}
|
|
7637
7695
|
errors++;
|
|
7638
7696
|
}
|
|
7639
7697
|
}
|
|
7640
7698
|
if (data.panels !== void 0) {
|
|
7641
|
-
let
|
|
7642
|
-
if (Array.isArray(
|
|
7643
|
-
const len1 =
|
|
7699
|
+
let data6 = data.panels;
|
|
7700
|
+
if (Array.isArray(data6)) {
|
|
7701
|
+
const len1 = data6.length;
|
|
7644
7702
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
7645
|
-
if (!validate18(
|
|
7703
|
+
if (!validate18(data6[i1], { instancePath: instancePath + "/panels/" + i1, parentData: data6, parentDataProperty: i1, rootData })) {
|
|
7646
7704
|
vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);
|
|
7647
7705
|
errors = vErrors.length;
|
|
7648
7706
|
}
|
|
7649
7707
|
}
|
|
7650
7708
|
} else {
|
|
7651
|
-
const
|
|
7709
|
+
const err9 = { instancePath: instancePath + "/panels", schemaPath: "#/properties/panels/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7652
7710
|
if (vErrors === null) {
|
|
7653
|
-
vErrors = [
|
|
7711
|
+
vErrors = [err9];
|
|
7654
7712
|
} else {
|
|
7655
|
-
vErrors.push(
|
|
7713
|
+
vErrors.push(err9);
|
|
7656
7714
|
}
|
|
7657
7715
|
errors++;
|
|
7658
7716
|
}
|
|
7659
7717
|
}
|
|
7660
7718
|
if (data.templating !== void 0) {
|
|
7661
|
-
let
|
|
7662
|
-
if (
|
|
7663
|
-
if (
|
|
7664
|
-
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'" };
|
|
7665
7723
|
if (vErrors === null) {
|
|
7666
|
-
vErrors = [
|
|
7724
|
+
vErrors = [err10];
|
|
7667
7725
|
} else {
|
|
7668
|
-
vErrors.push(
|
|
7726
|
+
vErrors.push(err10);
|
|
7669
7727
|
}
|
|
7670
7728
|
errors++;
|
|
7671
7729
|
}
|
|
7672
|
-
if (
|
|
7673
|
-
let
|
|
7674
|
-
if (Array.isArray(
|
|
7675
|
-
const len2 =
|
|
7730
|
+
if (data8.list !== void 0) {
|
|
7731
|
+
let data9 = data8.list;
|
|
7732
|
+
if (Array.isArray(data9)) {
|
|
7733
|
+
const len2 = data9.length;
|
|
7676
7734
|
for (let i2 = 0; i2 < len2; i2++) {
|
|
7677
|
-
if (!validate33(
|
|
7735
|
+
if (!validate33(data9[i2], { instancePath: instancePath + "/templating/list/" + i2, parentData: data9, parentDataProperty: i2, rootData })) {
|
|
7678
7736
|
vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
|
|
7679
7737
|
errors = vErrors.length;
|
|
7680
7738
|
}
|
|
7681
7739
|
}
|
|
7682
7740
|
} else {
|
|
7683
|
-
const
|
|
7741
|
+
const err11 = { instancePath: instancePath + "/templating/list", schemaPath: "#/properties/templating/properties/list/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7684
7742
|
if (vErrors === null) {
|
|
7685
|
-
vErrors = [
|
|
7743
|
+
vErrors = [err11];
|
|
7686
7744
|
} else {
|
|
7687
|
-
vErrors.push(
|
|
7745
|
+
vErrors.push(err11);
|
|
7688
7746
|
}
|
|
7689
7747
|
errors++;
|
|
7690
7748
|
}
|
|
7691
7749
|
}
|
|
7692
7750
|
} else {
|
|
7693
|
-
const
|
|
7751
|
+
const err12 = { instancePath: instancePath + "/templating", schemaPath: "#/properties/templating/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7694
7752
|
if (vErrors === null) {
|
|
7695
|
-
vErrors = [
|
|
7753
|
+
vErrors = [err12];
|
|
7696
7754
|
} else {
|
|
7697
|
-
vErrors.push(
|
|
7755
|
+
vErrors.push(err12);
|
|
7698
7756
|
}
|
|
7699
7757
|
errors++;
|
|
7700
7758
|
}
|
|
7701
7759
|
}
|
|
7702
7760
|
if (data.time !== void 0) {
|
|
7703
|
-
let
|
|
7704
|
-
if (
|
|
7705
|
-
if (
|
|
7706
|
-
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'" };
|
|
7707
7765
|
if (vErrors === null) {
|
|
7708
|
-
vErrors = [
|
|
7766
|
+
vErrors = [err13];
|
|
7709
7767
|
} else {
|
|
7710
|
-
vErrors.push(
|
|
7768
|
+
vErrors.push(err13);
|
|
7711
7769
|
}
|
|
7712
7770
|
errors++;
|
|
7713
7771
|
}
|
|
7714
|
-
if (
|
|
7715
|
-
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'" };
|
|
7716
7774
|
if (vErrors === null) {
|
|
7717
|
-
vErrors = [
|
|
7775
|
+
vErrors = [err14];
|
|
7718
7776
|
} else {
|
|
7719
|
-
vErrors.push(
|
|
7777
|
+
vErrors.push(err14);
|
|
7720
7778
|
}
|
|
7721
7779
|
errors++;
|
|
7722
7780
|
}
|
|
7723
|
-
if (
|
|
7724
|
-
if (typeof
|
|
7725
|
-
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" };
|
|
7726
7784
|
if (vErrors === null) {
|
|
7727
|
-
vErrors = [
|
|
7785
|
+
vErrors = [err15];
|
|
7728
7786
|
} else {
|
|
7729
|
-
vErrors.push(
|
|
7787
|
+
vErrors.push(err15);
|
|
7730
7788
|
}
|
|
7731
7789
|
errors++;
|
|
7732
7790
|
}
|
|
7733
7791
|
}
|
|
7734
|
-
if (
|
|
7735
|
-
if (typeof
|
|
7736
|
-
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" };
|
|
7737
7795
|
if (vErrors === null) {
|
|
7738
|
-
vErrors = [
|
|
7796
|
+
vErrors = [err16];
|
|
7739
7797
|
} else {
|
|
7740
|
-
vErrors.push(
|
|
7798
|
+
vErrors.push(err16);
|
|
7741
7799
|
}
|
|
7742
7800
|
errors++;
|
|
7743
7801
|
}
|
|
7744
7802
|
}
|
|
7745
7803
|
} else {
|
|
7746
|
-
const
|
|
7804
|
+
const err17 = { instancePath: instancePath + "/time", schemaPath: "#/properties/time/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7747
7805
|
if (vErrors === null) {
|
|
7748
|
-
vErrors = [
|
|
7806
|
+
vErrors = [err17];
|
|
7749
7807
|
} else {
|
|
7750
|
-
vErrors.push(
|
|
7808
|
+
vErrors.push(err17);
|
|
7751
7809
|
}
|
|
7752
7810
|
errors++;
|
|
7753
7811
|
}
|
|
7754
7812
|
}
|
|
7755
7813
|
if (data.timezone !== void 0) {
|
|
7756
7814
|
if (typeof data.timezone !== "string") {
|
|
7757
|
-
const
|
|
7815
|
+
const err18 = { instancePath: instancePath + "/timezone", schemaPath: "#/properties/timezone/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
7758
7816
|
if (vErrors === null) {
|
|
7759
|
-
vErrors = [
|
|
7817
|
+
vErrors = [err18];
|
|
7760
7818
|
} else {
|
|
7761
|
-
vErrors.push(
|
|
7819
|
+
vErrors.push(err18);
|
|
7762
7820
|
}
|
|
7763
7821
|
errors++;
|
|
7764
7822
|
}
|
|
7765
7823
|
}
|
|
7766
7824
|
if (data.refresh !== void 0) {
|
|
7767
|
-
let
|
|
7768
|
-
const
|
|
7769
|
-
let
|
|
7770
|
-
const
|
|
7771
|
-
if (typeof
|
|
7772
|
-
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" };
|
|
7773
7831
|
if (vErrors === null) {
|
|
7774
|
-
vErrors = [
|
|
7832
|
+
vErrors = [err19];
|
|
7775
7833
|
} else {
|
|
7776
|
-
vErrors.push(
|
|
7834
|
+
vErrors.push(err19);
|
|
7777
7835
|
}
|
|
7778
7836
|
errors++;
|
|
7779
7837
|
}
|
|
7780
|
-
var _valid0 =
|
|
7781
|
-
|
|
7782
|
-
if (!
|
|
7783
|
-
const
|
|
7784
|
-
if (typeof
|
|
7785
|
-
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" };
|
|
7786
7844
|
if (vErrors === null) {
|
|
7787
|
-
vErrors = [
|
|
7845
|
+
vErrors = [err20];
|
|
7788
7846
|
} else {
|
|
7789
|
-
vErrors.push(
|
|
7847
|
+
vErrors.push(err20);
|
|
7790
7848
|
}
|
|
7791
7849
|
errors++;
|
|
7792
7850
|
}
|
|
7793
|
-
if (false !==
|
|
7794
|
-
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" };
|
|
7795
7853
|
if (vErrors === null) {
|
|
7796
|
-
vErrors = [
|
|
7854
|
+
vErrors = [err21];
|
|
7797
7855
|
} else {
|
|
7798
|
-
vErrors.push(
|
|
7856
|
+
vErrors.push(err21);
|
|
7799
7857
|
}
|
|
7800
7858
|
errors++;
|
|
7801
7859
|
}
|
|
7802
|
-
var _valid0 =
|
|
7803
|
-
|
|
7860
|
+
var _valid0 = _errs34 === errors;
|
|
7861
|
+
valid10 = valid10 || _valid0;
|
|
7804
7862
|
}
|
|
7805
|
-
if (!
|
|
7806
|
-
const
|
|
7863
|
+
if (!valid10) {
|
|
7864
|
+
const err22 = { instancePath: instancePath + "/refresh", schemaPath: "#/properties/refresh/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
7807
7865
|
if (vErrors === null) {
|
|
7808
|
-
vErrors = [
|
|
7866
|
+
vErrors = [err22];
|
|
7809
7867
|
} else {
|
|
7810
|
-
vErrors.push(
|
|
7868
|
+
vErrors.push(err22);
|
|
7811
7869
|
}
|
|
7812
7870
|
errors++;
|
|
7813
7871
|
} else {
|
|
7814
|
-
errors =
|
|
7872
|
+
errors = _errs31;
|
|
7815
7873
|
if (vErrors !== null) {
|
|
7816
|
-
if (
|
|
7817
|
-
vErrors.length =
|
|
7874
|
+
if (_errs31) {
|
|
7875
|
+
vErrors.length = _errs31;
|
|
7818
7876
|
} else {
|
|
7819
7877
|
vErrors = null;
|
|
7820
7878
|
}
|
|
@@ -7822,89 +7880,89 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
7822
7880
|
}
|
|
7823
7881
|
}
|
|
7824
7882
|
if (data.__inputs !== void 0) {
|
|
7825
|
-
let
|
|
7826
|
-
if (Array.isArray(
|
|
7827
|
-
const len3 =
|
|
7883
|
+
let data16 = data.__inputs;
|
|
7884
|
+
if (Array.isArray(data16)) {
|
|
7885
|
+
const len3 = data16.length;
|
|
7828
7886
|
for (let i3 = 0; i3 < len3; i3++) {
|
|
7829
|
-
let
|
|
7830
|
-
if (
|
|
7831
|
-
if (
|
|
7832
|
-
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'" };
|
|
7833
7891
|
if (vErrors === null) {
|
|
7834
|
-
vErrors = [
|
|
7892
|
+
vErrors = [err23];
|
|
7835
7893
|
} else {
|
|
7836
|
-
vErrors.push(
|
|
7894
|
+
vErrors.push(err23);
|
|
7837
7895
|
}
|
|
7838
7896
|
errors++;
|
|
7839
7897
|
}
|
|
7840
|
-
if (
|
|
7841
|
-
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'" };
|
|
7842
7900
|
if (vErrors === null) {
|
|
7843
|
-
vErrors = [
|
|
7901
|
+
vErrors = [err24];
|
|
7844
7902
|
} else {
|
|
7845
|
-
vErrors.push(
|
|
7903
|
+
vErrors.push(err24);
|
|
7846
7904
|
}
|
|
7847
7905
|
errors++;
|
|
7848
7906
|
}
|
|
7849
|
-
if (
|
|
7850
|
-
if (typeof
|
|
7851
|
-
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" };
|
|
7852
7910
|
if (vErrors === null) {
|
|
7853
|
-
vErrors = [
|
|
7911
|
+
vErrors = [err25];
|
|
7854
7912
|
} else {
|
|
7855
|
-
vErrors.push(
|
|
7913
|
+
vErrors.push(err25);
|
|
7856
7914
|
}
|
|
7857
7915
|
errors++;
|
|
7858
7916
|
}
|
|
7859
7917
|
}
|
|
7860
|
-
if (
|
|
7861
|
-
if (typeof
|
|
7862
|
-
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" };
|
|
7863
7921
|
if (vErrors === null) {
|
|
7864
|
-
vErrors = [
|
|
7922
|
+
vErrors = [err26];
|
|
7865
7923
|
} else {
|
|
7866
|
-
vErrors.push(
|
|
7924
|
+
vErrors.push(err26);
|
|
7867
7925
|
}
|
|
7868
7926
|
errors++;
|
|
7869
7927
|
}
|
|
7870
7928
|
}
|
|
7871
|
-
if (
|
|
7872
|
-
if (typeof
|
|
7873
|
-
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" };
|
|
7874
7932
|
if (vErrors === null) {
|
|
7875
|
-
vErrors = [
|
|
7933
|
+
vErrors = [err27];
|
|
7876
7934
|
} else {
|
|
7877
|
-
vErrors.push(
|
|
7935
|
+
vErrors.push(err27);
|
|
7878
7936
|
}
|
|
7879
7937
|
errors++;
|
|
7880
7938
|
}
|
|
7881
7939
|
}
|
|
7882
7940
|
} else {
|
|
7883
|
-
const
|
|
7941
|
+
const err28 = { instancePath: instancePath + "/__inputs/" + i3, schemaPath: "#/properties/__inputs/items/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7884
7942
|
if (vErrors === null) {
|
|
7885
|
-
vErrors = [
|
|
7943
|
+
vErrors = [err28];
|
|
7886
7944
|
} else {
|
|
7887
|
-
vErrors.push(
|
|
7945
|
+
vErrors.push(err28);
|
|
7888
7946
|
}
|
|
7889
7947
|
errors++;
|
|
7890
7948
|
}
|
|
7891
7949
|
}
|
|
7892
7950
|
} else {
|
|
7893
|
-
const
|
|
7951
|
+
const err29 = { instancePath: instancePath + "/__inputs", schemaPath: "#/properties/__inputs/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
7894
7952
|
if (vErrors === null) {
|
|
7895
|
-
vErrors = [
|
|
7953
|
+
vErrors = [err29];
|
|
7896
7954
|
} else {
|
|
7897
|
-
vErrors.push(
|
|
7955
|
+
vErrors.push(err29);
|
|
7898
7956
|
}
|
|
7899
7957
|
errors++;
|
|
7900
7958
|
}
|
|
7901
7959
|
}
|
|
7902
7960
|
} else {
|
|
7903
|
-
const
|
|
7961
|
+
const err30 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
7904
7962
|
if (vErrors === null) {
|
|
7905
|
-
vErrors = [
|
|
7963
|
+
vErrors = [err30];
|
|
7906
7964
|
} else {
|
|
7907
|
-
vErrors.push(
|
|
7965
|
+
vErrors.push(err30);
|
|
7908
7966
|
}
|
|
7909
7967
|
errors++;
|
|
7910
7968
|
}
|
|
@@ -8636,6 +8694,8 @@ function validateBundle(bundle, file = "manifest") {
|
|
|
8636
8694
|
const doc = bundle.documents[ref.id];
|
|
8637
8695
|
if (!doc && ref.id in bundle.manifest.documents) continue;
|
|
8638
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}` });
|
|
8639
8699
|
else if (ref.kind === "form" && !inputPanels(doc).length)
|
|
8640
8700
|
issues.push({ severity: "warning", path: `${file}: ${ref.path}`, message: `"${ref.id}" has no input-* panels to fill in` });
|
|
8641
8701
|
}
|
|
@@ -10695,9 +10755,11 @@ function newPanel(type, metric = "value") {
|
|
|
10695
10755
|
}
|
|
10696
10756
|
function newDocument(kind, title) {
|
|
10697
10757
|
const doc = kind === "form" ? {
|
|
10758
|
+
kind,
|
|
10698
10759
|
title,
|
|
10699
10760
|
panels: [{ id: 1, type: "input-number", title: "Value", gridPos: { x: 0, y: 0, w: 24, h: 3 }, options: { metric: "value", step: 1 } }]
|
|
10700
10761
|
} : {
|
|
10762
|
+
kind,
|
|
10701
10763
|
title,
|
|
10702
10764
|
time: { from: "now-30d", to: "now" },
|
|
10703
10765
|
panels: [
|
|
@@ -11378,7 +11440,7 @@ function tabsShowing(tabs, ids) {
|
|
|
11378
11440
|
});
|
|
11379
11441
|
}
|
|
11380
11442
|
function makeTemplate(manifest, documents, ids, meta) {
|
|
11381
|
-
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]) }));
|
|
11382
11444
|
return {
|
|
11383
11445
|
$modelform: "template",
|
|
11384
11446
|
version: TEMPLATE_VERSION,
|
|
@@ -11409,6 +11471,7 @@ function parseTemplate(text) {
|
|
|
11409
11471
|
seen.add(d.id);
|
|
11410
11472
|
const { dashboard, issues } = prepareDashboard(d.dashboard, d.id);
|
|
11411
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}` };
|
|
11412
11475
|
documents.push({ kind: d.kind, id: d.id, dashboard });
|
|
11413
11476
|
}
|
|
11414
11477
|
const tabs = Array.isArray(json.tabs) ? json.tabs.filter((t) => isObject5(t) && typeof t.id === "string" && typeof t.title === "string" && isObject5(t.screen)) : [];
|
|
@@ -11474,7 +11537,8 @@ function applyTemplate(manifestText, paths, template, options = {}) {
|
|
|
11474
11537
|
taken.add(id);
|
|
11475
11538
|
files.add(path);
|
|
11476
11539
|
ids[doc.id] = id;
|
|
11477
|
-
const
|
|
11540
|
+
const { kind: _kind, ...rest } = doc.dashboard;
|
|
11541
|
+
const dashboard = { kind: doc.kind, ...rest, ...options.metrics && { panels: renameMetrics(doc.dashboard.panels ?? [], options.metrics) } };
|
|
11478
11542
|
out[path] = JSON.stringify(dashboard, null, 2) + "\n";
|
|
11479
11543
|
if (manifest.documents) edits.push({ path: ["documents", id], value: path });
|
|
11480
11544
|
else {
|
|
@@ -11573,6 +11637,7 @@ export {
|
|
|
11573
11637
|
GROUP_FIELD_TYPES,
|
|
11574
11638
|
groupFields,
|
|
11575
11639
|
inputPanels,
|
|
11640
|
+
documentKind,
|
|
11576
11641
|
inputGroups,
|
|
11577
11642
|
plainInputPanels,
|
|
11578
11643
|
parseClockDigits,
|