@@ -4,25 +4,25 @@ import { mergeDeepRight } from 'ramda';
44
55import { log } from './logger' ;
66import * as fs from './util/fs' ;
7- import Connection from './domain/Connection ' ;
8- import Configuration from './domain/Configuration ' ;
7+ import DbConfig from './domain/DbConfig ' ;
8+ import SyncConfig from './domain/SyncConfig ' ;
99import ConnectionConfig from './domain/ConnectionConfig' ;
1010import { DEFAULT_CONFIG , CONFIG_FILENAME , CONNECTIONS_FILENAME } from './constants' ;
1111
1212/**
1313 * Load config yaml file.
1414 *
15- * @returns {Promise<Configuration > }
15+ * @returns {Promise<SyncConfig > }
1616 */
17- export async function loadConfig ( ) : Promise < Configuration > {
17+ export async function loadConfig ( ) : Promise < SyncConfig > {
1818 log ( 'Resolving sync config file.' ) ;
1919
2020 const filename = path . resolve ( process . cwd ( ) , CONFIG_FILENAME ) ;
21- const migrations = ( await yaml . load ( filename ) ) as Configuration ;
21+ const migrations = await yaml . load ( filename ) as SyncConfig ;
2222
2323 log ( 'Resolved sync config file.' ) ;
2424
25- const loaded = mergeDeepRight ( DEFAULT_CONFIG , migrations ) as Configuration ;
25+ const loaded = mergeDeepRight ( DEFAULT_CONFIG , migrations ) as SyncConfig ;
2626
2727 // TODO: Validate the loaded config.
2828
@@ -32,20 +32,19 @@ export async function loadConfig(): Promise<Configuration> {
3232/**
3333 * Resolve database connections.
3434 *
35- * @returns {Promise<Connection []> }
35+ * @returns {Promise<ConnectionConfig []> }
3636 */
37- export async function resolveConnections ( ) : Promise < Connection [ ] > {
37+ export async function resolveConnections ( ) : Promise < ConnectionConfig [ ] > {
3838 log ( 'Resolving database connections.' ) ;
3939
4040 const filename = path . resolve ( process . cwd ( ) , CONNECTIONS_FILENAME ) ;
4141
4242 log ( 'Resolving file: %s' , filename ) ;
4343
4444 const loaded = await fs . read ( filename ) ;
45- const { connections } = JSON . parse ( loaded ) as ConnectionConfig ;
45+ const { connections } = JSON . parse ( loaded ) as DbConfig ;
4646
4747 // TODO: Validate the connections received from file.
48-
4948 const result = connections . map ( connection => ( {
5049 ...connection ,
5150 id : connection . id || `${ connection . host } /${ connection . database } `
0 commit comments