import setupLogger from '@/config/logger' ; import { IDatastoreService } from '@/services/datastores/base/datastore' ; import { loadClass } from '@/utils/class-loader-utils' ; const logger = setupLogger ( module ) ; async function loadDatastore ( datastoreName ) { const DatastoreServiceClass = await loadClass < new ( ) => IDatastoreService < any > > ( `@/services/datastores/${ datastoreName }` ) ; return new DatastoreServiceClass ( ) ; } param supportedDatastores export async function setupDatastoreSupport ( supportedDatastores ) { const services = await Promise . all ( supportedDatastores . map ( ( datastoreName ) => loadDatastore ( datastoreName ) ) ) ; logger . info ( 'all datstores loaded' ) ; return services ; }