var $schema = "../schema.json";
var schemaVersion = "v1";
var pluginType = "influxdb";
var pluginName = "InfluxDB";
var docURL = "https://grafana.com/docs/grafana/latest/datasources/influxdb/configure/";
var fields = [
	{
		id: "root.url",
		key: "url",
		label: "URL",
		description: "The HTTP protocol, IP address, and port of your InfluxDB API. The default API port is 8086. When you enter a URL, Grafana attempts to auto-detect your InfluxDB product.",
		valueType: "string",
		semanticType: "url",
		target: "root",
		required: true,
		ui: {
			component: "input",
			placeholder: "http://localhost:8086"
		},
		validations: [
			{
				type: "pattern",
				pattern: "^https?://",
				message: "Must be a valid HTTP or HTTPS URL"
			}
		]
	},
	{
		id: "jsonData.product",
		key: "product",
		label: "Product",
		description: "Select the InfluxDB product you're connecting to. The available query languages depend on your product selection. Use InfluxDB detection to identify the product from the URL.",
		valueType: "string",
		target: "jsonData",
		validations: [
			{
				type: "allowedValues",
				values: [
					"InfluxDB Cloud Dedicated",
					"InfluxDB Cloud Serverless",
					"InfluxDB Clustered",
					"InfluxDB Enterprise 1.x",
					"InfluxDB Enterprise 3.x",
					"InfluxDB Cloud (TSM)",
					"InfluxDB Cloud 1",
					"InfluxDB OSS 1.x",
					"InfluxDB OSS 2.x",
					"InfluxDB OSS 3.x"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "InfluxDB Cloud Dedicated",
					value: "InfluxDB Cloud Dedicated"
				},
				{
					label: "InfluxDB Cloud Serverless",
					value: "InfluxDB Cloud Serverless"
				},
				{
					label: "InfluxDB Clustered",
					value: "InfluxDB Clustered"
				},
				{
					label: "InfluxDB Enterprise 1.x",
					value: "InfluxDB Enterprise 1.x"
				},
				{
					label: "InfluxDB Enterprise 3.x",
					value: "InfluxDB Enterprise 3.x"
				},
				{
					label: "InfluxDB Cloud (TSM)",
					value: "InfluxDB Cloud (TSM)"
				},
				{
					label: "InfluxDB Cloud 1",
					value: "InfluxDB Cloud 1"
				},
				{
					label: "InfluxDB OSS 1.x",
					value: "InfluxDB OSS 1.x"
				},
				{
					label: "InfluxDB OSS 2.x",
					value: "InfluxDB OSS 2.x"
				},
				{
					label: "InfluxDB OSS 3.x",
					value: "InfluxDB OSS 3.x"
				}
			]
		}
	},
	{
		id: "jsonData.version",
		key: "version",
		label: "Query language",
		description: "The query language depends on product selection.",
		valueType: "string",
		target: "jsonData",
		required: true,
		validations: [
			{
				type: "allowedValues",
				values: [
					"InfluxQL",
					"Flux",
					"SQL"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "SQL",
					value: "SQL"
				},
				{
					label: "InfluxQL",
					value: "InfluxQL"
				},
				{
					label: "Flux",
					value: "Flux"
				}
			]
		},
		overrides: [
			{
				when: "jsonData.product == 'InfluxDB Cloud Dedicated' || jsonData.product == 'InfluxDB Clustered' || jsonData.product == 'InfluxDB Enterprise 3.x' || jsonData.product == 'InfluxDB OSS 3.x'",
				options: [
					{
						label: "SQL",
						value: "SQL"
					},
					{
						label: "InfluxQL",
						value: "InfluxQL"
					}
				],
				validations: [
					{
						type: "allowedValues",
						values: [
							"SQL",
							"InfluxQL"
						]
					}
				]
			},
			{
				when: "jsonData.product == 'InfluxDB Cloud Serverless'",
				options: [
					{
						label: "SQL",
						value: "SQL"
					},
					{
						label: "InfluxQL",
						value: "InfluxQL"
					},
					{
						label: "Flux",
						value: "Flux"
					}
				],
				validations: [
					{
						type: "allowedValues",
						values: [
							"SQL",
							"InfluxQL",
							"Flux"
						]
					}
				]
			},
			{
				when: "jsonData.product == 'InfluxDB Cloud (TSM)' || jsonData.product == 'InfluxDB OSS 1.x' || jsonData.product == 'InfluxDB OSS 2.x' || jsonData.product == 'InfluxDB Enterprise 1.x'",
				options: [
					{
						label: "InfluxQL",
						value: "InfluxQL"
					},
					{
						label: "Flux",
						value: "Flux"
					}
				],
				validations: [
					{
						type: "allowedValues",
						values: [
							"InfluxQL",
							"Flux"
						]
					}
				]
			},
			{
				when: "jsonData.product == 'InfluxDB Cloud 1'",
				options: [
					{
						label: "InfluxQL",
						value: "InfluxQL"
					}
				],
				validations: [
					{
						type: "allowedValues",
						values: [
							"InfluxQL"
						]
					}
				]
			}
		]
	},
	{
		id: "jsonData.timeInterval",
		key: "timeInterval",
		label: "Min time interval",
		description: "A lower limit for the auto group-by time interval. Recommended to be set to write frequency, for example 1m if your data is written every minute. Available for InfluxQL and Flux.",
		valueType: "string",
		semanticType: "duration",
		target: "jsonData",
		defaultValue: "10s",
		ui: {
			component: "input",
			placeholder: "10s"
		}
	},
	{
		id: "jsonData.showTagTime",
		key: "showTagTime",
		label: "Autocomplete range",
		description: "Time range for the query editor autocomplete to reduce tag filter query execution time. Tags not present within this range are filtered out. Recommended for large databases.",
		valueType: "string",
		semanticType: "duration",
		target: "jsonData",
		dependsOn: "jsonData.version == 'InfluxQL'",
		ui: {
			component: "input",
			placeholder: "12h"
		}
	},
	{
		id: "jsonData.httpMode",
		key: "httpMode",
		label: "HTTP Method",
		description: "You can use either GET or POST HTTP method to query your InfluxDB database. The POST method allows you to perform heavy requests while the GET method will restrict you and return an error if the query is too large.",
		valueType: "string",
		target: "jsonData",
		defaultValue: "GET",
		dependsOn: "jsonData.version == 'InfluxQL'",
		validations: [
			{
				type: "allowedValues",
				values: [
					"GET",
					"POST"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "POST",
					value: "POST"
				},
				{
					label: "GET",
					value: "GET"
				}
			]
		}
	},
	{
		id: "jsonData.dbName",
		key: "dbName",
		label: "Database",
		description: "InfluxDB database name. Used by InfluxQL and SQL query languages.",
		valueType: "string",
		target: "jsonData",
		ui: {
			component: "input",
			placeholder: "mydb"
		}
	},
	{
		id: "root.user",
		key: "user",
		label: "User",
		description: "Username for InfluxQL authentication.",
		valueType: "string",
		target: "root",
		dependsOn: "jsonData.version == 'InfluxQL'",
		requiredWhen: "jsonData.version == 'InfluxQL'",
		ui: {
			component: "input",
			placeholder: "myuser"
		}
	},
	{
		id: "jsonData.oauthPassThru",
		key: "oauthPassThru",
		label: "Forward OAuth Identity",
		description: "Forward the user's upstream OAuth identity to InfluxDB.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: false,
		tags: [
			"managed-by:auth.method"
		]
	},
	{
		id: "root.basicAuth",
		key: "basicAuth",
		label: "Basic Auth",
		description: "Enable basic authentication.",
		valueType: "boolean",
		target: "root",
		defaultValue: false,
		tags: [
			"managed-by:auth.method"
		]
	},
	{
		id: "auth.method",
		key: "authMethod",
		label: "Authentication method",
		description: "Choose an authentication method to access the data source.",
		valueType: "string",
		kind: "virtual",
		defaultValue: "no-auth",
		validations: [
			{
				type: "allowedValues",
				values: [
					"no-auth",
					"basic-auth",
					"forward-oauth"
				]
			}
		],
		ui: {
			component: "select",
			options: [
				{
					label: "No Authentication",
					value: "no-auth",
					description: "Data source is available without authentication"
				},
				{
					label: "Basic authentication",
					value: "basic-auth",
					description: "Authenticate with your data source username and password"
				},
				{
					label: "Forward OAuth Identity",
					value: "forward-oauth",
					description: "Forward the OAuth access token of the user querying the data source"
				}
			]
		},
		storage: {
			type: "computed",
			read: "root.basicAuth == true ? 'basic-auth' : (jsonData.oauthPassThru == true ? 'forward-oauth' : 'no-auth')"
		},
		effects: [
			{
				when: "value == 'no-auth'",
				set: {
					"root.basicAuth": false,
					"jsonData.oauthPassThru": false
				}
			},
			{
				when: "value == 'basic-auth'",
				set: {
					"root.basicAuth": true,
					"jsonData.oauthPassThru": false
				}
			},
			{
				when: "value == 'forward-oauth'",
				set: {
					"root.basicAuth": false,
					"jsonData.oauthPassThru": true
				}
			}
		]
	},
	{
		id: "root.basicAuthUser",
		key: "basicAuthUser",
		label: "Username",
		description: "Username for basic HTTP authentication.",
		valueType: "string",
		target: "root",
		dependsOn: "auth.method == 'basic-auth'",
		requiredWhen: "auth.method == 'basic-auth'"
	},
	{
		id: "secureJsonData.basicAuthPassword",
		key: "basicAuthPassword",
		label: "Password",
		description: "Password for basic HTTP authentication.",
		valueType: "string",
		semanticType: "password",
		target: "secureJsonData",
		dependsOn: "auth.method == 'basic-auth'"
	},
	{
		id: "jsonData.organization",
		key: "organization",
		label: "Organization",
		description: "InfluxDB organization ID.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.version == 'Flux'",
		requiredWhen: "jsonData.version == 'Flux'"
	},
	{
		id: "jsonData.defaultBucket",
		key: "defaultBucket",
		label: "Default Bucket",
		description: "Default bucket for Flux queries.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.version == 'Flux'",
		requiredWhen: "jsonData.version == 'Flux'",
		ui: {
			component: "input",
			placeholder: "mybucket"
		}
	},
	{
		id: "jsonData.maxSeries",
		key: "maxSeries",
		label: "Max series",
		description: "Limit the number of series/tables that Grafana will process. Lower this to prevent abuse, increase if you have many small time series. Defaults to 1000.",
		valueType: "number",
		target: "jsonData",
		defaultValue: 1000,
		ui: {
			component: "input",
			placeholder: "1000"
		}
	},
	{
		id: "jsonData.metadata",
		key: "metadata",
		label: "Metadata",
		description: "SQL-mode metadata configuration.",
		valueType: "array",
		target: "jsonData",
		item: {
			valueType: "map",
			item: {
				valueType: "string"
			}
		},
		dependsOn: "jsonData.version == 'SQL'"
	},
	{
		id: "jsonData.insecureGrpc",
		key: "insecureGrpc",
		label: "Insecure gRPC connection",
		description: "Use insecure (non-TLS) gRPC connection for SQL queries.",
		valueType: "boolean",
		target: "jsonData",
		dependsOn: "jsonData.version == 'SQL'",
		ui: {
			component: "switch"
		}
	},
	{
		id: "secureJsonData.token",
		key: "token",
		label: "Token",
		description: "Authentication token. Required for Flux and SQL query languages.",
		valueType: "string",
		semanticType: "token",
		target: "secureJsonData",
		dependsOn: "jsonData.version == 'Flux' || jsonData.version == 'SQL'"
	},
	{
		id: "secureJsonData.password",
		key: "password",
		label: "Password",
		description: "Password for InfluxQL authentication.",
		valueType: "string",
		semanticType: "password",
		target: "secureJsonData",
		dependsOn: "jsonData.version == 'InfluxQL'",
		requiredWhen: "jsonData.version == 'InfluxQL'"
	},
	{
		id: "jsonData.tlsAuth",
		key: "tlsAuth",
		label: "TLS Client Auth",
		description: "Enable TLS client certificate authentication.",
		valueType: "boolean",
		target: "jsonData",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.tlsAuthWithCACert",
		key: "tlsAuthWithCACert",
		label: "With CA Cert",
		description: "Provide a CA certificate for TLS verification.",
		valueType: "boolean",
		target: "jsonData",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.serverName",
		key: "serverName",
		label: "Server name",
		description: "Server name for SNI in TLS handshake.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.tlsAuth == true"
	},
	{
		id: "secureJsonData.tlsCACert",
		key: "tlsCACert",
		label: "CA Cert",
		description: "PEM-encoded CA certificate.",
		valueType: "string",
		target: "secureJsonData",
		dependsOn: "jsonData.tlsAuthWithCACert == true",
		ui: {
			component: "textarea",
			rows: 7
		}
	},
	{
		id: "secureJsonData.tlsClientCert",
		key: "tlsClientCert",
		label: "Client Cert",
		description: "PEM-encoded client certificate.",
		valueType: "string",
		target: "secureJsonData",
		dependsOn: "jsonData.tlsAuth == true",
		ui: {
			component: "textarea",
			rows: 7
		}
	},
	{
		id: "secureJsonData.tlsClientKey",
		key: "tlsClientKey",
		label: "Client Key",
		description: "PEM-encoded client private key.",
		valueType: "string",
		semanticType: "token",
		target: "secureJsonData",
		dependsOn: "jsonData.tlsAuth == true",
		ui: {
			component: "textarea",
			rows: 7
		}
	},
	{
		id: "jsonData.tlsSkipVerify",
		key: "tlsSkipVerify",
		label: "Skip TLS Verify",
		description: "Skip server certificate verification.",
		valueType: "boolean",
		target: "jsonData",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.keepCookies",
		key: "keepCookies",
		label: "Allowed cookies",
		description: "Grafana proxy deletes forwarded cookies by default. Specify cookies by name that should be forwarded to the data source.",
		valueType: "array",
		target: "jsonData",
		item: {
			valueType: "string"
		}
	},
	{
		id: "jsonData.timeout",
		key: "timeout",
		label: "Timeout",
		description: "HTTP request timeout in seconds.",
		valueType: "number",
		target: "jsonData",
		ui: {
			component: "input",
			placeholder: "Timeout in seconds"
		}
	},
	{
		id: "httpHeaders",
		key: "httpHeaders",
		label: "Custom HTTP Headers",
		description: "Custom HTTP headers sent with every request to the data source.",
		valueType: "array",
		target: "jsonData",
		storage: {
			type: "indexedPair",
			key: {
				pattern: "httpHeaderName{index}",
				target: "jsonData"
			},
			value: {
				pattern: "httpHeaderValue{index}",
				target: "secureJsonData"
			},
			startIndex: 1
		},
		item: {
			valueType: "object"
		}
	},
	{
		id: "jsonData.pdcInjected",
		key: "pdcInjected",
		label: "Private data source connect",
		description: "Connect to data sources in private networks using Grafana Cloud's Private Data Source Connect.",
		valueType: "boolean",
		target: "jsonData",
		ui: {
			component: "switch"
		}
	}
];
var groups = [
	{
		id: "connection",
		title: "Connection & HTTP settings",
		description: "Enter the URL, select your product and query language, and configure HTTP options.",
		fieldRefs: [
			"root.url",
			"jsonData.product",
			"jsonData.version",
			"jsonData.keepCookies",
			"jsonData.timeout",
			"httpHeaders",
			"jsonData.pdcInjected"
		]
	},
	{
		id: "auth",
		title: "Authentication",
		description: "Choose an authentication method for the data source.",
		fieldRefs: [
			"auth.method",
			"root.basicAuth",
			"root.basicAuthUser",
			"secureJsonData.basicAuthPassword",
			"jsonData.oauthPassThru"
		]
	},
	{
		id: "tls",
		title: "TLS settings",
		description: "Configure TLS client certificates and verification.",
		fieldRefs: [
			"jsonData.tlsAuth",
			"jsonData.serverName",
			"secureJsonData.tlsClientCert",
			"secureJsonData.tlsClientKey",
			"jsonData.tlsAuthWithCACert",
			"secureJsonData.tlsCACert",
			"jsonData.tlsSkipVerify"
		]
	},
	{
		id: "database-settings",
		title: "Database settings",
		description: "Provide database connection details based on your selected product and query language.",
		fieldRefs: [
			"jsonData.dbName",
			"root.user",
			"secureJsonData.password",
			"secureJsonData.token",
			"jsonData.organization",
			"jsonData.defaultBucket",
			"jsonData.httpMode",
			"jsonData.timeInterval",
			"jsonData.showTagTime",
			"jsonData.maxSeries",
			"jsonData.insecureGrpc",
			"jsonData.metadata"
		]
	}
];
var influxdbSchema = {
	$schema: $schema,
	schemaVersion: schemaVersion,
	pluginType: pluginType,
	pluginName: pluginName,
	docURL: docURL,
	fields: fields,
	groups: groups
};

export { $schema, influxdbSchema as default, docURL, fields, groups, pluginName, pluginType, schemaVersion };
//# sourceMappingURL=influxdb.schema.json.js.map
