fix(core): update
This commit is contained in:
		@@ -34,6 +34,7 @@
 | 
			
		||||
    "@types/node": "^20.4.6"
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@api.global/typedrequest": "^3.0.1",
 | 
			
		||||
    "@configvault.io/interfaces": "^1.0.2",
 | 
			
		||||
    "@push.rocks/smartfile": "^10.0.28",
 | 
			
		||||
    "@push.rocks/smartlog": "^3.0.3",
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										257
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										257
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -3,6 +3,6 @@
 | 
			
		||||
 */
 | 
			
		||||
export const commitinfo = {
 | 
			
		||||
  name: '@push.rocks/qenv',
 | 
			
		||||
  version: '6.0.1',
 | 
			
		||||
  version: '6.0.2',
 | 
			
		||||
  description: 'easy promised environments'
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										30
									
								
								ts/qenv.classes.configvaultadapter.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								ts/qenv.classes.configvaultadapter.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
			
		||||
import * as plugins from './qenv.plugins.js';
 | 
			
		||||
 | 
			
		||||
export class ConfigVaultAdapter {
 | 
			
		||||
  public configVaultUrl: string;
 | 
			
		||||
  
 | 
			
		||||
  constructor(configVaultUrl?: string) {
 | 
			
		||||
    this.configVaultUrl = configVaultUrl;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public async getConfigBundle(): Promise<plugins.configvaultInterfaces.data.IConfigBundle> {
 | 
			
		||||
    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<plugins.configvaultInterfaces.requests.IReq_GetConfigBundle>(
 | 
			
		||||
        `${parsedUrl.host}/typedrequest`,
 | 
			
		||||
        'getConfigBundle'
 | 
			
		||||
      );
 | 
			
		||||
    const response = await tr.fire({
 | 
			
		||||
      authorization: parsedUrl.pathname.replace('/', ''),
 | 
			
		||||
    })
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -1,3 +1,4 @@
 | 
			
		||||
import { ConfigVaultAdapter } from './qenv.classes.configvaultadapter.js';
 | 
			
		||||
import * as plugins from './qenv.plugins.js';
 | 
			
		||||
 | 
			
		||||
export class Qenv {
 | 
			
		||||
@@ -7,6 +8,8 @@ export class Qenv {
 | 
			
		||||
  public keyValueObject: { [key: string]: any } = {};
 | 
			
		||||
  public logger = new plugins.smartlog.ConsoleLog();
 | 
			
		||||
 | 
			
		||||
  public configVaultAdapter: ConfigVaultAdapter;
 | 
			
		||||
 | 
			
		||||
  public qenvFilePathAbsolute: string;
 | 
			
		||||
  public envFilePathAbsolute: string;
 | 
			
		||||
 | 
			
		||||
@@ -15,6 +18,7 @@ export class Qenv {
 | 
			
		||||
    envFileBasePathArg: string,
 | 
			
		||||
    failOnMissing: boolean = true
 | 
			
		||||
  ) {
 | 
			
		||||
    this.configVaultAdapter = new ConfigVaultAdapter();
 | 
			
		||||
    this.initializeFilePaths(qenvFileBasePathArg, envFileBasePathArg);
 | 
			
		||||
    this.loadRequiredEnvVars();
 | 
			
		||||
    this.loadAvailableEnvVars();
 | 
			
		||||
 
 | 
			
		||||
@@ -3,8 +3,20 @@ import * as path from 'path';
 | 
			
		||||
 | 
			
		||||
export { path };
 | 
			
		||||
 | 
			
		||||
// @api.global scope
 | 
			
		||||
import * as typedrequest from '@api.global/typedrequest';
 | 
			
		||||
 | 
			
		||||
export {
 | 
			
		||||
  typedrequest,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// @pushrocks scope
 | 
			
		||||
import * as smartfile from '@push.rocks/smartfile';
 | 
			
		||||
import * as smartlog from '@push.rocks/smartlog';
 | 
			
		||||
 | 
			
		||||
export { smartfile, smartlog };
 | 
			
		||||
 | 
			
		||||
// @configvault.io scope
 | 
			
		||||
import * as configvaultInterfaces from '@configvault.io/interfaces';
 | 
			
		||||
 | 
			
		||||
export { configvaultInterfaces };
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user