var $schema = "../schema.json";
var schemaVersion = "v1";
var pluginType = "grafana-cockroachdb-datasource";
var pluginName = "CockroachDB";
var fields = [
	{
		id: "jsonData.host",
		key: "host",
		label: "Host",
		description: "CockroachDB host address.",
		valueType: "string",
		target: "jsonData",
		required: true
	},
	{
		id: "jsonData.port",
		key: "port",
		label: "Port",
		description: "CockroachDB port.",
		valueType: "number",
		target: "jsonData",
		defaultValue: 26257
	},
	{
		id: "jsonData.database",
		key: "database",
		label: "Database",
		description: "Database name.",
		valueType: "string",
		target: "jsonData",
		required: true
	},
	{
		id: "jsonData.user",
		key: "user",
		label: "User",
		description: "Database user.",
		valueType: "string",
		target: "jsonData",
		required: true
	},
	{
		id: "jsonData.sslmode",
		key: "sslmode",
		label: "SSL Mode",
		description: "SSL/TLS mode.",
		valueType: "string",
		target: "jsonData",
		defaultValue: "verify-full",
		validations: [
			{
				type: "allowedValues",
				values: [
					"disable",
					"require",
					"verify-ca",
					"verify-full"
				]
			}
		]
	},
	{
		id: "jsonData.connMaxLifetime",
		key: "connMaxLifetime",
		label: "Max connection lifetime",
		description: "Maximum lifetime of a connection in seconds. 0 means unlimited.",
		valueType: "number",
		target: "jsonData",
		defaultValue: 14400
	},
	{
		id: "jsonData.maxIdleConns",
		key: "maxIdleConns",
		label: "Max idle connections",
		description: "Maximum number of idle connections.",
		valueType: "number",
		target: "jsonData",
		defaultValue: 100
	},
	{
		id: "jsonData.maxIdleConnsAuto",
		key: "maxIdleConnsAuto",
		label: "Auto idle connections",
		description: "Automatically set idle connections.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: true,
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.maxOpenConns",
		key: "maxOpenConns",
		label: "Max open connections",
		description: "Maximum number of open connections.",
		valueType: "number",
		target: "jsonData",
		defaultValue: 100
	},
	{
		id: "jsonData.postgresVersion",
		key: "postgresVersion",
		label: "Version",
		description: "PostgreSQL compatibility version.",
		valueType: "number",
		target: "jsonData",
		defaultValue: 903
	},
	{
		id: "jsonData.timescaledb",
		key: "timescaledb",
		label: "TimescaleDB",
		description: "Enable TimescaleDB time-bucket support.",
		valueType: "boolean",
		target: "jsonData",
		defaultValue: false,
		ui: {
			component: "switch"
		}
	},
	{
		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.",
		valueType: "boolean",
		target: "jsonData",
		ui: {
			component: "switch"
		}
	},
	{
		id: "jsonData.tlsConfigurationMethod",
		key: "tlsConfigurationMethod",
		label: "TLS Configuration Method",
		description: "How to provide TLS certificates.",
		valueType: "string",
		target: "jsonData",
		defaultValue: "file-content",
		validations: [
			{
				type: "allowedValues",
				values: [
					"file-path",
					"file-content"
				]
			}
		]
	},
	{
		id: "jsonData.sslRootCertFile",
		key: "sslRootCertFile",
		label: "SSL Root Cert File",
		description: "Path to the SSL root certificate.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.tlsConfigurationMethod == 'file-path'"
	},
	{
		id: "jsonData.sslCertFile",
		key: "sslCertFile",
		label: "SSL Client Cert File",
		description: "Path to the SSL client certificate.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.tlsConfigurationMethod == 'file-path'"
	},
	{
		id: "jsonData.sslKeyFile",
		key: "sslKeyFile",
		label: "SSL Client Key File",
		description: "Path to the SSL client key.",
		valueType: "string",
		target: "jsonData",
		dependsOn: "jsonData.tlsConfigurationMethod == 'file-path'"
	},
	{
		id: "secureJsonData.password",
		key: "password",
		label: "Password",
		description: "Database password.",
		valueType: "string",
		semanticType: "password",
		target: "secureJsonData"
	},
	{
		id: "secureJsonData.tlsCACert",
		key: "tlsCACert",
		label: "CA Cert",
		description: "PEM-encoded CA certificate.",
		valueType: "string",
		target: "secureJsonData",
		dependsOn: "jsonData.tlsConfigurationMethod == 'file-content'",
		ui: {
			component: "textarea",
			rows: 7
		}
	},
	{
		id: "secureJsonData.tlsClientCert",
		key: "tlsClientCert",
		label: "Client Cert",
		description: "PEM-encoded client certificate.",
		valueType: "string",
		target: "secureJsonData",
		dependsOn: "jsonData.tlsConfigurationMethod == 'file-content'",
		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.tlsConfigurationMethod == 'file-content'",
		ui: {
			component: "textarea",
			rows: 7
		}
	}
];
var groups = [
	{
		id: "connection",
		title: "Connection",
		fieldRefs: [
			"jsonData.host",
			"jsonData.port",
			"jsonData.database"
		]
	},
	{
		id: "auth",
		title: "Authentication",
		fieldRefs: [
			"jsonData.user",
			"secureJsonData.password"
		]
	},
	{
		id: "ssl",
		title: "SSL / TLS",
		fieldRefs: [
			"jsonData.sslmode",
			"jsonData.tlsAuth",
			"jsonData.tlsAuthWithCACert",
			"jsonData.tlsConfigurationMethod",
			"jsonData.sslRootCertFile",
			"jsonData.sslCertFile",
			"jsonData.sslKeyFile",
			"secureJsonData.tlsCACert",
			"secureJsonData.tlsClientCert",
			"secureJsonData.tlsClientKey"
		]
	},
	{
		id: "pool",
		title: "Connection Pool",
		fieldRefs: [
			"jsonData.connMaxLifetime",
			"jsonData.maxIdleConns",
			"jsonData.maxIdleConnsAuto",
			"jsonData.maxOpenConns"
		]
	},
	{
		id: "compat",
		title: "Compatibility",
		fieldRefs: [
			"jsonData.postgresVersion",
			"jsonData.timescaledb"
		]
	}
];
var grafanaCockroachdbDatasourceSchema = {
	$schema: $schema,
	schemaVersion: schemaVersion,
	pluginType: pluginType,
	pluginName: pluginName,
	fields: fields,
	groups: groups
};

export { $schema, grafanaCockroachdbDatasourceSchema as default, fields, groups, pluginName, pluginType, schemaVersion };
//# sourceMappingURL=grafana-cockroachdb-datasource.schema.json.js.map
