fix(core): update
This commit is contained in:
parent
765011ad2a
commit
2017d51f11
@ -119,6 +119,6 @@ jobs:
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
pnpm install -g @gitzone/tsdoc
|
||||
pnpm install -g @git.zone/tsdoc
|
||||
npmci command tsdoc
|
||||
continue-on-error: true
|
||||
|
14
package.json
14
package.json
@ -27,16 +27,16 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/qenv#README",
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsrun": "^1.2.44",
|
||||
"@gitzone/tstest": "^1.0.77",
|
||||
"@push.rocks/tapbundle": "^5.0.12",
|
||||
"@types/node": "^20.4.6"
|
||||
"@git.zone/tsbuild": "^2.1.66",
|
||||
"@git.zone/tsrun": "^1.2.44",
|
||||
"@git.zone/tstest": "^1.0.77",
|
||||
"@push.rocks/tapbundle": "^5.0.15",
|
||||
"@types/node": "^20.8.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"@api.global/typedrequest": "^3.0.1",
|
||||
"@configvault.io/interfaces": "^1.0.2",
|
||||
"@push.rocks/smartfile": "^10.0.28",
|
||||
"@configvault.io/interfaces": "^1.0.13",
|
||||
"@push.rocks/smartfile": "^10.0.33",
|
||||
"@push.rocks/smartlog": "^3.0.3",
|
||||
"@push.rocks/smartpath": "^5.0.11"
|
||||
},
|
||||
|
2084
pnpm-lock.yaml
generated
2084
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.2',
|
||||
version: '6.0.3',
|
||||
description: 'easy promised environments'
|
||||
}
|
||||
|
@ -19,9 +19,9 @@ export class ConfigVaultAdapter {
|
||||
const parsedUrl = new URL(this.configVaultUrl);
|
||||
|
||||
const tr =
|
||||
new plugins.typedrequest.TypedRequest<plugins.configvaultInterfaces.requests.IReq_GetConfigBundle>(
|
||||
new plugins.typedrequest.TypedRequest<plugins.configvaultInterfaces.requests.IReq_GetEnvBundle>(
|
||||
`${parsedUrl.host}/typedrequest`,
|
||||
'getConfigBundle'
|
||||
'getEnvBundle'
|
||||
);
|
||||
const response = await tr.fire({
|
||||
authorization: parsedUrl.pathname.replace('/', ''),
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { ConfigVaultAdapter } from './qenv.classes.configvaultadapter.js';
|
||||
import * as plugins from './qenv.plugins.js';
|
||||
|
||||
export type TEnvVarRef = string | (() => Promise<string>);
|
||||
|
||||
export class Qenv {
|
||||
public requiredEnvVars: string[] = [];
|
||||
public availableEnvVars: string[] = [];
|
||||
@ -75,7 +77,7 @@ export class Qenv {
|
||||
}
|
||||
|
||||
public async getEnvVarOnDemand(
|
||||
envVarNameOrNames: string | string[]
|
||||
envVarNameOrNames: TEnvVarRef | TEnvVarRef[]
|
||||
): Promise<string | undefined> {
|
||||
if (Array.isArray(envVarNameOrNames)) {
|
||||
for (const envVarName of envVarNameOrNames) {
|
||||
@ -115,12 +117,16 @@ export class Qenv {
|
||||
return rawValue;
|
||||
}
|
||||
|
||||
private async tryGetEnvVar(envVarName: string): Promise<string | undefined> {
|
||||
private async tryGetEnvVar(envVarRefArg: TEnvVarRef): Promise<string | undefined> {
|
||||
if (typeof envVarRefArg === 'function') {
|
||||
return await envVarRefArg();
|
||||
}
|
||||
|
||||
return (
|
||||
this.getFromEnvironmentVariable(envVarName) ||
|
||||
this.getFromEnvJsonFile(envVarName) ||
|
||||
this.getFromDockerSecret(envVarName) ||
|
||||
this.getFromDockerSecretJson(envVarName)
|
||||
this.getFromEnvironmentVariable(envVarRefArg) ||
|
||||
this.getFromEnvJsonFile(envVarRefArg) ||
|
||||
this.getFromDockerSecret(envVarRefArg) ||
|
||||
this.getFromDockerSecretJson(envVarRefArg)
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user