UNPKG

nestjs-infisical-sdk

Version:
21 lines 877 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.injectSecretsIntoEnv = void 0; const exceptions_1 = require("../exceptions"); async function injectSecretsIntoEnv(client, options) { if (!options.projectId) { throw new exceptions_1.ProjectIdNotFoundException(); } const secretsResult = await client.secrets().listSecrets({ environment: options.environment || 'dev', projectId: options.projectId, includeImports: true, secretPath: options.secretPath || '/' }); const secrets = (secretsResult === null || secretsResult === void 0 ? void 0 : secretsResult.secrets) || []; for (const secret of secrets) { process.env[secret.secretKey] = secret.secretValue; } } exports.injectSecretsIntoEnv = injectSecretsIntoEnv; //# sourceMappingURL=inject-secrets-into-env.util.js.map