import { ConfigClient, ConfigRequire, Value } from '../src'
import { Container } from 'typescript-ioc'

process.env['KT_ME_ENV'] = "TEST"
process.env['KT_ME_ENV_KEY'] = "c8b5dcf116a64b87bad4f1e000fbc2db"
process.env['KT_CONFIG_LOCAL_PATH'] = "D:/test"
process.env['KT_CONFIG_SERVER_URL'] = "http://47.111.146.115:3008/conf/"

const configRequire: ConfigRequire = {
    version: '1.0',
    configCode: 'PC.database'
}

const client = Container.get(ConfigClient);
(
    async () => {
        await client.initClient([configRequire]);


        console.info(new Foo().config!!.toLowerCase())
        console.info(new Foo().infos!![0])
        console.info(typeof client.getConfig('infos'))
        console.info(typeof client.getAllConfig()['infos'])



    }
)()



export class Foo {

    @Value('config.test1:TESTAAAAA')
    config?: string

    @Value('infos')
    infos?: Array<string>

}