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