opticore-env-access 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opticore-env-access",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "opticore environnement access",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -10,6 +10,9 @@
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
11
11
  "build": "tsup"
12
12
  },
13
+ "files": [
14
+ "dist"
15
+ ],
13
16
  "repository": {
14
17
  "type": "git",
15
18
  "url": "git+https://github.com/guyzoum77/opticore-requests-called-events.git"
@@ -1,2 +0,0 @@
1
- import { IEnvVariables } from "@OptiCore-env-access/domains/interfaces/envVariables.interface";
2
- export declare const getEnvironmentValue: (envDir: string) => IEnvVariables;
@@ -1,52 +0,0 @@
1
- import { envPathConfig } from "@OptiCore-env-access/config/envPath.config";
2
- export const getEnvironmentValue = (envDir) => {
3
- const envPath = envPathConfig(envDir);
4
- const parseBoolean = (value) => {
5
- return value?.toLowerCase() === "true";
6
- };
7
- const parseNumber = (value, defaultValue = 0) => {
8
- const num = Number(value);
9
- return isNaN(num) ? defaultValue : num;
10
- };
11
- const parseStringArray = (value, separator = ",") => {
12
- if (!value || value.trim() === '') {
13
- return [];
14
- }
15
- return value.split(separator).map((item) => item.trim()).filter((item) => item.length > 0);
16
- };
17
- return {
18
- apiVersion: String(envPath.parsed?.API_VERSION),
19
- appHost: String(envPath.parsed?.APP_HOST),
20
- appPort: String(envPath.parsed?.APP_PORT),
21
- argumentsDatabaseConnection: String(envPath.parsed?.ARGUMENTS_DATABASE_CONNECTION),
22
- devEnv: String(envPath.parsed?.ENV_DEV),
23
- dataBaseHost: String(envPath.parsed?.DATA_BASE_HOST),
24
- dataBasePort: String(envPath.parsed?.DATA_BASE_PORT),
25
- dataBaseUser: String(envPath.parsed?.DATA_BASE_USER),
26
- dataBasePassword: String(envPath.parsed?.DATA_BASE_PASSWORD),
27
- dataBaseName: String(envPath.parsed?.DATA_BASE_NAME),
28
- defaultLocal: String(envPath.parsed?.DEFAULT_LOCAL_LANG),
29
- protocolTransfert: String(envPath.parsed?.PROTOCOL_TRANSFERT),
30
- logEnv: String(envPath.parsed?.LOG_ENVIRONMENT),
31
- logFileMaxSize: Number(envPath.parsed?.LOG_ENVIRONMENT_FILE_MAX_SIZE),
32
- logFileRotate: parseBoolean(envPath.parsed?.LOG_ENVIRONMENT_FILE_ROTATE),
33
- logFileEnabled: parseBoolean(envPath.parsed?.LOG_ENVIRONMENT_FILE_ENABLED),
34
- logRemoteEndPoint: String(envPath.parsed?.LOG_ENVIRONMENT_REMOTE_ENDPOINT),
35
- logRemoteEnabled: parseBoolean(envPath.parsed?.LOG_ENVIRONMENT_REMOTE_ENABLED),
36
- logConsoleEnabled: parseBoolean(envPath.parsed?.LOG_ENVIRONMENT_CONSOLE_ENABLED),
37
- logLevelError: String(envPath.parsed?.LOG_ENVIRONMENT_LOG_LEVEL_ERROR),
38
- logLevelInfo: String(envPath.parsed?.LOG_ENVIRONMENT_LOG_LEVEL_INFO),
39
- logLevelSuccess: String(envPath.parsed?.LOG_ENVIRONMENT_LOG_LEVEL_SUCCESS),
40
- logLevelWarning: String(envPath.parsed?.LOG_ENVIRONMENT_LOG_LEVEL_WARN),
41
- logLevelDebug: String(envPath.parsed?.LOG_ENVIRONMENT_LOG_LEVEL_DEBUG),
42
- passwordField: String(envPath.parsed?.PASSWORD_FIELD),
43
- prodEnv: String(envPath.parsed?.ENV_PROD),
44
- usernameField: String(envPath.parsed?.USERNAME_FIELD),
45
- hmrEnabled: parseBoolean(envPath.parsed?.HMR_ENABLED),
46
- hmrWatchPatterns: parseStringArray(envPath.parsed?.HMR_WATCH_PATTERNS) || "src/**/*.ts,src/**/*.js,src/**/*.json,.env,config/*.json",
47
- hmrIgnorePatterns: parseStringArray(envPath.parsed?.HMR_IGNORE_PATTERNS) || "node_modules/**,dist/**,build/**,*.log,coverage/**",
48
- hmrDebounceMs: parseNumber(envPath.parsed?.HMR_DEBOUNCE_MS, 500) || 500,
49
- hmrMaxRestarts: parseNumber(envPath.parsed?.HMR_MAX_RESTARTS, 5) || 5,
50
- hmrAutoRestarts: parseBoolean(envPath.parsed?.HMR_AUTO_RESTART) || false
51
- };
52
- };
package/tsconfig.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "strict": true,
4
- "noImplicitAny": true,
5
- "esModuleInterop": true,
6
- "strictNullChecks": true,
7
- "module": "ES2022",
8
- "pretty": true,
9
- "target": "es2022",
10
- "moduleResolution": "node",
11
- "declaration": true,
12
- "isolatedModules": true,
13
- "noEmit": false,
14
- "types": ["reflect-metadata", "node"],
15
- "experimentalDecorators": true,
16
- "outDir": "./dist",
17
- "importHelpers": true,
18
- "resolveJsonModule": true,
19
- "baseUrl": "src",
20
- "paths": {
21
- "@OptiCore-env-access/*": ["*"]
22
- }
23
- },
24
- "include": ["src/**/*.ts", "src/**/*.json", ".env"],
25
- "exclude": ["node_modules"]
26
- }