import { schema , TypeOf } from '@kbn/config-schema' ; import { NEWSFEED_DEFAULT_SERVICE_PATH , NEWSFEED_DEFAULT_SERVICE_BASE_URL , NEWSFEED_DEV_SERVICE_BASE_URL , } from '../common/constants' ; export const configSchema = schema . object ( { enabled : schema . boolean ( { defaultValue : true } ) , service : schema . object ( { pathTemplate : schema . string ( { defaultValue : NEWSFEED_DEFAULT_SERVICE_PATH } ) , urlRoot : schema . conditional ( schema . contextRef ( 'prod' ) , schema . literal ( true ) , schema . string ( { defaultValue : NEWSFEED_DEFAULT_SERVICE_BASE_URL } ) , schema . string ( { defaultValue : NEWSFEED_DEV_SERVICE_BASE_URL } ) ) , } ) , mainInterval : schema . duration ( { defaultValue : '2m' } ) , fetchInterval : schema . duration ( { defaultValue : '1d' } ) , } ) ; export type NewsfeedConfigType = TypeOf < typeof configSchema > ;