import { S3DBConfiguration } from './Configuration' ; import { Logger , LoggerService , LogLevelString } from '@mu-ts/logger' ; /**
 * All configurations are referenced from here. It is the record of truth for
 * the current state of the s3db Configuration.
 */ export class S3DB { param configuration public static update ( configuration ) { this . logger . info ( 'configuration with -->' , configuration , 'update()' ) ; this . configuration = { ... this . configuration , ... configuration } ; this . logger . info ( 'updated configuration is <--' , this . configuration , 'update()' ) ; } /**
     * Returns the root logger, namespaced with 'S3DB'.
     */ public static getRootLogger ( ) { return this . logger ; } param level public static setLogLevel ( level ) { this . logger . setLevel ( level ) ; } param name public static getCollectionFQN ( name ) { return this . configuration . bucketPattern . replace ( '{{stage}}' , this . configuration . stage ) . replace ( '{{region}}' , this . getRegion ( ) ) . replace ( '{{baseName}}' , this . configuration . baseName ) . replace ( '{{bucketName}}' , name ) ; } /**
     * The currently configured region.
     */ public static getRegion ( ) { return this . configuration . region || 'us-west-2' ; } private static configuration : S3DBConfiguration = new S3DBConfiguration ( ) ; private static logger : Logger = LoggerService . named ( { name : 'S3DB' , level : 'warn' , adornments : { lib : 's3-db' } } ) ; private constructor ( ) { } }