"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.plugin = exports.configSchema = exports.config = exports.CRAWLERS_INDEX = void 0;
var _configSchema = require("@kbn/config-schema");
var _plugin = require("./plugin");
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

const plugin = initializerContext => {
  return new _plugin.EnterpriseSearchPlugin(initializerContext);
};
exports.plugin = plugin;
const configSchema = _configSchema.schema.object({
  accessCheckTimeout: _configSchema.schema.number({
    defaultValue: 5000
  }),
  accessCheckTimeoutWarning: _configSchema.schema.number({
    defaultValue: 300
  }),
  canDeployEntSearch: _configSchema.schema.boolean({
    defaultValue: true
  }),
  customHeaders: _configSchema.schema.maybe(_configSchema.schema.object({}, {
    unknowns: 'allow'
  })),
  enabled: _configSchema.schema.boolean({
    defaultValue: true
  }),
  hasConnectors: _configSchema.schema.boolean({
    defaultValue: true
  }),
  hasDefaultIngestPipeline: _configSchema.schema.boolean({
    defaultValue: true
  }),
  hasDocumentLevelSecurityEnabled: _configSchema.schema.boolean({
    defaultValue: true
  }),
  hasIncrementalSyncEnabled: _configSchema.schema.boolean({
    defaultValue: true
  }),
  hasNativeConnectors: _configSchema.schema.boolean({
    defaultValue: true
  }),
  hasWebCrawler: _configSchema.schema.boolean({
    defaultValue: true
  }),
  host: _configSchema.schema.maybe(_configSchema.schema.string()),
  isCloud: _configSchema.schema.boolean({
    defaultValue: false
  }),
  ssl: _configSchema.schema.object({
    certificateAuthorities: _configSchema.schema.maybe(_configSchema.schema.oneOf([_configSchema.schema.arrayOf(_configSchema.schema.string(), {
      minSize: 1
    }), _configSchema.schema.string()])),
    verificationMode: _configSchema.schema.oneOf([_configSchema.schema.literal('none'), _configSchema.schema.literal('certificate'), _configSchema.schema.literal('full')], {
      defaultValue: 'full'
    })
  }),
  ui: _configSchema.schema.object({
    enabled: _configSchema.schema.boolean({
      defaultValue: true
    })
  })
});
exports.configSchema = configSchema;
const config = {
  exposeToBrowser: {
    canDeployEntSearch: true,
    host: true,
    ui: true
  },
  schema: configSchema
};
exports.config = config;
const CRAWLERS_INDEX = '.ent-search-actastic-crawler2_configurations_v2';
exports.CRAWLERS_INDEX = CRAWLERS_INDEX;