import { schema } from '@kbn/config-schema' ; import { RouteDependencies } from '../../plugin' ; const MAX_IMAGE_BYTES = 2000000 ; export function registerOrgSettingsRoute ( { router , enterpriseSearchRequestHandler , } ) { router . get ( { path : '/internal/workplace_search/org/settings' , validate : false , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/org/settings' , } ) ) ; } export function registerOrgSettingsCustomizeRoute ( { router , enterpriseSearchRequestHandler , } ) { router . put ( { path : '/internal/workplace_search/org/settings/customize' , validate : { body : schema . object ( { name : schema . string ( ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/org/settings/customize' , } ) ) ; } export function registerOrgSettingsUploadImagesRoute ( { router , enterpriseSearchRequestHandler , } ) { router . put ( { path : '/internal/workplace_search/org/settings/upload_images' , validate : { body : schema . object ( { logo : schema . maybe ( schema . nullable ( schema . string ( ) ) ) , icon : schema . maybe ( schema . nullable ( schema . string ( ) ) ) , } ) , } , options : { body : { maxBytes : MAX_IMAGE_BYTES , } , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/org/settings/upload_images' , } ) ) ; } export function registerOrgSettingsOauthApplicationRoute ( { router , enterpriseSearchRequestHandler , } ) { router . put ( { path : '/internal/workplace_search/org/settings/oauth_application' , validate : { body : schema . object ( { oauth_application : schema . object ( { name : schema . string ( ) , confidential : schema . boolean ( ) , redirect_uri : schema . string ( ) , } ) , } ) , } , } , enterpriseSearchRequestHandler . createRequest ( { path : '/ws/org/settings/oauth_application' , } ) ) ; } export const registerSettingsRoutes = ( dependencies ) => { registerOrgSettingsRoute ( dependencies ) ; registerOrgSettingsCustomizeRoute ( dependencies ) ; registerOrgSettingsUploadImagesRoute ( dependencies ) ; registerOrgSettingsOauthApplicationRoute ( dependencies ) ; } ;