import { createSavedObjectClass , SavedObject , SavedObjectOpenSearchDashboardsServices , } from '../../../saved_objects/public' ; export function createSavedSearchClass ( services ) { const SavedObjectClass = createSavedObjectClass ( services ) ; class SavedSearch extends SavedObjectClass { public static type : string = 'search' ; public static mapping = { title : 'text' , description : 'text' , hits : 'integer' , columns : 'keyword' , sort : 'keyword' , version : 'integer' , } ; public static fieldOrder = [ 'title' , 'description' ] ; public static searchSource = true ; public id : string ; public showInRecentlyAccessed : boolean ; constructor ( id ) { super ( { id , type : 'search' , mapping : { title : 'text' , description : 'text' , hits : 'integer' , columns : 'keyword' , sort : 'keyword' , version : 'integer' , } , searchSource : true , defaults : { title : '' , description : '' , columns : [ ] , hits : 0 , sort : [ ] , version : 1 , } , } ) ; this . showInRecentlyAccessed = true ; this . id = id ; this . getFullPath = ( ) => `/app/discover#/view/${ String ( id ) }` ; } } return SavedSearch as new ( id ) => SavedObject ; }