import { SavedObject , SavedObjectsClientContract } from 'src/core/server' ; export async function importDashboards ( savedObjectsClient , objects , { overwrite , exclude } ) { const docs = objects . filter ( ( item ) => ! exclude . includes ( item . type ) ) . map ( ( { version , ... doc } ) => ( { ... doc , migrationVersion : doc . migrationVersion || { } } ) ) ; const results = await savedObjectsClient . bulkCreate ( docs , { overwrite } ) ; return { objects : results . saved_objects } ; }