import { schema } from '@kbn/config-schema' ; import { RouteDependencies } from '../../plugin' ; export function registerSecurityRoute ( { router , enterpriseSearchRequestHandler , } ) { router . get ( { path : '/internal/workplace_search/org/security' , validate : false , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/org/security' , } ) ) ; } export function registerSecuritySourceRestrictionsRoute ( { router , enterpriseSearchRequestHandler , } ) { router . get ( { path : '/internal/workplace_search/org/security/source_restrictions' , validate : false , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/org/security/source_restrictions' , } ) ) ; router . patch ( { path : '/internal/workplace_search/org/security/source_restrictions' , validate : { body : schema . object ( { isEnabled : schema . boolean ( ) , remote : schema . object ( { isEnabled : schema . boolean ( ) , contentSources : schema . arrayOf ( schema . object ( { isEnabled : schema . boolean ( ) , id : schema . string ( ) , name : schema . string ( ) , } ) ) , } ) , standard : schema . object ( { isEnabled : schema . boolean ( ) , contentSources : schema . arrayOf ( schema . object ( { isEnabled : schema . boolean ( ) , id : schema . string ( ) , name : schema . string ( ) , } ) ) , } ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/org/security/source_restrictions' , } ) ) ; } export const registerSecurityRoutes = ( dependencies ) => { registerSecurityRoute ( dependencies ) ; registerSecuritySourceRestrictionsRoute ( dependencies ) ; } ;