@grafana/plugin-ui 0.16.0-dsconfig.d7f2506 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +15500 -11375
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +599 -930
- package/dist/esm/components/ConfigEditor/Auth/tls/TLSClientAuth.js +8 -5
- package/dist/esm/components/ConfigEditor/Auth/tls/TLSClientAuth.js.map +1 -1
- package/dist/esm/index.d.ts +599 -930
- package/dist/esm/index.js +2 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/node_modules/semver/classes/range.js +4 -24
- package/dist/esm/node_modules/semver/classes/range.js.map +1 -1
- package/dist/esm/node_modules/semver/classes/semver.js +2 -19
- package/dist/esm/node_modules/semver/classes/semver.js.map +1 -1
- package/dist/esm/node_modules/semver/functions/diff.js +1 -1
- package/dist/esm/node_modules/semver/functions/diff.js.map +1 -1
- package/dist/esm/node_modules/semver/index.js +0 -3
- package/dist/esm/node_modules/semver/index.js.map +1 -1
- package/dist/esm/node_modules/semver/internal/re.js +3 -3
- package/dist/esm/node_modules/semver/internal/re.js.map +1 -1
- package/dist/esm/node_modules/semver/ranges/subset.js +3 -3
- package/dist/esm/node_modules/semver/ranges/subset.js.map +1 -1
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/esm/schema/registry/alertmanager.schema.json.js +77 -0
- package/dist/esm/schema/registry/alertmanager.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/cloudwatch.schema.json.js +384 -0
- package/dist/esm/schema/registry/cloudwatch.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/elasticsearch.schema.json.js +287 -0
- package/dist/esm/schema/registry/elasticsearch.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-amazonprometheus-datasource.schema.json.js +166 -0
- package/dist/esm/schema/registry/grafana-amazonprometheus-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-appdynamics-datasource.schema.json.js +145 -0
- package/dist/esm/schema/registry/grafana-appdynamics-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-astradb-datasource.schema.json.js +123 -0
- package/dist/esm/schema/registry/grafana-astradb-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-athena-datasource.schema.json.js +158 -0
- package/dist/esm/schema/registry/grafana-athena-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-azure-data-explorer-datasource.schema.json.js +204 -0
- package/dist/esm/schema/registry/grafana-azure-data-explorer-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-azure-monitor-datasource.schema.json.js +294 -0
- package/dist/esm/schema/registry/grafana-azure-monitor-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-azuredevops-datasource.schema.json.js +101 -0
- package/dist/esm/schema/registry/grafana-azuredevops-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-azureprometheus-datasource.schema.json.js +125 -0
- package/dist/esm/schema/registry/grafana-azureprometheus-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-bigquery-datasource.schema.json.js +508 -0
- package/dist/esm/schema/registry/grafana-bigquery-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-clickhouse-datasource.schema.json.js +1400 -0
- package/dist/esm/schema/registry/grafana-clickhouse-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-cockroachdb-datasource.schema.json.js +302 -0
- package/dist/esm/schema/registry/grafana-cockroachdb-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-databricks-datasource.schema.json.js +291 -0
- package/dist/esm/schema/registry/grafana-databricks-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-datadog-datasource.schema.json.js +155 -0
- package/dist/esm/schema/registry/grafana-datadog-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-dynatrace-datasource.schema.json.js +179 -0
- package/dist/esm/schema/registry/grafana-dynatrace-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-falconlogscale-datasource.schema.json.js +134 -0
- package/dist/esm/schema/registry/grafana-falconlogscale-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-github-datasource.schema.json.js +156 -0
- package/dist/esm/schema/registry/grafana-github-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-gitlab-datasource.schema.json.js +84 -0
- package/dist/esm/schema/registry/grafana-gitlab-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-googlesheets-datasource.schema.json.js +231 -0
- package/dist/esm/schema/registry/grafana-googlesheets-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-honeycomb-datasource.schema.json.js +87 -0
- package/dist/esm/schema/registry/grafana-honeycomb-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-iot-sitewise-datasource.schema.json.js +159 -0
- package/dist/esm/schema/registry/grafana-iot-sitewise-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-jira-datasource.schema.json.js +188 -0
- package/dist/esm/schema/registry/grafana-jira-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-looker-datasource.schema.json.js +82 -0
- package/dist/esm/schema/registry/grafana-looker-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-mongodb-datasource.schema.json.js +278 -0
- package/dist/esm/schema/registry/grafana-mongodb-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-mqtt-datasource.schema.json.js +168 -0
- package/dist/esm/schema/registry/grafana-mqtt-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-newrelic-datasource.schema.json.js +129 -0
- package/dist/esm/schema/registry/grafana-newrelic-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-odbc-datasource.schema.json.js +56 -0
- package/dist/esm/schema/registry/grafana-odbc-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-opensearch-datasource.schema.json.js +212 -0
- package/dist/esm/schema/registry/grafana-opensearch-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-oracle-datasource.schema.json.js +186 -0
- package/dist/esm/schema/registry/grafana-oracle-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-pagerduty-datasource.schema.json.js +85 -0
- package/dist/esm/schema/registry/grafana-pagerduty-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-postgresql-datasource.schema.json.js +411 -0
- package/dist/esm/schema/registry/grafana-postgresql-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-pyroscope-datasource.schema.json.js +41 -0
- package/dist/esm/schema/registry/grafana-pyroscope-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-redshift-datasource.schema.json.js +201 -0
- package/dist/esm/schema/registry/grafana-redshift-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-salesforce-datasource.schema.json.js +201 -0
- package/dist/esm/schema/registry/grafana-salesforce-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-saphana-datasource.schema.json.js +208 -0
- package/dist/esm/schema/registry/grafana-saphana-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-sentry-datasource.schema.json.js +94 -0
- package/dist/esm/schema/registry/grafana-sentry-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-servicenow-datasource.schema.json.js +179 -0
- package/dist/esm/schema/registry/grafana-servicenow-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-snowflake-datasource.schema.json.js +304 -0
- package/dist/esm/schema/registry/grafana-snowflake-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-splunk-datasource.schema.json.js +319 -0
- package/dist/esm/schema/registry/grafana-splunk-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-splunkobservability-datasource.schema.json.js +90 -0
- package/dist/esm/schema/registry/grafana-splunkobservability-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-strava-datasource.schema.json.js +74 -0
- package/dist/esm/schema/registry/grafana-strava-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-sumologic-datasource.schema.json.js +102 -0
- package/dist/esm/schema/registry/grafana-sumologic-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-surrealdb-datasource.schema.json.js +92 -0
- package/dist/esm/schema/registry/grafana-surrealdb-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-timestream-datasource.schema.json.js +145 -0
- package/dist/esm/schema/registry/grafana-timestream-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-wavefront-datasource.schema.json.js +80 -0
- package/dist/esm/schema/registry/grafana-wavefront-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-x-ray-datasource.schema.json.js +112 -0
- package/dist/esm/schema/registry/grafana-x-ray-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/grafana-yugabyte-datasource.schema.json.js +114 -0
- package/dist/esm/schema/registry/grafana-yugabyte-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/graphite.schema.json.js +104 -0
- package/dist/esm/schema/registry/graphite.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/index.js +27 -0
- package/dist/esm/schema/registry/index.js.map +1 -0
- package/dist/esm/schema/registry/influxdb.schema.json.js +717 -0
- package/dist/esm/schema/registry/influxdb.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/jaeger.schema.json.js +59 -0
- package/dist/esm/schema/registry/jaeger.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/loki.schema.json.js +545 -0
- package/dist/esm/schema/registry/loki.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/marcusolsson-csv-datasource.schema.json.js +45 -0
- package/dist/esm/schema/registry/marcusolsson-csv-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/marcusolsson-json-datasource.schema.json.js +36 -0
- package/dist/esm/schema/registry/marcusolsson-json-datasource.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/mssql.schema.json.js +292 -0
- package/dist/esm/schema/registry/mssql.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/mysql.schema.json.js +304 -0
- package/dist/esm/schema/registry/mysql.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/opentsdb.schema.json.js +113 -0
- package/dist/esm/schema/registry/opentsdb.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/prometheus.schema.json.js +783 -0
- package/dist/esm/schema/registry/prometheus.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/stackdriver.schema.json.js +224 -0
- package/dist/esm/schema/registry/stackdriver.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/staticRegistry.js +135 -0
- package/dist/esm/schema/registry/staticRegistry.js.map +1 -0
- package/dist/esm/schema/registry/tempo.schema.json.js +664 -0
- package/dist/esm/schema/registry/tempo.schema.json.js.map +1 -0
- package/dist/esm/schema/registry/zipkin.schema.json.js +40 -0
- package/dist/esm/schema/registry/zipkin.schema.json.js.map +1 -0
- package/package.json +2 -3
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/DatasourceConfigWizard.js +0 -217
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/DatasourceConfigWizard.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/DatasourceErrorBoundary.js +0 -27
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/DatasourceErrorBoundary.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/FieldInput.js +0 -135
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/FieldInput.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/SchemaField.js +0 -80
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/SchemaField.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/SidebarNav.js +0 -54
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/SidebarNav.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/TabLayout.js +0 -155
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/TabLayout.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/cel.js +0 -75
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/cel.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/config.js +0 -262
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/config.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/datasource.js +0 -354
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/datasource.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/fieldUtils.js +0 -138
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/fieldUtils.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/hooks/formInterpreter.js +0 -93
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/hooks/formInterpreter.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/hooks/useDatasourceConfigForm.js +0 -253
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/hooks/useDatasourceConfigForm.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/hooks/useHealthChecks.js +0 -106
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/hooks/useHealthChecks.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/AuthorizationHeaderField.js +0 -52
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/AuthorizationHeaderField.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/ComplexFieldNote.js +0 -26
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/ComplexFieldNote.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/FileUploadField.js +0 -106
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/FileUploadField.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/IndexedPairEditor.js +0 -124
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/IndexedPairEditor.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/ObjectArrayEditor.js +0 -190
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/ObjectArrayEditor.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/PdcFieldNote.js +0 -31
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/PdcFieldNote.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/PrimitiveInputs.js +0 -103
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/PrimitiveInputs.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/SecureFieldInput.js +0 -59
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/SecureFieldInput.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/StringArrayInput.js +0 -80
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/inputs/StringArrayInput.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/layoutParts.js +0 -82
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/layoutParts.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/resolvePluginName.js +0 -30
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/resolvePluginName.js.map +0 -1
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/styles.js +0 -340
- package/dist/esm/components/ConfigEditor/DatasourceConfigWizard/styles.js.map +0 -1
- package/dist/esm/node_modules/js-yaml/dist/js-yaml.js +0 -3043
- package/dist/esm/node_modules/js-yaml/dist/js-yaml.js.map +0 -1
- package/dist/esm/node_modules/react-hook-form/dist/index.esm.js +0 -2766
- package/dist/esm/node_modules/react-hook-form/dist/index.esm.js.map +0 -1
- package/dist/esm/node_modules/semver/functions/truncate.js +0 -62
- package/dist/esm/node_modules/semver/functions/truncate.js.map +0 -1
- package/dist/esm/schema/utils/constants.js +0 -5
- package/dist/esm/schema/utils/constants.js.map +0 -1
- package/dist/esm/schema/utils/dsconfig.js +0 -97
- package/dist/esm/schema/utils/dsconfig.js.map +0 -1
- package/dist/esm/schema/utils/llm.js +0 -54
- package/dist/esm/schema/utils/llm.js.map +0 -1
- package/dist/esm/schema/utils/packs.js +0 -113
- package/dist/esm/schema/utils/packs.js.map +0 -1
- package/dist/esm/schema/utils/provisioning.js +0 -434
- package/dist/esm/schema/utils/provisioning.js.map +0 -1
- package/dist/esm/schema/utils/registry.js +0 -32
- package/dist/esm/schema/utils/registry.js.map +0 -1
- package/dist/esm/schema/utils/useDatasourceSchema.js +0 -39
- package/dist/esm/schema/utils/useDatasourceSchema.js.map +0 -1
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ComponentProps, PureComponent, ReactElement, ReactNode,
|
|
1
|
+
import React, { ComponentProps, PureComponent, ReactElement, ReactNode, FunctionComponent, HTMLProps } from 'react';
|
|
2
2
|
import { Input, Segment as Segment$1, monacoTypes, Monaco, ButtonProps, Field, PopoverContent, Switch, SelectCommonProps, InlineLabel } from '@grafana/ui';
|
|
3
3
|
import { DataSourceInstanceSettings, SelectableValue, DataSourceJsonData, VariableSuggestion, TimeRange, DataFrame, MetricFindValue, ThemeSpacingTokens, ScopedVars, DataFrameView, VariableModel, QueryEditorProps as QueryEditorProps$1, DataSourceSettings, RegistryItem, DataSourceApi, Registry, DataQuery as DataQuery$1, PanelData, DataQueryRequest, DataQueryResponse, LoadingState } from '@grafana/data';
|
|
4
4
|
import { DataSourceSrv, DataSourceWithBackend, TemplateSrv } from '@grafana/runtime';
|
|
@@ -1014,1002 +1014,671 @@ type Props$a<C extends Config = Config> = {
|
|
|
1014
1014
|
};
|
|
1015
1015
|
declare const AdvancedHttpSettings: <C extends Config = Config>(props: Props$a<C>) => JSX.Element;
|
|
1016
1016
|
|
|
1017
|
-
interface
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
* Example: "v2"
|
|
1023
|
-
*/
|
|
1024
|
-
schemaVersion: string;
|
|
1025
|
-
/**
|
|
1026
|
-
* Unique datasource plugin identifier
|
|
1027
|
-
* Example: "prometheus"
|
|
1028
|
-
*/
|
|
1029
|
-
pluginType: string;
|
|
1030
|
-
/**
|
|
1031
|
-
* Human-readable name
|
|
1032
|
-
*/
|
|
1033
|
-
pluginName: string;
|
|
1034
|
-
/**
|
|
1035
|
-
* Optional documentation URL
|
|
1036
|
-
*/
|
|
1037
|
-
docURL?: string;
|
|
1038
|
-
/**
|
|
1039
|
-
* SDK field packs to merge into this schema before validation.
|
|
1040
|
-
* Pack fields are prepended to `fields` in declaration order.
|
|
1041
|
-
* Plugin-declared fields with a matching ID take precedence over pack fields.
|
|
1042
|
-
* Call `resolveBaseFields()` before consuming the schema.
|
|
1043
|
-
*/
|
|
1044
|
-
baseFields?: BaseFieldRef[];
|
|
1045
|
-
/**
|
|
1046
|
-
* Source of truth for configuration
|
|
1047
|
-
*/
|
|
1048
|
-
fields: ConfigField[];
|
|
1049
|
-
/**
|
|
1050
|
-
* Optional UI grouping
|
|
1051
|
-
*/
|
|
1052
|
-
groups?: ConfigGroup[];
|
|
1053
|
-
/**
|
|
1054
|
-
* Optional instructions rendered alongside the config form.
|
|
1055
|
-
*/
|
|
1056
|
-
instructions?: Instruction[];
|
|
1057
|
-
/**
|
|
1058
|
-
* Relationships between fields
|
|
1059
|
-
*/
|
|
1060
|
-
relationships?: FieldRelationship[];
|
|
1017
|
+
interface CustomHeader {
|
|
1018
|
+
id: string;
|
|
1019
|
+
name: string;
|
|
1020
|
+
value: string;
|
|
1021
|
+
configured: boolean;
|
|
1061
1022
|
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1023
|
+
type CustomHeaders = CustomHeader[];
|
|
1024
|
+
interface Props$9 {
|
|
1025
|
+
dataSourceConfig: DataSourceSettings<any, any>;
|
|
1026
|
+
onChange: (config: DataSourceSettings) => void;
|
|
1065
1027
|
}
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
* Convention: `<sdk_name>_settings`.
|
|
1069
|
-
*/
|
|
1070
|
-
type FieldPackID = 'plugin_sdk_settings' | 'aws_sdk_settings' | 'azure_sdk_settings' | 'google_sdk_settings' | 'sqleng_settings';
|
|
1071
|
-
/**
|
|
1072
|
-
* Declares a single field pack to compose into the schema.
|
|
1073
|
-
*/
|
|
1074
|
-
interface BaseFieldRef {
|
|
1075
|
-
/** Identifier of a built-in field pack. */
|
|
1076
|
-
from: FieldPackID;
|
|
1077
|
-
/**
|
|
1078
|
-
* Field IDs from the pack to omit entirely.
|
|
1079
|
-
* Each ID must exist in the pack (else resolution fails).
|
|
1080
|
-
*/
|
|
1081
|
-
exclude?: string[];
|
|
1082
|
-
/**
|
|
1083
|
-
* Presentation-only overrides keyed by pack field ID.
|
|
1084
|
-
* Structural properties (id, key, valueType, target, role) cannot be patched.
|
|
1085
|
-
*/
|
|
1086
|
-
patch?: Record<string, FieldPatch>;
|
|
1028
|
+
interface State {
|
|
1029
|
+
headers: CustomHeaders;
|
|
1087
1030
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
required?: boolean;
|
|
1098
|
-
/** When true, the field is dropped from the resolved schema. */
|
|
1099
|
-
hidden?: boolean;
|
|
1031
|
+
declare class CustomHeadersSettings extends PureComponent<Props$9, State> {
|
|
1032
|
+
state: State;
|
|
1033
|
+
constructor(props: Props$9);
|
|
1034
|
+
updateSettings: () => void;
|
|
1035
|
+
onHeaderAdd: () => void;
|
|
1036
|
+
onHeaderChange: (headerIndex: number, value: CustomHeader) => void;
|
|
1037
|
+
onHeaderReset: (headerId: string) => void;
|
|
1038
|
+
onHeaderRemove: (headerId: string) => void;
|
|
1039
|
+
render(): React.JSX.Element;
|
|
1100
1040
|
}
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
id: FieldPackID;
|
|
1107
|
-
fields: ConfigField[];
|
|
1041
|
+
|
|
1042
|
+
interface QueryBuilderLabelFilter {
|
|
1043
|
+
label: string;
|
|
1044
|
+
op: string;
|
|
1045
|
+
value: string;
|
|
1108
1046
|
}
|
|
1109
|
-
interface
|
|
1110
|
-
/**
|
|
1111
|
-
* Globally unique identifier
|
|
1112
|
-
* Recommended format: dot-separated path
|
|
1113
|
-
* Example: "auth.method", "httpHeaders.item.key"
|
|
1114
|
-
*/
|
|
1047
|
+
interface QueryBuilderOperation {
|
|
1115
1048
|
id: string;
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
*/
|
|
1119
|
-
key: string;
|
|
1120
|
-
/**
|
|
1121
|
-
* UI metadata
|
|
1122
|
-
*/
|
|
1123
|
-
label?: string;
|
|
1124
|
-
description?: string;
|
|
1125
|
-
docURL?: string;
|
|
1126
|
-
/**
|
|
1127
|
-
* Core type of the field
|
|
1128
|
-
*/
|
|
1129
|
-
valueType: ValueType;
|
|
1130
|
-
/**
|
|
1131
|
-
* Storage location (required for storage fields)
|
|
1132
|
-
*/
|
|
1133
|
-
target?: TargetLocation;
|
|
1134
|
-
/**
|
|
1135
|
-
* Semantic role identifying what a field represents to the SDK.
|
|
1136
|
-
* Field packs annotate their fields with roles (e.g. `endpoint.baseUrl`).
|
|
1137
|
-
*/
|
|
1138
|
-
role?: Role;
|
|
1139
|
-
/**
|
|
1140
|
-
* Dotted path prefix within the target for nested objects.
|
|
1141
|
-
* Example: for jsonData.tracesToLogs.datasourceUid,
|
|
1142
|
-
* target="jsonData", section="tracesToLogs", key="datasourceUid".
|
|
1143
|
-
*/
|
|
1144
|
-
section?: string;
|
|
1145
|
-
/**
|
|
1146
|
-
* Field kind.
|
|
1147
|
-
* @default "storage"
|
|
1148
|
-
*/
|
|
1149
|
-
kind?: FieldKind;
|
|
1150
|
-
/**
|
|
1151
|
-
* True if field belongs to array item schema
|
|
1152
|
-
*/
|
|
1153
|
-
isItemField?: boolean;
|
|
1154
|
-
/**
|
|
1155
|
-
* UI rendering hints
|
|
1156
|
-
*/
|
|
1157
|
-
ui?: FieldUI;
|
|
1158
|
-
/**
|
|
1159
|
-
* Validations rules
|
|
1160
|
-
*/
|
|
1161
|
-
validations?: FieldValidationRule[];
|
|
1162
|
-
/**
|
|
1163
|
-
* Visibility condition (CEL expression)
|
|
1164
|
-
*/
|
|
1165
|
-
dependsOn?: Expression;
|
|
1166
|
-
/**
|
|
1167
|
-
* Always required
|
|
1168
|
-
*/
|
|
1169
|
-
required?: boolean;
|
|
1170
|
-
/**
|
|
1171
|
-
* Conditionally required
|
|
1172
|
-
*/
|
|
1173
|
-
requiredWhen?: Expression;
|
|
1174
|
-
/**
|
|
1175
|
-
* Disabled condition
|
|
1176
|
-
*/
|
|
1177
|
-
disabledWhen?: Expression;
|
|
1178
|
-
/**
|
|
1179
|
-
* Dynamic overrides
|
|
1180
|
-
*/
|
|
1181
|
-
overrides?: FieldOverride[];
|
|
1182
|
-
/**
|
|
1183
|
-
* Declarative multi-field write side-effects.
|
|
1184
|
-
* When this field's value matches a condition, the listed target
|
|
1185
|
-
* fields are set to specified values. Typically used on virtual
|
|
1186
|
-
* selector fields (e.g. auth method dropdown).
|
|
1187
|
-
*/
|
|
1188
|
-
effects?: FieldEffect[];
|
|
1189
|
-
/**
|
|
1190
|
-
* Item schema for array elements or map values.
|
|
1191
|
-
* Required if valueType === "array" or "map".
|
|
1192
|
-
*/
|
|
1193
|
-
item?: FieldItemSchema;
|
|
1194
|
-
/**
|
|
1195
|
-
* Legacy indexed fields (deprecated)
|
|
1196
|
-
*/
|
|
1197
|
-
repeatable?: boolean;
|
|
1198
|
-
pattern?: string;
|
|
1199
|
-
/**
|
|
1200
|
-
* Storage mapping
|
|
1201
|
-
*/
|
|
1202
|
-
storage?: StorageMapping;
|
|
1203
|
-
/**
|
|
1204
|
-
* Metadata
|
|
1205
|
-
*/
|
|
1206
|
-
tags?: string[];
|
|
1207
|
-
examples?: unknown[];
|
|
1208
|
-
defaultValue?: unknown;
|
|
1049
|
+
params: QueryBuilderOperationParamValue[];
|
|
1050
|
+
disabled?: boolean;
|
|
1209
1051
|
}
|
|
1210
|
-
interface
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
/**
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1052
|
+
interface QueryBuilderOperationDefinition<T = any> extends RegistryItem {
|
|
1053
|
+
documentation?: string;
|
|
1054
|
+
params: QueryBuilderOperationParamDef[];
|
|
1055
|
+
defaultParams: QueryBuilderOperationParamValue[];
|
|
1056
|
+
category: string;
|
|
1057
|
+
hideFromList?: boolean;
|
|
1058
|
+
alternativesKey?: string;
|
|
1059
|
+
/** Can be used to control operation placement when adding a new operations, lower are placed first */
|
|
1060
|
+
orderRank?: number;
|
|
1061
|
+
renderer: QueryBuilderOperationRenderer;
|
|
1062
|
+
addOperationHandler: QueryBuilderAddOperationHandler<T>;
|
|
1063
|
+
paramChangedHandler?: QueryBuilderOnParamChangedHandler;
|
|
1064
|
+
explainHandler?: QueryBuilderExplainOperationHandler;
|
|
1065
|
+
changeTypeHandler?: (op: QueryBuilderOperation, newDef: QueryBuilderOperationDefinition<T>) => QueryBuilderOperation;
|
|
1066
|
+
toggleable?: boolean;
|
|
1222
1067
|
}
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
type
|
|
1227
|
-
type
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
type Role = string;
|
|
1236
|
-
type UIComponent = 'input' | 'textarea' | 'select' | 'multiselect' | 'radio' | 'checkbox' | 'switch' | 'code' | 'keyvalue' | 'list' | 'fileUpload';
|
|
1237
|
-
type UIWidth = 'full' | 'half';
|
|
1238
|
-
/**
|
|
1239
|
-
* UI configuration
|
|
1240
|
-
*/
|
|
1241
|
-
interface FieldUI {
|
|
1242
|
-
component: UIComponent;
|
|
1243
|
-
multiline?: boolean;
|
|
1244
|
-
rows?: number;
|
|
1245
|
-
options?: FieldOption[];
|
|
1246
|
-
allowCustom?: boolean;
|
|
1247
|
-
width?: UIWidth;
|
|
1068
|
+
type QueryBuilderAddOperationHandler<T> = (def: QueryBuilderOperationDefinition, query: T, modeller: VisualQueryModeller) => T;
|
|
1069
|
+
type QueryBuilderExplainOperationHandler = (op: QueryBuilderOperation, def?: QueryBuilderOperationDefinition) => string;
|
|
1070
|
+
type QueryBuilderOnParamChangedHandler = (index: number, operation: QueryBuilderOperation, operationDef: QueryBuilderOperationDefinition) => QueryBuilderOperation;
|
|
1071
|
+
type QueryBuilderOperationRenderer = (model: QueryBuilderOperation, def: QueryBuilderOperationDefinition, innerQuery: string) => string;
|
|
1072
|
+
type QueryBuilderOperationParamValue = string | number | boolean;
|
|
1073
|
+
interface QueryBuilderOperationParamDef {
|
|
1074
|
+
name: string;
|
|
1075
|
+
type: 'string' | 'number' | 'boolean';
|
|
1076
|
+
options?: string[] | number[] | Array<SelectableValue<string>>;
|
|
1077
|
+
hideName?: boolean;
|
|
1078
|
+
restParam?: boolean;
|
|
1079
|
+
optional?: boolean;
|
|
1248
1080
|
placeholder?: string;
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
language?: string;
|
|
1254
|
-
/**
|
|
1255
|
-
* Layout row index for item fields inside object arrays.
|
|
1256
|
-
* Fields with the same row number are rendered horizontally.
|
|
1257
|
-
* Fields without a row number use auto-layout:
|
|
1258
|
-
* - ≤3 fields: all on one row
|
|
1259
|
-
* - >3 fields: each on its own row
|
|
1260
|
-
*/
|
|
1261
|
-
row?: number;
|
|
1262
|
-
/**
|
|
1263
|
-
* Accepted file types for fileUpload component.
|
|
1264
|
-
* Uses HTML accept attribute format with leading dot.
|
|
1265
|
-
* Example: [".json"]
|
|
1266
|
-
*/
|
|
1267
|
-
accept?: string[];
|
|
1268
|
-
/**
|
|
1269
|
-
* Maps keys in an uploaded JSON file to target field IDs.
|
|
1270
|
-
* Used by fileUpload to distribute parsed values to other form fields.
|
|
1271
|
-
* Example: { "private_key": "secureJsonData.privateKey", "client_email": "jsonData.clientEmail" }
|
|
1272
|
-
*/
|
|
1273
|
-
fileMapping?: Record<string, string>;
|
|
1081
|
+
description?: string;
|
|
1082
|
+
minWidth?: number;
|
|
1083
|
+
editor?: FunctionComponent<QueryBuilderOperationParamEditorProps>;
|
|
1084
|
+
runQueryOnEnter?: boolean;
|
|
1274
1085
|
}
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1086
|
+
interface QueryBuilderOperationParamEditorProps {
|
|
1087
|
+
value?: QueryBuilderOperationParamValue;
|
|
1088
|
+
paramDef: QueryBuilderOperationParamDef;
|
|
1089
|
+
/** Parameter index */
|
|
1090
|
+
index: number;
|
|
1091
|
+
operation: QueryBuilderOperation;
|
|
1092
|
+
operationId: string;
|
|
1093
|
+
query: any;
|
|
1094
|
+
datasource: DataSourceApi;
|
|
1095
|
+
timeRange?: TimeRange;
|
|
1096
|
+
onChange: (index: number, value: QueryBuilderOperationParamValue) => void;
|
|
1097
|
+
onRunQuery: () => void;
|
|
1098
|
+
queryModeller: VisualQueryModeller;
|
|
1286
1099
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1100
|
+
declare enum QueryEditorMode {
|
|
1101
|
+
Code = "code",
|
|
1102
|
+
Builder = "builder"
|
|
1290
1103
|
}
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1104
|
+
type QueryStats = {
|
|
1105
|
+
bytes: number;
|
|
1106
|
+
message?: string;
|
|
1107
|
+
};
|
|
1108
|
+
interface VisualQueryModeller {
|
|
1109
|
+
getOperationsForCategory(category: string): QueryBuilderOperationDefinition[];
|
|
1110
|
+
getAlternativeOperations(key: string): QueryBuilderOperationDefinition[];
|
|
1111
|
+
getCategories(): string[];
|
|
1112
|
+
getOperationDefinition(id: string): QueryBuilderOperationDefinition | undefined;
|
|
1113
|
+
renderQuery(query: VisualQuery, nested?: boolean): string;
|
|
1114
|
+
renderLabels(labels: QueryBuilderLabelFilter[]): string;
|
|
1115
|
+
innerQueryPlaceholder: string;
|
|
1295
1116
|
}
|
|
1296
|
-
interface
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1117
|
+
interface VisualQueryBinary<T> {
|
|
1118
|
+
operator: string;
|
|
1119
|
+
vectorMatchesType?: 'on' | 'ignoring';
|
|
1120
|
+
vectorMatches?: string;
|
|
1121
|
+
query: T;
|
|
1300
1122
|
}
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1123
|
+
declare const BINARY_OPERATIONS_KEY = "Binary operations";
|
|
1124
|
+
interface VisualQuery {
|
|
1125
|
+
metric?: string;
|
|
1126
|
+
labels: QueryBuilderLabelFilter[];
|
|
1127
|
+
operations: QueryBuilderOperation[];
|
|
1128
|
+
binaryQueries?: Array<VisualQueryBinary<VisualQuery>>;
|
|
1305
1129
|
}
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1130
|
+
|
|
1131
|
+
declare abstract class QueryModellerBase implements VisualQueryModeller {
|
|
1132
|
+
protected operationsRegistry: Registry<QueryBuilderOperationDefinition>;
|
|
1133
|
+
private categories;
|
|
1134
|
+
innerQueryPlaceholder: string;
|
|
1135
|
+
constructor(operationDefinitions: QueryBuilderOperationDefinition[], innerQueryPlaceholder?: string);
|
|
1136
|
+
protected setOperationCategories(categories: string[]): void;
|
|
1137
|
+
abstract renderOperations(queryString: string, operations: QueryBuilderOperation[]): string;
|
|
1138
|
+
abstract renderBinaryQueries(queryString: string, binaryQueries?: Array<VisualQueryBinary<VisualQuery>>): string;
|
|
1139
|
+
abstract renderLabels(labels: QueryBuilderLabelFilter[]): string;
|
|
1140
|
+
abstract renderQuery(query: VisualQuery, nested?: boolean): string;
|
|
1141
|
+
getOperationsForCategory(category: string): QueryBuilderOperationDefinition<any>[];
|
|
1142
|
+
getAlternativeOperations(key: string): QueryBuilderOperationDefinition<any>[];
|
|
1143
|
+
getCategories(): string[];
|
|
1144
|
+
getOperationDefinition(id: string): QueryBuilderOperationDefinition | undefined;
|
|
1145
|
+
hasBinaryOp(query: VisualQuery): boolean;
|
|
1309
1146
|
}
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1147
|
+
|
|
1148
|
+
interface Props$8 {
|
|
1149
|
+
labelsFilters: QueryBuilderLabelFilter[];
|
|
1150
|
+
onChange: (labelFilters: QueryBuilderLabelFilter[]) => void;
|
|
1151
|
+
onGetLabelNames: (forLabel: Partial<QueryBuilderLabelFilter>) => Promise<SelectableValue[]>;
|
|
1152
|
+
onGetLabelValues: (forLabel: Partial<QueryBuilderLabelFilter>) => Promise<SelectableValue[]>;
|
|
1153
|
+
/** If set to true, component will show error message until at least 1 filter is selected */
|
|
1154
|
+
labelFilterRequired?: boolean;
|
|
1155
|
+
multiValueSeparator?: string;
|
|
1318
1156
|
}
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
/**
|
|
1326
|
-
* When true, the field is disabled/read-only while this override is active.
|
|
1327
|
-
*/
|
|
1328
|
-
readOnly?: boolean;
|
|
1329
|
-
description?: string;
|
|
1330
|
-
placeholder?: string;
|
|
1331
|
-
tooltip?: string;
|
|
1332
|
-
validations?: FieldValidationRule[];
|
|
1333
|
-
options?: FieldOption[];
|
|
1334
|
-
/**
|
|
1335
|
-
* When present on an `isItemField` field, the value is routed to
|
|
1336
|
-
* `secureJsonData` under the resolved key instead of being stored
|
|
1337
|
-
* inline in the parent array.
|
|
1338
|
-
*
|
|
1339
|
-
* The template string supports placeholders:
|
|
1340
|
-
* - `{index}` — 0-based array position
|
|
1341
|
-
* - `{index1}` — 1-based array position
|
|
1342
|
-
* - `{item.KEY}` — value of sibling item field `KEY`
|
|
1343
|
-
*
|
|
1344
|
-
* Examples:
|
|
1345
|
-
* - `"secureHttpHeaders.{item.name}"` (ClickHouse)
|
|
1346
|
-
* - `"httpHeaderValue{index1}"` (Grafana core headers)
|
|
1347
|
-
*/
|
|
1348
|
-
secureKey?: string;
|
|
1157
|
+
declare function LabelFilters({ labelsFilters, onChange, onGetLabelNames, onGetLabelValues, labelFilterRequired, multiValueSeparator, }: Props$8): React.JSX.Element;
|
|
1158
|
+
|
|
1159
|
+
interface Props$7 {
|
|
1160
|
+
title?: React.ReactNode;
|
|
1161
|
+
markdown?: string;
|
|
1162
|
+
stepNumber?: number;
|
|
1349
1163
|
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
* Maps field IDs to the values they should be set to.
|
|
1363
|
-
* Must contain at least one entry.
|
|
1364
|
-
*/
|
|
1365
|
-
set: Record<string, unknown> & {
|
|
1366
|
-
[k: string]: unknown;
|
|
1367
|
-
};
|
|
1164
|
+
declare function OperationExplainedBox({ title, stepNumber, markdown, children }: React.PropsWithChildren<Props$7>): React.JSX.Element;
|
|
1165
|
+
|
|
1166
|
+
interface Props$6<T extends VisualQuery> {
|
|
1167
|
+
query: T;
|
|
1168
|
+
datasource: DataSourceApi;
|
|
1169
|
+
onChange: (query: T) => void;
|
|
1170
|
+
onRunQuery: () => void;
|
|
1171
|
+
queryModeller: VisualQueryModeller;
|
|
1172
|
+
explainMode?: boolean;
|
|
1173
|
+
highlightedOp?: QueryBuilderOperation;
|
|
1174
|
+
timeRange?: TimeRange;
|
|
1175
|
+
isConflictingOperation?: (operation: QueryBuilderOperation, otherOperations: QueryBuilderOperation[]) => boolean;
|
|
1368
1176
|
}
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1177
|
+
declare function OperationList<T extends VisualQuery>({ query, datasource, queryModeller, onChange, onRunQuery, highlightedOp, timeRange, isConflictingOperation, }: Props$6<T>): React.JSX.Element;
|
|
1178
|
+
|
|
1179
|
+
interface Props$5<T extends VisualQuery> {
|
|
1180
|
+
query: T;
|
|
1181
|
+
queryModeller: VisualQueryModeller;
|
|
1182
|
+
explainMode?: boolean;
|
|
1183
|
+
stepNumber: number;
|
|
1184
|
+
language: {
|
|
1185
|
+
grammar: Grammar;
|
|
1186
|
+
name: string;
|
|
1187
|
+
};
|
|
1188
|
+
onMouseEnter?: (op: QueryBuilderOperation, index: number) => void;
|
|
1189
|
+
onMouseLeave?: (op: QueryBuilderOperation, index: number) => void;
|
|
1375
1190
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1191
|
+
declare function OperationListExplained<T extends VisualQuery>({ query, queryModeller, stepNumber, language, onMouseEnter, onMouseLeave, }: Props$5<T>): React.JSX.Element;
|
|
1192
|
+
|
|
1193
|
+
declare function OperationsEditorRow({ children }: React.PropsWithChildren<{}>): React.JSX.Element;
|
|
1194
|
+
|
|
1195
|
+
interface Props$4<TVisualQuery extends VisualQuery, TDataQuery extends DataQuery$1> {
|
|
1196
|
+
query: TVisualQuery;
|
|
1197
|
+
datasource: DataSourceApi<TDataQuery>;
|
|
1198
|
+
queryModeller: VisualQueryModeller;
|
|
1199
|
+
buildVisualQueryFromString: (queryString: string) => {
|
|
1200
|
+
query: TVisualQuery;
|
|
1201
|
+
};
|
|
1202
|
+
buildDataQueryFromQueryString: (queryString: string) => TDataQuery;
|
|
1203
|
+
buildQueryStringFromDataQuery: (dataQuery: TDataQuery) => string;
|
|
1204
|
+
onChange: (update: TVisualQuery) => void;
|
|
1205
|
+
data?: PanelData;
|
|
1384
1206
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
*/
|
|
1389
|
-
type ComputedMapping = {
|
|
1390
|
-
type: 'computed';
|
|
1391
|
-
read: Expression;
|
|
1392
|
-
write?: Expression;
|
|
1393
|
-
} | {
|
|
1394
|
-
type: 'computed';
|
|
1395
|
-
read?: Expression;
|
|
1396
|
-
write: Expression;
|
|
1207
|
+
declare const QueryBuilderHints: {
|
|
1208
|
+
<TVisualQuery extends VisualQuery, TDataQuery extends DataQuery$1>({ datasource, query: visualQuery, onChange, data, queryModeller, buildVisualQueryFromString, buildDataQueryFromQueryString, buildQueryStringFromDataQuery, }: Props$4<TVisualQuery, TDataQuery>): React.JSX.Element;
|
|
1209
|
+
displayName: string;
|
|
1397
1210
|
};
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
target: TargetLocation;
|
|
1403
|
-
pattern: string;
|
|
1211
|
+
|
|
1212
|
+
interface Props$3 {
|
|
1213
|
+
mode: QueryEditorMode;
|
|
1214
|
+
onChange: (mode: QueryEditorMode) => void;
|
|
1404
1215
|
}
|
|
1405
|
-
|
|
1216
|
+
declare function QueryEditorModeToggle({ mode, onChange }: Props$3): React.JSX.Element;
|
|
1217
|
+
|
|
1218
|
+
interface Props$2 extends Omit<HTMLProps<HTMLInputElement>, 'value' | 'ref'> {
|
|
1219
|
+
value?: boolean;
|
|
1406
1220
|
label: string;
|
|
1221
|
+
}
|
|
1222
|
+
declare function QueryHeaderSwitch({ label, ...inputProps }: Props$2): React.JSX.Element;
|
|
1223
|
+
|
|
1224
|
+
interface Props$1 {
|
|
1225
|
+
title: string;
|
|
1226
|
+
collapsedInfo: string[];
|
|
1227
|
+
queryStats?: QueryStats | null;
|
|
1228
|
+
}
|
|
1229
|
+
declare function QueryOptionGroup({ title, children, collapsedInfo, queryStats }: React.PropsWithChildren<Props$1>): React.JSX.Element;
|
|
1230
|
+
|
|
1231
|
+
interface Props {
|
|
1232
|
+
query: string;
|
|
1233
|
+
language: {
|
|
1234
|
+
grammar: Grammar;
|
|
1235
|
+
name: string;
|
|
1236
|
+
};
|
|
1237
|
+
className?: string;
|
|
1238
|
+
}
|
|
1239
|
+
declare function RawQuery({ query, language, className }: Props): React.JSX.Element;
|
|
1240
|
+
|
|
1241
|
+
interface CustomMeta {
|
|
1242
|
+
queryID: string;
|
|
1243
|
+
status: string;
|
|
1244
|
+
}
|
|
1245
|
+
interface RunningQueryInfo {
|
|
1246
|
+
queryID?: string;
|
|
1247
|
+
shouldCancel?: boolean;
|
|
1248
|
+
}
|
|
1249
|
+
declare class DatasourceWithAsyncBackend<TQuery extends DataQuery$1 = DataQuery$1, TOptions extends DataSourceJsonData = DataSourceJsonData> extends DataSourceWithBackend<TQuery, TOptions> {
|
|
1250
|
+
private runningQueries;
|
|
1251
|
+
private requestCounter;
|
|
1252
|
+
private requestIdPrefix;
|
|
1253
|
+
constructor(instanceSettings: DataSourceInstanceSettings<TOptions>);
|
|
1254
|
+
query(request: DataQueryRequest<TQuery>): Observable<DataQueryResponse>;
|
|
1255
|
+
storeQuery(target: TQuery, queryInfo: RunningQueryInfo): void;
|
|
1256
|
+
getQuery(target: TQuery): RunningQueryInfo;
|
|
1257
|
+
removeQuery(target: TQuery): void;
|
|
1258
|
+
doSingle(target: TQuery, request: DataQueryRequest<TQuery>): Observable<DataQueryResponse>;
|
|
1259
|
+
cancel: (target: TQuery) => void;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
interface RunQueryButtonsProps<TQuery extends DataQuery$1> {
|
|
1263
|
+
enableRun?: boolean;
|
|
1264
|
+
onRunQuery: () => void;
|
|
1265
|
+
onCancelQuery: (query: TQuery) => void;
|
|
1266
|
+
query: TQuery;
|
|
1267
|
+
state?: LoadingState;
|
|
1268
|
+
}
|
|
1269
|
+
declare const RunQueryButtons: <TQuery extends DataQuery$1>(props: RunQueryButtonsProps<TQuery>) => React.JSX.Element;
|
|
1270
|
+
|
|
1271
|
+
interface RequestLoopOptions<TQuery extends DataQuery$1 = DataQuery$1> {
|
|
1407
1272
|
/**
|
|
1408
|
-
*
|
|
1409
|
-
* Must not be null.
|
|
1410
|
-
*/
|
|
1411
|
-
value: NonNullable<unknown>;
|
|
1412
|
-
/**
|
|
1413
|
-
* Optional human-readable description of the option.
|
|
1273
|
+
* If the response needs an additional request to execute, return it here
|
|
1414
1274
|
*/
|
|
1415
|
-
|
|
1275
|
+
getNextQuery: (rsp: DataQueryResponse) => TQuery | undefined;
|
|
1276
|
+
/**
|
|
1277
|
+
* The datasource execute method
|
|
1278
|
+
*/
|
|
1279
|
+
query: (req: DataQueryRequest<TQuery>) => Observable<DataQueryResponse>;
|
|
1280
|
+
/**
|
|
1281
|
+
* Process the results
|
|
1282
|
+
*/
|
|
1283
|
+
process: (data: DataFrame[]) => DataFrame[];
|
|
1284
|
+
/**
|
|
1285
|
+
* Check if the query should be cancelled
|
|
1286
|
+
*/
|
|
1287
|
+
shouldCancel: () => boolean;
|
|
1288
|
+
/**
|
|
1289
|
+
* Callback that gets executed when unsubscribed
|
|
1290
|
+
*/
|
|
1291
|
+
onCancel: () => void;
|
|
1416
1292
|
}
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1293
|
+
/**
|
|
1294
|
+
* Continue executing requests as long as `getNextQuery` returns a query
|
|
1295
|
+
*/
|
|
1296
|
+
declare function getRequestLooper<T extends DataQuery$1 = DataQuery$1>(req: DataQueryRequest<T>, options: RequestLoopOptions<T>): Observable<DataQueryResponse>;
|
|
1297
|
+
|
|
1298
|
+
interface DatasourceConfigSchema {
|
|
1422
1299
|
/**
|
|
1423
|
-
*
|
|
1300
|
+
* Schema version (required)
|
|
1301
|
+
* Used for compatibility and migrations
|
|
1302
|
+
*
|
|
1303
|
+
* Example: "v2"
|
|
1424
1304
|
*/
|
|
1425
|
-
|
|
1305
|
+
schemaVersion: string;
|
|
1426
1306
|
/**
|
|
1427
|
-
*
|
|
1307
|
+
* Unique datasource plugin identifier
|
|
1308
|
+
* Example: "prometheus"
|
|
1428
1309
|
*/
|
|
1429
|
-
|
|
1310
|
+
pluginType: string;
|
|
1311
|
+
/**
|
|
1312
|
+
* Human-readable name
|
|
1313
|
+
*/
|
|
1314
|
+
pluginName: string;
|
|
1315
|
+
/**
|
|
1316
|
+
* Optional documentation URL
|
|
1317
|
+
*/
|
|
1318
|
+
docURL?: string;
|
|
1319
|
+
/**
|
|
1320
|
+
* Source of truth for configuration
|
|
1321
|
+
*/
|
|
1322
|
+
fields: ConfigField[];
|
|
1323
|
+
/**
|
|
1324
|
+
* Optional UI grouping
|
|
1325
|
+
*/
|
|
1326
|
+
groups?: ConfigGroup[];
|
|
1327
|
+
/**
|
|
1328
|
+
* Relationships between fields
|
|
1329
|
+
*/
|
|
1330
|
+
relationships?: FieldRelationship[];
|
|
1430
1331
|
}
|
|
1431
|
-
|
|
1432
|
-
interface FieldRelationship {
|
|
1433
|
-
type: RelationshipType;
|
|
1332
|
+
interface ConfigField {
|
|
1434
1333
|
/**
|
|
1435
|
-
*
|
|
1334
|
+
* Globally unique identifier
|
|
1335
|
+
* Recommended format: dot-separated path
|
|
1336
|
+
* Example: "auth.method", "httpHeaders.item.key"
|
|
1436
1337
|
*/
|
|
1437
|
-
|
|
1338
|
+
id: string;
|
|
1339
|
+
/**
|
|
1340
|
+
* Local key used in storage or object
|
|
1341
|
+
*/
|
|
1342
|
+
key: string;
|
|
1343
|
+
/**
|
|
1344
|
+
* UI metadata
|
|
1345
|
+
*/
|
|
1346
|
+
label?: string;
|
|
1438
1347
|
description?: string;
|
|
1348
|
+
docURL?: string;
|
|
1439
1349
|
/**
|
|
1440
|
-
*
|
|
1441
|
-
* Only applicable when type is "datasourceReference".
|
|
1350
|
+
* Core type of the field
|
|
1442
1351
|
*/
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1352
|
+
valueType: ValueType;
|
|
1353
|
+
/**
|
|
1354
|
+
* Storage location (required for storage fields)
|
|
1355
|
+
*/
|
|
1356
|
+
target?: TargetLocation;
|
|
1357
|
+
/**
|
|
1358
|
+
* Dotted path prefix within the target for nested objects.
|
|
1359
|
+
* Example: for jsonData.tracesToLogs.datasourceUid,
|
|
1360
|
+
* target="jsonData", section="tracesToLogs", key="datasourceUid".
|
|
1361
|
+
*/
|
|
1362
|
+
section?: string;
|
|
1363
|
+
/**
|
|
1364
|
+
* Field kind.
|
|
1365
|
+
* @default "storage"
|
|
1366
|
+
*/
|
|
1367
|
+
kind?: FieldKind;
|
|
1368
|
+
/**
|
|
1369
|
+
* True if field belongs to array item schema
|
|
1370
|
+
*/
|
|
1371
|
+
isItemField?: boolean;
|
|
1372
|
+
/**
|
|
1373
|
+
* UI rendering hints
|
|
1374
|
+
*/
|
|
1375
|
+
ui?: FieldUI;
|
|
1376
|
+
/**
|
|
1377
|
+
* Validations rules
|
|
1378
|
+
*/
|
|
1379
|
+
validations?: FieldValidationRule[];
|
|
1380
|
+
/**
|
|
1381
|
+
* Visibility condition (CEL expression)
|
|
1382
|
+
*/
|
|
1383
|
+
dependsOn?: Expression;
|
|
1384
|
+
/**
|
|
1385
|
+
* Always required
|
|
1386
|
+
*/
|
|
1387
|
+
required?: boolean;
|
|
1388
|
+
/**
|
|
1389
|
+
* Conditionally required
|
|
1390
|
+
*/
|
|
1391
|
+
requiredWhen?: Expression;
|
|
1392
|
+
/**
|
|
1393
|
+
* Disabled condition
|
|
1394
|
+
*/
|
|
1395
|
+
disabledWhen?: Expression;
|
|
1396
|
+
/**
|
|
1397
|
+
* Dynamic overrides
|
|
1398
|
+
*/
|
|
1399
|
+
overrides?: FieldOverride[];
|
|
1400
|
+
/**
|
|
1401
|
+
* Declarative multi-field write side-effects.
|
|
1402
|
+
* When this field's value matches a condition, the listed target
|
|
1403
|
+
* fields are set to specified values. Typically used on virtual
|
|
1404
|
+
* selector fields (e.g. auth method dropdown).
|
|
1405
|
+
*/
|
|
1406
|
+
effects?: FieldEffect[];
|
|
1407
|
+
/**
|
|
1408
|
+
* Item schema for array elements or map values.
|
|
1409
|
+
* Required if valueType === "array" or "map".
|
|
1410
|
+
*/
|
|
1411
|
+
item?: FieldItemSchema;
|
|
1412
|
+
/**
|
|
1413
|
+
* Legacy indexed fields (deprecated)
|
|
1414
|
+
*/
|
|
1415
|
+
repeatable?: boolean;
|
|
1416
|
+
pattern?: string;
|
|
1417
|
+
/**
|
|
1418
|
+
* Storage mapping
|
|
1419
|
+
*/
|
|
1420
|
+
storage?: StorageMapping;
|
|
1421
|
+
/**
|
|
1422
|
+
* Metadata
|
|
1423
|
+
*/
|
|
1424
|
+
tags?: string[];
|
|
1425
|
+
examples?: unknown[];
|
|
1426
|
+
defaultValue?: unknown;
|
|
1493
1427
|
}
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1428
|
+
interface FieldItemSchema {
|
|
1429
|
+
/**
|
|
1430
|
+
* Type of array items or map values.
|
|
1431
|
+
* For arrays, describes each element.
|
|
1432
|
+
* For maps, describes each value (keys are always strings).
|
|
1433
|
+
*/
|
|
1434
|
+
valueType: ValueType;
|
|
1435
|
+
/**
|
|
1436
|
+
* Sub-fields for object items. Optional even when valueType = "object"
|
|
1437
|
+
* (omitting allows an unconstrained object).
|
|
1438
|
+
*/
|
|
1439
|
+
fields?: ConfigField[];
|
|
1500
1440
|
}
|
|
1501
1441
|
/**
|
|
1502
|
-
*
|
|
1503
|
-
* Call `checkUids(uids)` to trigger checks for specific UIDs.
|
|
1504
|
-
* Call `retry(uid)` to force re-check a single UID.
|
|
1505
|
-
* UIDs that have already been checked (or are in-flight) are automatically skipped.
|
|
1442
|
+
* CEL expression string
|
|
1506
1443
|
*/
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
declare function resolvePluginName(pluginType: string): string;
|
|
1514
|
-
|
|
1444
|
+
type Expression = string;
|
|
1445
|
+
type ValueType = 'string' | 'number' | 'boolean' | 'array' | 'object' | 'map' | 'any';
|
|
1446
|
+
type FieldKind = 'storage' | 'virtual';
|
|
1447
|
+
type TargetLocation = 'root' | 'jsonData' | 'secureJsonData';
|
|
1448
|
+
type UIComponent = 'input' | 'textarea' | 'select' | 'multiselect' | 'radio' | 'checkbox' | 'switch' | 'code' | 'keyvalue' | 'list' | 'fileUpload';
|
|
1449
|
+
type UIWidth = 'full' | 'half';
|
|
1515
1450
|
/**
|
|
1516
|
-
*
|
|
1517
|
-
*
|
|
1518
|
-
* Used by `dependsOn`, `requiredWhen`, `disabledWhen`, and `overrides[].when`.
|
|
1519
|
-
* Wraps @marcbachmann/cel-js with field-ID-aware context building.
|
|
1520
|
-
*
|
|
1521
|
-
* Go equivalent: github.com/google/cel-go
|
|
1522
|
-
*/
|
|
1523
|
-
/**
|
|
1524
|
-
* Build a nested context object from flat form values keyed by field IDs.
|
|
1525
|
-
*
|
|
1526
|
-
* CEL interprets dots as property access, so `jsonData.auth_method == 'oauth2'`
|
|
1527
|
-
* requires `{ jsonData: { auth_method: 'oauth2' } }`.
|
|
1528
|
-
*
|
|
1529
|
-
* This function takes flat key-value pairs (from react-hook-form `watch()`)
|
|
1530
|
-
* and builds the nested structure CEL expects.
|
|
1531
|
-
*
|
|
1532
|
-
* @param values - Flat map of form keys to values (e.g. `{ "auth_method": "oauth2", "oauth2.oauth2_type": "jwt" }`)
|
|
1533
|
-
* @param fieldIdToFormKey - Optional map from field ID to form key for translation
|
|
1534
|
-
*/
|
|
1535
|
-
declare function buildCelContext(values: Record<string, unknown>): Record<string, unknown>;
|
|
1536
|
-
/**
|
|
1537
|
-
* Evaluate a CEL expression against a context of field values.
|
|
1538
|
-
* Returns the boolean result, or `defaultValue` if the expression is invalid.
|
|
1539
|
-
*
|
|
1540
|
-
* @example
|
|
1541
|
-
* ```ts
|
|
1542
|
-
* evaluateCelExpression("jsonData.auth_method == 'oauth2'", { jsonData: { auth_method: 'oauth2' } })
|
|
1543
|
-
* // => true
|
|
1544
|
-
*
|
|
1545
|
-
* evaluateCelExpression("auth_method == 'oauth2' && oauth2_type == 'jwt'", { auth_method: 'oauth2', oauth2_type: 'jwt' })
|
|
1546
|
-
* // => true
|
|
1547
|
-
* ```
|
|
1548
|
-
*/
|
|
1549
|
-
declare function evaluateCelExpression(expr: string, context: Record<string, unknown>, defaultValue?: boolean): boolean;
|
|
1550
|
-
/**
|
|
1551
|
-
* Evaluate a CEL expression directly using `evaluate` (no caching).
|
|
1552
|
-
* Useful for one-off evaluations or testing.
|
|
1553
|
-
*/
|
|
1554
|
-
declare function evaluateCelDirect(expr: string, context: Record<string, unknown>): unknown;
|
|
1555
|
-
/**
|
|
1556
|
-
* Validate that a CEL expression can be parsed without errors.
|
|
1557
|
-
* Returns true if valid, false otherwise.
|
|
1558
|
-
*/
|
|
1559
|
-
declare function isValidCelExpression(expr: string): boolean;
|
|
1560
|
-
/**
|
|
1561
|
-
* Extract all field ID references from a simple expression.
|
|
1562
|
-
* Used by `resolveRequiredFieldsGroup` to find dependency relationships.
|
|
1563
|
-
*
|
|
1564
|
-
* For simple expressions like `fieldA == 'x'`, returns `['fieldA']`.
|
|
1565
|
-
* For compound expressions like `fieldA == 'x' && fieldB == 'y'`, returns `['fieldA', 'fieldB']`.
|
|
1566
|
-
*
|
|
1567
|
-
* This uses regex extraction (not AST walking) for simplicity and speed.
|
|
1568
|
-
*/
|
|
1569
|
-
declare function extractFieldRefs(expr: string): string[];
|
|
1570
|
-
/**
|
|
1571
|
-
* Clear the expression cache. Useful for testing.
|
|
1572
|
-
*/
|
|
1573
|
-
declare function clearExpressionCache(): void;
|
|
1574
|
-
|
|
1575
|
-
/**
|
|
1576
|
-
* Generate LLM hints for select fields (used when creating datasources).
|
|
1577
|
-
*/
|
|
1578
|
-
declare function generateLLMHint(schema: DatasourceConfigSchema): string;
|
|
1579
|
-
/**
|
|
1580
|
-
* Generate comprehensive structured field data for troubleshooting context.
|
|
1581
|
-
* Returns an array of field descriptors the LLM can use to render rich tables.
|
|
1582
|
-
*/
|
|
1583
|
-
declare function generateTroubleshootingFields(schema: DatasourceConfigSchema): Array<{
|
|
1584
|
-
label: string;
|
|
1585
|
-
key: string;
|
|
1586
|
-
target: string;
|
|
1587
|
-
type: string;
|
|
1588
|
-
required: boolean;
|
|
1589
|
-
description?: string;
|
|
1590
|
-
defaultValue?: unknown;
|
|
1591
|
-
options?: string[];
|
|
1592
|
-
section?: string;
|
|
1593
|
-
dependsOn?: string;
|
|
1594
|
-
}>;
|
|
1595
|
-
|
|
1596
|
-
type YamlRenderOptions = {
|
|
1597
|
-
jsonDataKeys?: string[];
|
|
1598
|
-
secureKeys?: string[];
|
|
1599
|
-
};
|
|
1600
|
-
type ProvisioningYamlOptions = {
|
|
1601
|
-
/** Include comments with field descriptions. Default: true for template, false for export. */
|
|
1602
|
-
comments?: boolean;
|
|
1603
|
-
/** Name override (used in template mode). */
|
|
1604
|
-
name?: string;
|
|
1605
|
-
};
|
|
1606
|
-
/**
|
|
1607
|
-
* Generate a Grafana provisioning YAML from a dsconfig schema.
|
|
1608
|
-
* In template mode (no values), emits all fields with defaults and comments.
|
|
1609
|
-
* When values are provided, emits actual values — used for existing datasource export.
|
|
1610
|
-
*/
|
|
1611
|
-
declare function toProvisioningYaml(schema: DatasourceConfigSchema, values?: Record<string, unknown>, options?: ProvisioningYamlOptions): string;
|
|
1612
|
-
/**
|
|
1613
|
-
* Generate provisioning YAML from an existing Grafana datasource API response.
|
|
1614
|
-
* If a dsconfig schema is available, uses it for field ordering and comments.
|
|
1615
|
-
* If not, generates basic YAML from the raw API response.
|
|
1616
|
-
*/
|
|
1617
|
-
declare function datasourceToProvisioningYaml(ds: Record<string, unknown>, schema: DatasourceConfigSchema | null): string;
|
|
1618
|
-
declare const configToYaml: (ds: Record<string, unknown>, options?: YamlRenderOptions) => string;
|
|
1619
|
-
declare const formatYamlDiff: (existing: Record<string, unknown>, body: Record<string, unknown>) => string;
|
|
1620
|
-
|
|
1621
|
-
type UseDatasourceSchemaResult = {
|
|
1622
|
-
schema: DatasourceConfigSchema | null;
|
|
1623
|
-
loading: boolean;
|
|
1624
|
-
error: string | null;
|
|
1625
|
-
};
|
|
1626
|
-
declare function useDatasourceSchema(pluginType: string): UseDatasourceSchemaResult;
|
|
1627
|
-
declare function fetchConfigSchema(pluginType: string): Promise<DatasourceConfigSchema | null>;
|
|
1628
|
-
|
|
1629
|
-
declare const ROOT_CONFIG_FIELDS: readonly ["name", "type", "id", "uid", "access", "url", "basicAuth", "basicAuthUser", "user", "isDefault", "database", "withCredentials"];
|
|
1630
|
-
type DatasourceConfig = Record<any, any>;
|
|
1631
|
-
declare const buildCreateDatasourcePayload: (input: DatasourceConfig) => DatasourceConfig;
|
|
1632
|
-
declare const buildCloneDatasourcePayload: (source: DatasourceConfig, name: string) => DatasourceConfig;
|
|
1633
|
-
declare const buildUpdateDatasourcePayload: (existing: DatasourceConfig, input: DatasourceConfig) => {
|
|
1634
|
-
body: DatasourceConfig;
|
|
1635
|
-
hasChanges: boolean;
|
|
1636
|
-
};
|
|
1637
|
-
|
|
1638
|
-
declare function getConfigSchema(pluginType: string): Promise<DatasourceConfigSchema | null>;
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* Pure helper functions for working with DatasourceConfigSchema.
|
|
1642
|
-
*
|
|
1643
|
-
* Types are defined in schema.ts — import them from there directly.
|
|
1644
|
-
*/
|
|
1645
|
-
|
|
1646
|
-
/** A group paired with its resolved ConfigField objects (in fieldRefs order). */
|
|
1647
|
-
type ResolvedGroup = {
|
|
1648
|
-
group: ConfigGroup;
|
|
1649
|
-
fields: ConfigField[];
|
|
1650
|
-
};
|
|
1651
|
-
/**
|
|
1652
|
-
* Group ids that denote the authentication section. Registry schemas use the
|
|
1653
|
-
* full form `authentication`; `auth` is accepted for backwards compatibility
|
|
1654
|
-
* with older/short-form schemas.
|
|
1655
|
-
*/
|
|
1656
|
-
declare const AUTH_GROUP_IDS: readonly string[];
|
|
1657
|
-
/** Whether a group id denotes the authentication group. */
|
|
1658
|
-
declare function isAuthGroupId(id: string): boolean;
|
|
1659
|
-
/**
|
|
1660
|
-
* Resolve a schema's groups into arrays of ConfigField objects.
|
|
1661
|
-
* If the schema has no groups, returns a single group containing all non-virtual fields.
|
|
1662
|
-
*/
|
|
1663
|
-
declare function resolveGroups(schema: DatasourceConfigSchema): ResolvedGroup[];
|
|
1664
|
-
/**
|
|
1665
|
-
* Build a virtual "Required" group containing all required fields, any parent
|
|
1666
|
-
* fields they depend on (via `dependsOn`), and any child fields that depend on
|
|
1667
|
-
* required fields. When the schema contains an authentication group (id
|
|
1668
|
-
* `authentication` or `auth`), its fields are also pulled in (auth is
|
|
1669
|
-
* effectively required for Prometheus/Loki/Tempo style datasources). Fields
|
|
1670
|
-
* are returned in schema order and de-duplicated.
|
|
1671
|
-
* Returns `null` when the virtual group would be empty.
|
|
1672
|
-
*/
|
|
1673
|
-
declare function resolveRequiredFieldsGroup(schema: DatasourceConfigSchema): ResolvedGroup | null;
|
|
1674
|
-
/**
|
|
1675
|
-
* Unique form key for a field. Section-scoped fields (e.g. section:"logs", key:"defaultTable")
|
|
1676
|
-
* get a prefixed key ("logs.defaultTable") so they don't collide with top-level fields that
|
|
1677
|
-
* share the same key name.
|
|
1678
|
-
*/
|
|
1679
|
-
declare function formKey(field: ConfigField): string;
|
|
1680
|
-
/**
|
|
1681
|
-
* Resolve a possibly-dotted key against watchedValues from react-hook-form.
|
|
1682
|
-
* RHF's `watch()` returns nested objects for dotted Controller names
|
|
1683
|
-
* (e.g. "logs.otelEnabled" → { logs: { otelEnabled: true } }),
|
|
1684
|
-
* so a flat `obj["logs.otelEnabled"]` lookup misses.
|
|
1685
|
-
*
|
|
1686
|
-
* For dotted keys we must try the nested path **first**: react-hook-form's
|
|
1687
|
-
* Controller `onChange` writes nested objects via its internal `set()`, but
|
|
1688
|
-
* `reset()` may have created a flat dotted key with the same name. After user
|
|
1689
|
-
* interaction the nested value is authoritative; the stale flat key must not
|
|
1690
|
-
* shadow it. This mirrors RHF's own `get()` semantics (nested-first, flat
|
|
1691
|
-
* fallback).
|
|
1692
|
-
*/
|
|
1693
|
-
declare function getWatchedValue(watchedValues: Record<string, unknown>, key: string): unknown;
|
|
1694
|
-
/**
|
|
1695
|
-
* Parse a simple CEL-like dependsOn expression: "fieldId == 'value'" or "fieldId != 'value'".
|
|
1696
|
-
* Only single comparisons are supported — no &&, ||, or parentheses.
|
|
1697
|
-
* Field IDs may contain dots and underscores (e.g. "jsonData.oauth2.oauth2_type").
|
|
1698
|
-
* Values may be single-quoted, double-quoted, or unquoted literals (true/false/numbers).
|
|
1699
|
-
* Returns { field, value, negate } or null if unparseable.
|
|
1700
|
-
*/
|
|
1701
|
-
declare function parseDependsOn(expr: string): {
|
|
1702
|
-
field: string;
|
|
1703
|
-
value: string;
|
|
1704
|
-
negate: boolean;
|
|
1705
|
-
} | null;
|
|
1706
|
-
/**
|
|
1707
|
-
* Evaluate a parsed dependsOn condition against a value.
|
|
1708
|
-
* Handles both == and != operators.
|
|
1709
|
-
*/
|
|
1710
|
-
declare function evaluateDependsOn(parsed: {
|
|
1711
|
-
value: string;
|
|
1712
|
-
negate: boolean;
|
|
1713
|
-
}, currentValue: unknown): boolean;
|
|
1714
|
-
/**
|
|
1715
|
-
* Resolve the first matching override for a field given current form values.
|
|
1716
|
-
* Override `when` uses the same "fieldId == 'value'" syntax as dependsOn.
|
|
1717
|
-
* Returns the matching override or undefined if none match.
|
|
1718
|
-
*/
|
|
1719
|
-
declare function resolveActiveOverride(field: ConfigField, watchedValues: Record<string, unknown>, fieldById: Map<string, ConfigField>): FieldOverride | undefined;
|
|
1720
|
-
/**
|
|
1721
|
-
* Evaluate a simple computed.read expression against form values.
|
|
1722
|
-
* Supports patterns used in dsconfig schemas:
|
|
1723
|
-
* - "fieldRef == true ? 'a' : (fieldRef == true ? 'b' : 'c')"
|
|
1724
|
-
* - Simple ternary chains with equality checks
|
|
1725
|
-
* Falls back to the field's defaultValue if the expression can't be evaluated.
|
|
1726
|
-
*/
|
|
1727
|
-
declare function evaluateComputedRead(expr: string, values: Record<string, unknown>, fields: ConfigField[]): unknown;
|
|
1728
|
-
/**
|
|
1729
|
-
* Compute initial values for all virtual fields that have storage.computed.read expressions.
|
|
1730
|
-
* Call after loading existing storage field values.
|
|
1451
|
+
* UI configuration
|
|
1731
1452
|
*/
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
}
|
|
1740
|
-
type CustomHeaders = CustomHeader[];
|
|
1741
|
-
interface Props$9 {
|
|
1742
|
-
dataSourceConfig: DataSourceSettings<any, any>;
|
|
1743
|
-
onChange: (config: DataSourceSettings) => void;
|
|
1744
|
-
}
|
|
1745
|
-
interface State {
|
|
1746
|
-
headers: CustomHeaders;
|
|
1747
|
-
}
|
|
1748
|
-
declare class CustomHeadersSettings extends PureComponent<Props$9, State> {
|
|
1749
|
-
state: State;
|
|
1750
|
-
constructor(props: Props$9);
|
|
1751
|
-
updateSettings: () => void;
|
|
1752
|
-
onHeaderAdd: () => void;
|
|
1753
|
-
onHeaderChange: (headerIndex: number, value: CustomHeader) => void;
|
|
1754
|
-
onHeaderReset: (headerId: string) => void;
|
|
1755
|
-
onHeaderRemove: (headerId: string) => void;
|
|
1756
|
-
render(): React.JSX.Element;
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
|
-
interface QueryBuilderLabelFilter {
|
|
1760
|
-
label: string;
|
|
1761
|
-
op: string;
|
|
1762
|
-
value: string;
|
|
1763
|
-
}
|
|
1764
|
-
interface QueryBuilderOperation {
|
|
1765
|
-
id: string;
|
|
1766
|
-
params: QueryBuilderOperationParamValue[];
|
|
1767
|
-
disabled?: boolean;
|
|
1768
|
-
}
|
|
1769
|
-
interface QueryBuilderOperationDefinition<T = any> extends RegistryItem {
|
|
1770
|
-
documentation?: string;
|
|
1771
|
-
params: QueryBuilderOperationParamDef[];
|
|
1772
|
-
defaultParams: QueryBuilderOperationParamValue[];
|
|
1773
|
-
category: string;
|
|
1774
|
-
hideFromList?: boolean;
|
|
1775
|
-
alternativesKey?: string;
|
|
1776
|
-
/** Can be used to control operation placement when adding a new operations, lower are placed first */
|
|
1777
|
-
orderRank?: number;
|
|
1778
|
-
renderer: QueryBuilderOperationRenderer;
|
|
1779
|
-
addOperationHandler: QueryBuilderAddOperationHandler<T>;
|
|
1780
|
-
paramChangedHandler?: QueryBuilderOnParamChangedHandler;
|
|
1781
|
-
explainHandler?: QueryBuilderExplainOperationHandler;
|
|
1782
|
-
changeTypeHandler?: (op: QueryBuilderOperation, newDef: QueryBuilderOperationDefinition<T>) => QueryBuilderOperation;
|
|
1783
|
-
toggleable?: boolean;
|
|
1784
|
-
}
|
|
1785
|
-
type QueryBuilderAddOperationHandler<T> = (def: QueryBuilderOperationDefinition, query: T, modeller: VisualQueryModeller) => T;
|
|
1786
|
-
type QueryBuilderExplainOperationHandler = (op: QueryBuilderOperation, def?: QueryBuilderOperationDefinition) => string;
|
|
1787
|
-
type QueryBuilderOnParamChangedHandler = (index: number, operation: QueryBuilderOperation, operationDef: QueryBuilderOperationDefinition) => QueryBuilderOperation;
|
|
1788
|
-
type QueryBuilderOperationRenderer = (model: QueryBuilderOperation, def: QueryBuilderOperationDefinition, innerQuery: string) => string;
|
|
1789
|
-
type QueryBuilderOperationParamValue = string | number | boolean;
|
|
1790
|
-
interface QueryBuilderOperationParamDef {
|
|
1791
|
-
name: string;
|
|
1792
|
-
type: 'string' | 'number' | 'boolean';
|
|
1793
|
-
options?: string[] | number[] | Array<SelectableValue<string>>;
|
|
1794
|
-
hideName?: boolean;
|
|
1795
|
-
restParam?: boolean;
|
|
1796
|
-
optional?: boolean;
|
|
1453
|
+
interface FieldUI {
|
|
1454
|
+
component: UIComponent;
|
|
1455
|
+
multiline?: boolean;
|
|
1456
|
+
rows?: number;
|
|
1457
|
+
options?: FieldOption[];
|
|
1458
|
+
allowCustom?: boolean;
|
|
1459
|
+
width?: UIWidth;
|
|
1797
1460
|
placeholder?: string;
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
}
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
message?: string;
|
|
1824
|
-
};
|
|
1825
|
-
interface VisualQueryModeller {
|
|
1826
|
-
getOperationsForCategory(category: string): QueryBuilderOperationDefinition[];
|
|
1827
|
-
getAlternativeOperations(key: string): QueryBuilderOperationDefinition[];
|
|
1828
|
-
getCategories(): string[];
|
|
1829
|
-
getOperationDefinition(id: string): QueryBuilderOperationDefinition | undefined;
|
|
1830
|
-
renderQuery(query: VisualQuery, nested?: boolean): string;
|
|
1831
|
-
renderLabels(labels: QueryBuilderLabelFilter[]): string;
|
|
1832
|
-
innerQueryPlaceholder: string;
|
|
1833
|
-
}
|
|
1834
|
-
interface VisualQueryBinary<T> {
|
|
1835
|
-
operator: string;
|
|
1836
|
-
vectorMatchesType?: 'on' | 'ignoring';
|
|
1837
|
-
vectorMatches?: string;
|
|
1838
|
-
query: T;
|
|
1839
|
-
}
|
|
1840
|
-
declare const BINARY_OPERATIONS_KEY = "Binary operations";
|
|
1841
|
-
interface VisualQuery {
|
|
1842
|
-
metric?: string;
|
|
1843
|
-
labels: QueryBuilderLabelFilter[];
|
|
1844
|
-
operations: QueryBuilderOperation[];
|
|
1845
|
-
binaryQueries?: Array<VisualQueryBinary<VisualQuery>>;
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
declare abstract class QueryModellerBase implements VisualQueryModeller {
|
|
1849
|
-
protected operationsRegistry: Registry<QueryBuilderOperationDefinition>;
|
|
1850
|
-
private categories;
|
|
1851
|
-
innerQueryPlaceholder: string;
|
|
1852
|
-
constructor(operationDefinitions: QueryBuilderOperationDefinition[], innerQueryPlaceholder?: string);
|
|
1853
|
-
protected setOperationCategories(categories: string[]): void;
|
|
1854
|
-
abstract renderOperations(queryString: string, operations: QueryBuilderOperation[]): string;
|
|
1855
|
-
abstract renderBinaryQueries(queryString: string, binaryQueries?: Array<VisualQueryBinary<VisualQuery>>): string;
|
|
1856
|
-
abstract renderLabels(labels: QueryBuilderLabelFilter[]): string;
|
|
1857
|
-
abstract renderQuery(query: VisualQuery, nested?: boolean): string;
|
|
1858
|
-
getOperationsForCategory(category: string): QueryBuilderOperationDefinition<any>[];
|
|
1859
|
-
getAlternativeOperations(key: string): QueryBuilderOperationDefinition<any>[];
|
|
1860
|
-
getCategories(): string[];
|
|
1861
|
-
getOperationDefinition(id: string): QueryBuilderOperationDefinition | undefined;
|
|
1862
|
-
hasBinaryOp(query: VisualQuery): boolean;
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
interface Props$8 {
|
|
1866
|
-
labelsFilters: QueryBuilderLabelFilter[];
|
|
1867
|
-
onChange: (labelFilters: QueryBuilderLabelFilter[]) => void;
|
|
1868
|
-
onGetLabelNames: (forLabel: Partial<QueryBuilderLabelFilter>) => Promise<SelectableValue[]>;
|
|
1869
|
-
onGetLabelValues: (forLabel: Partial<QueryBuilderLabelFilter>) => Promise<SelectableValue[]>;
|
|
1870
|
-
/** If set to true, component will show error message until at least 1 filter is selected */
|
|
1871
|
-
labelFilterRequired?: boolean;
|
|
1872
|
-
multiValueSeparator?: string;
|
|
1873
|
-
}
|
|
1874
|
-
declare function LabelFilters({ labelsFilters, onChange, onGetLabelNames, onGetLabelValues, labelFilterRequired, multiValueSeparator, }: Props$8): React.JSX.Element;
|
|
1875
|
-
|
|
1876
|
-
interface Props$7 {
|
|
1877
|
-
title?: React.ReactNode;
|
|
1878
|
-
markdown?: string;
|
|
1879
|
-
stepNumber?: number;
|
|
1461
|
+
/**
|
|
1462
|
+
* Language hint for code editor components.
|
|
1463
|
+
* Example: "promql", "logql", "traceql", "sql", "json"
|
|
1464
|
+
*/
|
|
1465
|
+
language?: string;
|
|
1466
|
+
/**
|
|
1467
|
+
* Layout row index for item fields inside object arrays.
|
|
1468
|
+
* Fields with the same row number are rendered horizontally.
|
|
1469
|
+
* Fields without a row number use auto-layout:
|
|
1470
|
+
* - ≤3 fields: all on one row
|
|
1471
|
+
* - >3 fields: each on its own row
|
|
1472
|
+
*/
|
|
1473
|
+
row?: number;
|
|
1474
|
+
/**
|
|
1475
|
+
* Accepted file types for fileUpload component.
|
|
1476
|
+
* Uses HTML accept attribute format with leading dot.
|
|
1477
|
+
* Example: [".json"]
|
|
1478
|
+
*/
|
|
1479
|
+
accept?: string[];
|
|
1480
|
+
/**
|
|
1481
|
+
* Maps keys in an uploaded JSON file to target field IDs.
|
|
1482
|
+
* Used by fileUpload to distribute parsed values to other form fields.
|
|
1483
|
+
* Example: { "private_key": "secureJsonData.privateKey", "client_email": "jsonData.clientEmail" }
|
|
1484
|
+
*/
|
|
1485
|
+
fileMapping?: Record<string, string>;
|
|
1880
1486
|
}
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
isConflictingOperation?: (operation: QueryBuilderOperation, otherOperations: QueryBuilderOperation[]) => boolean;
|
|
1487
|
+
type FieldValidationRule = PatternValidationRule | RangeValidationRule | LengthValidationRule | ItemCountValidationRule | AllowedValuesValidationRule | CustomValidationRule;
|
|
1488
|
+
interface BaseValidationRule {
|
|
1489
|
+
/**
|
|
1490
|
+
* Optional stable ID for the validation rule.
|
|
1491
|
+
* Useful for docs, localization, and test snapshots.
|
|
1492
|
+
*/
|
|
1493
|
+
id?: string;
|
|
1494
|
+
/**
|
|
1495
|
+
* Human-readable validation error message.
|
|
1496
|
+
*/
|
|
1497
|
+
message?: string;
|
|
1893
1498
|
}
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
query: T;
|
|
1898
|
-
queryModeller: VisualQueryModeller;
|
|
1899
|
-
explainMode?: boolean;
|
|
1900
|
-
stepNumber: number;
|
|
1901
|
-
language: {
|
|
1902
|
-
grammar: Grammar;
|
|
1903
|
-
name: string;
|
|
1904
|
-
};
|
|
1905
|
-
onMouseEnter?: (op: QueryBuilderOperation, index: number) => void;
|
|
1906
|
-
onMouseLeave?: (op: QueryBuilderOperation, index: number) => void;
|
|
1499
|
+
interface PatternValidationRule extends BaseValidationRule {
|
|
1500
|
+
type: 'pattern';
|
|
1501
|
+
pattern: string;
|
|
1907
1502
|
}
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
interface Props$4<TVisualQuery extends VisualQuery, TDataQuery extends DataQuery$1> {
|
|
1913
|
-
query: TVisualQuery;
|
|
1914
|
-
datasource: DataSourceApi<TDataQuery>;
|
|
1915
|
-
queryModeller: VisualQueryModeller;
|
|
1916
|
-
buildVisualQueryFromString: (queryString: string) => {
|
|
1917
|
-
query: TVisualQuery;
|
|
1918
|
-
};
|
|
1919
|
-
buildDataQueryFromQueryString: (queryString: string) => TDataQuery;
|
|
1920
|
-
buildQueryStringFromDataQuery: (dataQuery: TDataQuery) => string;
|
|
1921
|
-
onChange: (update: TVisualQuery) => void;
|
|
1922
|
-
data?: PanelData;
|
|
1503
|
+
interface RangeValidationRule extends BaseValidationRule {
|
|
1504
|
+
type: 'range';
|
|
1505
|
+
min?: number;
|
|
1506
|
+
max?: number;
|
|
1923
1507
|
}
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
interface Props$3 {
|
|
1930
|
-
mode: QueryEditorMode;
|
|
1931
|
-
onChange: (mode: QueryEditorMode) => void;
|
|
1508
|
+
interface LengthValidationRule extends BaseValidationRule {
|
|
1509
|
+
type: 'length';
|
|
1510
|
+
min?: number;
|
|
1511
|
+
max?: number;
|
|
1932
1512
|
}
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
label: string;
|
|
1513
|
+
interface ItemCountValidationRule extends BaseValidationRule {
|
|
1514
|
+
type: 'itemCount';
|
|
1515
|
+
min?: number;
|
|
1516
|
+
max?: number;
|
|
1938
1517
|
}
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
title: string;
|
|
1943
|
-
collapsedInfo: string[];
|
|
1944
|
-
queryStats?: QueryStats | null;
|
|
1518
|
+
interface AllowedValuesValidationRule extends BaseValidationRule {
|
|
1519
|
+
type: 'allowedValues';
|
|
1520
|
+
values: unknown[];
|
|
1945
1521
|
}
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
className?: string;
|
|
1522
|
+
interface CustomValidationRule extends BaseValidationRule {
|
|
1523
|
+
type: 'custom';
|
|
1524
|
+
/**
|
|
1525
|
+
* CEL expression.
|
|
1526
|
+
*
|
|
1527
|
+
* Should evaluate to true when the field value is valid.
|
|
1528
|
+
*/
|
|
1529
|
+
expression: Expression;
|
|
1955
1530
|
}
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1531
|
+
interface FieldOverride {
|
|
1532
|
+
/**
|
|
1533
|
+
* CEL condition
|
|
1534
|
+
*/
|
|
1535
|
+
when: Expression;
|
|
1536
|
+
defaultValue?: unknown;
|
|
1537
|
+
/**
|
|
1538
|
+
* When true, the field is disabled/read-only while this override is active.
|
|
1539
|
+
*/
|
|
1540
|
+
readOnly?: boolean;
|
|
1541
|
+
description?: string;
|
|
1542
|
+
placeholder?: string;
|
|
1543
|
+
tooltip?: string;
|
|
1544
|
+
validations?: FieldValidationRule[];
|
|
1545
|
+
options?: FieldOption[];
|
|
1546
|
+
/**
|
|
1547
|
+
* When present on an `isItemField` field, the value is routed to
|
|
1548
|
+
* `secureJsonData` under the resolved key instead of being stored
|
|
1549
|
+
* inline in the parent array.
|
|
1550
|
+
*
|
|
1551
|
+
* The template string supports placeholders:
|
|
1552
|
+
* - `{index}` — 0-based array position
|
|
1553
|
+
* - `{index1}` — 1-based array position
|
|
1554
|
+
* - `{item.KEY}` — value of sibling item field `KEY`
|
|
1555
|
+
*
|
|
1556
|
+
* Examples:
|
|
1557
|
+
* - `"secureHttpHeaders.{item.name}"` (ClickHouse)
|
|
1558
|
+
* - `"httpHeaderValue{index1}"` (Grafana core headers)
|
|
1559
|
+
*/
|
|
1560
|
+
secureKey?: string;
|
|
1961
1561
|
}
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1562
|
+
/**
|
|
1563
|
+
* Declares that when a field's value matches a condition,
|
|
1564
|
+
* listed target fields should be set to specified values.
|
|
1565
|
+
*
|
|
1566
|
+
* Use "value" in the `when` expression to refer to the field's value.
|
|
1567
|
+
*/
|
|
1568
|
+
interface FieldEffect {
|
|
1569
|
+
/**
|
|
1570
|
+
* CEL expression. Example: "value == 'basic-auth'"
|
|
1571
|
+
*/
|
|
1572
|
+
when: Expression;
|
|
1573
|
+
/**
|
|
1574
|
+
* Maps field IDs to the values they should be set to.
|
|
1575
|
+
* Must contain at least one entry.
|
|
1576
|
+
*/
|
|
1577
|
+
set: Record<string, unknown> & {
|
|
1578
|
+
[k: string]: unknown;
|
|
1579
|
+
};
|
|
1965
1580
|
}
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
storeQuery(target: TQuery, queryInfo: RunningQueryInfo): void;
|
|
1973
|
-
getQuery(target: TQuery): RunningQueryInfo;
|
|
1974
|
-
removeQuery(target: TQuery): void;
|
|
1975
|
-
doSingle(target: TQuery, request: DataQueryRequest<TQuery>): Observable<DataQueryResponse>;
|
|
1976
|
-
cancel: (target: TQuery) => void;
|
|
1581
|
+
type StorageMapping = DirectMapping | IndexedPairMapping | ComputedMapping;
|
|
1582
|
+
/**
|
|
1583
|
+
* Direct mapping
|
|
1584
|
+
*/
|
|
1585
|
+
interface DirectMapping {
|
|
1586
|
+
type: 'direct';
|
|
1977
1587
|
}
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1588
|
+
/**
|
|
1589
|
+
* Indexed pair mapping (headers)
|
|
1590
|
+
*/
|
|
1591
|
+
interface IndexedPairMapping {
|
|
1592
|
+
type: 'indexedPair';
|
|
1593
|
+
key: MappingField;
|
|
1594
|
+
value: MappingField;
|
|
1595
|
+
startIndex?: number;
|
|
1985
1596
|
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1597
|
+
/**
|
|
1598
|
+
* Computed mapping (virtual fields).
|
|
1599
|
+
* At least one of `read` or `write` must be provided.
|
|
1600
|
+
*/
|
|
1601
|
+
type ComputedMapping = {
|
|
1602
|
+
type: 'computed';
|
|
1603
|
+
read: Expression;
|
|
1604
|
+
write?: Expression;
|
|
1605
|
+
} | {
|
|
1606
|
+
type: 'computed';
|
|
1607
|
+
read?: Expression;
|
|
1608
|
+
write: Expression;
|
|
1609
|
+
};
|
|
1610
|
+
/**
|
|
1611
|
+
* Mapping field
|
|
1612
|
+
*/
|
|
1613
|
+
interface MappingField {
|
|
1614
|
+
target: TargetLocation;
|
|
1615
|
+
pattern: string;
|
|
1616
|
+
}
|
|
1617
|
+
interface FieldOption {
|
|
1618
|
+
label: string;
|
|
1989
1619
|
/**
|
|
1990
|
-
*
|
|
1620
|
+
* Must match parent field valueType.
|
|
1621
|
+
* Must not be null.
|
|
1991
1622
|
*/
|
|
1992
|
-
|
|
1623
|
+
value: NonNullable<unknown>;
|
|
1993
1624
|
/**
|
|
1994
|
-
*
|
|
1625
|
+
* Optional human-readable description of the option.
|
|
1995
1626
|
*/
|
|
1996
|
-
|
|
1627
|
+
description?: string;
|
|
1628
|
+
}
|
|
1629
|
+
interface ConfigGroup {
|
|
1630
|
+
id: string;
|
|
1631
|
+
title: string;
|
|
1632
|
+
description?: string;
|
|
1633
|
+
order?: number;
|
|
1997
1634
|
/**
|
|
1998
|
-
*
|
|
1635
|
+
* When true, the group is optional and can be collapsed/hidden by default.
|
|
1999
1636
|
*/
|
|
2000
|
-
|
|
1637
|
+
optional?: boolean;
|
|
2001
1638
|
/**
|
|
2002
|
-
*
|
|
1639
|
+
* References field IDs (not keys)
|
|
2003
1640
|
*/
|
|
2004
|
-
|
|
1641
|
+
fieldRefs: string[];
|
|
1642
|
+
}
|
|
1643
|
+
type RelationshipType = 'pair' | 'group' | 'datasourceReference';
|
|
1644
|
+
interface FieldRelationship {
|
|
1645
|
+
type: RelationshipType;
|
|
2005
1646
|
/**
|
|
2006
|
-
*
|
|
1647
|
+
* References field IDs
|
|
2007
1648
|
*/
|
|
2008
|
-
|
|
1649
|
+
fields: string[];
|
|
1650
|
+
description?: string;
|
|
1651
|
+
/**
|
|
1652
|
+
* Constrains the datasource UID to a specific plugin type.
|
|
1653
|
+
* Only applicable when type is "datasourceReference".
|
|
1654
|
+
*/
|
|
1655
|
+
targetPluginType?: string;
|
|
1656
|
+
}
|
|
1657
|
+
type SecureFieldState = {
|
|
1658
|
+
type: 'unset';
|
|
1659
|
+
} | {
|
|
1660
|
+
type: 'configured';
|
|
1661
|
+
} | {
|
|
1662
|
+
type: 'updated';
|
|
1663
|
+
value: string;
|
|
1664
|
+
};
|
|
1665
|
+
interface FormState {
|
|
1666
|
+
values: Record<string, unknown>;
|
|
1667
|
+
secure: Record<string, SecureFieldState>;
|
|
2009
1668
|
}
|
|
1669
|
+
|
|
2010
1670
|
/**
|
|
2011
|
-
*
|
|
1671
|
+
* Bundled datasource config schemas, used as a fallback when a schema cannot be
|
|
1672
|
+
* fetched from the Grafana plugins CDN (for example, when the CDN returns 404).
|
|
2012
1673
|
*/
|
|
2013
|
-
declare
|
|
1674
|
+
declare const staticSchemaRegistry: Map<string, DatasourceConfigSchema>;
|
|
1675
|
+
/**
|
|
1676
|
+
* Returns the bundled fallback schema for a plugin type, or `null` if none is
|
|
1677
|
+
* bundled.
|
|
1678
|
+
*/
|
|
1679
|
+
declare function getStaticConfigSchema(pluginType: string): DatasourceConfigSchema | null;
|
|
1680
|
+
|
|
1681
|
+
declare function getConfigSchemaUrl(pluginType: string): string;
|
|
1682
|
+
declare function getConfigSchema(pluginType: string): Promise<DatasourceConfigSchema | null>;
|
|
2014
1683
|
|
|
2015
|
-
export {
|
|
1684
|
+
export { AccessoryButton, AdvancedHttpSettings, type Aggregate, type AllowedValuesValidationRule, Auth, AuthMethod, type Props$c as AuthProps, BINARY_OPERATIONS_KEY, type BaseValidationRule, CatalogSelector, type ColumnDefinition, CompletionItemInsertTextRule, CompletionItemKind, CompletionItemPriority, type ComputedMapping, ConfigDescriptionLink, type ConfigField, type ConfigGroup, ConfigSection, ConfigSubSection, ConnectionSettings, CustomHeadersSettings, type CustomMeta, type CustomValidationRule, type DB, DataLink, type DataLinkConfig, DataLinks, DataSourceDescription, DataSourcePicker, DatasetSelector, type DatasourceConfigSchema, DatasourceWithAsyncBackend, DatePicker, type DatePickerProps, DatePickerWithInput, type DatePickerWithInputProps, DebounceInput, type DebounceInputProps, type DirectMapping, EditorField, EditorFieldGroup, EditorHeader, EditorList, EditorMode, EditorRow, EditorRows, EditorStack, EditorSwitch, type Expression, type FieldEffect, type FieldItemSchema, type FieldKind, type FieldOption, type FieldOverride, type FieldRelationship, type FieldUI, type FieldValidationRule, FlexItem, type FormState, GroupByRow, type IndexedPairMapping, InlineSelect, InputGroup, type ItemCountValidationRule, LabelFilters, type LanguageCompletionProvider, type LanguageDefinition, type LengthValidationRule, LinkedToken, MacroType, type MappingField, type MetaDefinition, type NameValue, OperationExplainedBox, OperationList, OperationListExplained, OperationsEditorRow, OperatorType, type PatternValidationRule, type PositionContext, type Props$s as Props, QUERY_FORMAT_OPTIONS, QueryBuilderHints, type QueryBuilderLabelFilter, type QueryBuilderOperation, type QueryBuilderOperationDefinition, type QueryBuilderOperationParamDef, type QueryBuilderOperationParamEditorProps, type QueryBuilderOperationParamValue, QueryEditorMode, QueryEditorModeToggle, type QueryEditorProps, QueryEditorRow, QueryFormat, QueryHeaderSwitch, QueryModellerBase, QueryOptionGroup, type QueryRowFilter, type QueryStats, type QueryWithDefaults, type RAQBFieldTypes, type RangeValidationRule, RawQuery, type RelationshipType, type RequestLoopOptions, type ResourceSelectorProps, type ResponseParser, RunQueryButton, RunQueryButtons, type RunQueryButtonsProps, type RunningQueryInfo, type SQLConnectionLimits, SQLEditor, SQLEditorMode, SQLEditorTestUtils, type SQLExpression, type SQLFilters, type SQLMonarchLanguage, type SQLOptions, type SQLQuery, type SQLSelectableValue, type SchemaDefinition, type SecureFieldState, SecureSocksProxyToggle, Segment, type SegmentProps, Space, SqlDatasource, SqlQueryEditor, type SqlQueryForInterpolation, type SqlQueryModel, type State$1 as State, type StatementPlacementProvider, StatementPosition, type StorageMapping, SuggestionKind, type SuggestionKindProvider, TLSSettings, type Props$f as TLSSettingsProps, type TableDefinition, type TableFieldSchema, type TableIdentifier, type TableSchema, TableSelector, type TargetLocation, type TestQueryModel, TokenType, type UIComponent, type UIWidth, type ValidationResults, type ValueType, type VisualQuery, type VisualQueryBinary, type VisualQueryModeller, convertLegacyAuthProps, formatDate, getConfigSchema, getConfigSchemaUrl, getRequestLooper, getStandardSQLCompletionProvider, getStaticConfigSchema, language as grafanaStandardSQLLanguage, conf as grafanaStandardSQLLanguageConf, staticSchemaRegistry, toOption };
|