import { i18n } from '@kbn/i18n' ; import { PluginConfigDescriptor } from 'kibana/server' ; import { get } from 'lodash' ; import { ConfigSchema , ReportingConfigType } from './schema' ; export { buildConfig } from './config' ; export { registerUiSettings } from './ui_settings' ; export type { ReportingConfigType } ; export { ConfigSchema } ; export const config = { exposeToBrowser : { poll : true , roles : true } , schema : ConfigSchema , deprecations : ( { unused } ) => [ unused ( 'capture.browser.chromium.maxScreenshotDimension' , { level : 'warning' } ) , unused ( 'capture.browser.type' ) , unused ( 'poll.jobCompletionNotifier.intervalErrorMultiplier' , { level : 'warning' } ) , unused ( 'poll.jobsRefresh.intervalErrorMultiplier' , { level : 'warning' } ) , unused ( 'capture.viewport' , { level : 'warning' } ) , ( settings , fromPath , addDeprecation ) => { const reporting = get ( settings , fromPath ) ; if ( reporting ?. roles ?. enabled !== false ) { addDeprecation ( { configPath : `${ fromPath }.roles.enabled` , level : 'warning' , title : i18n . translate ( 'xpack.reporting.deprecations.reportingRoles.title' , { defaultMessage : `The "{fromPath}.roles" setting is deprecated` , values : { fromPath } , } ) , message : i18n . translate ( 'xpack.reporting.deprecations.reportingRoles.description' , { defaultMessage : `The default mechanism for Reporting privileges will work differently in future versions,` + ` which will affect the behavior of this cluster. Set "xpack.reporting.roles.enabled" to` + ` "false" to adopt the future behavior before upgrading.` , } ) , correctiveActions : { manualSteps : [ i18n . translate ( 'xpack.reporting.deprecations.reportingRoles.manualStepOne' , { defaultMessage : `Set "xpack.reporting.roles.enabled" to "false" in kibana.yml.` , } ) , i18n . translate ( 'xpack.reporting.deprecations.reportingRoles.manualStepTwo' , { defaultMessage : `Remove "xpack.reporting.roles.allow" in kibana.yml, if present.` , } ) , i18n . translate ( 'xpack.reporting.deprecations.reportingRoles.manualStepThree' , { defaultMessage : `Go to Management > Security > Roles to create one or more roles that grant` + ` the Kibana application privilege for Reporting.` , } ) , i18n . translate ( 'xpack.reporting.deprecations.reportingRoles.manualStepFour' , { defaultMessage : `Grant Reporting privileges to users by assigning one of the new roles.` , } ) , ] , } , } ) ; } } , ] , exposeToUsage : { capture : { maxAttempts : true , timeouts : { openUrl : true , renderComplete : true , waitForElements : true } , zoom : true , } , csv : { maxSizeBytes : true , scroll : { size : true , duration : true } } , kibanaServer : false , queue : { indexInterval : true , pollEnabled : true , timeout : true } , roles : { enabled : true } , } , } ;