import * as plugins from './qenv.plugins.js'; export class ConfigVaultAdapter { public configVaultUrl: string; constructor(configVaultUrl?: string) { this.configVaultUrl = configVaultUrl; } public async getConfigBundle(): Promise { if (this.configVaultUrl) { console.log(`ConfigVault specified through constructor`) } else if (process.env['CONFIGVAULT_URL']) { this.configVaultUrl = process.env['CONFIGVAULT_URL']; } else { return null; } const parsedUrl = new URL(this.configVaultUrl); const tr = new plugins.typedrequest.TypedRequest( `${parsedUrl.host}/typedrequest`, 'getConfigBundle' ); const response = await tr.fire({ authorization: parsedUrl.pathname.replace('/', ''), }) } }