@owlnext/heimdall-js
Advanced tools
Comparing version 1.0.1 to 1.0.2
interface ConfigPackage { | ||
API_ENTRYPOINT: string; | ||
API_LOGIN: string; | ||
API_PASSWORD: string; | ||
API_APPLICATION_UUID: string; | ||
} | ||
@@ -7,0 +4,0 @@ export default class ConfigLoader { |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const dotenv = __importStar(require("dotenv")); | ||
class ConfigLoader { | ||
constructor() { | ||
dotenv.config(); | ||
let path; | ||
switch (process.env.NODE_ENV) { | ||
case "test": | ||
path = `${__dirname}/../../.env.test`; | ||
break; | ||
case "production": | ||
path = `${__dirname}/../../.env.production`; | ||
break; | ||
default: | ||
path = `${__dirname}/../../.env.development`; | ||
} | ||
dotenv.config({ path: path }); | ||
// TODO: mettre un préfix sur les paramètres | ||
this._config = { | ||
API_LOGIN: process.env.API_LOGIN || '', | ||
API_PASSWORD: process.env.API_PASSWORD || '', | ||
API_APPLICATION_UUID: process.env.API_APPLICATION_UUID || '', | ||
API_ENTRYPOINT: process.env.API_ENTRYPOINT || 'https://heimdall-api.tools.owlnext.fr' | ||
@@ -44,0 +7,0 @@ }; |
{ | ||
"name": "@owlnext/heimdall-js", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Heimdall API client & utils for javascript technologies", | ||
@@ -34,3 +34,4 @@ "main": "dist/index.js", | ||
"jest": "^27.4.5", | ||
"ts-jest": "^27.1.2" | ||
"ts-jest": "^27.1.2", | ||
"dotenv": "^10.0.0" | ||
}, | ||
@@ -43,3 +44,2 @@ "dependencies": { | ||
"crypto-js": "^4.1.1", | ||
"dotenv": "^10.0.0", | ||
"js-sha512": "^0.8.0", | ||
@@ -46,0 +46,0 @@ "nodejs-base64": "^2.0.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
10
0
77065
4
1194
- Removeddotenv@^10.0.0
- Removeddotenv@10.0.0(transitive)