opticore-env-access 1.0.0
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/dist/index.d.mts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +72 -0
- package/dist/index.mjs +35 -0
- package/package.json +33 -0
- package/tsconfig.json +26 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface IEnvVariables {
|
|
2
|
+
appHost: string;
|
|
3
|
+
appPort: string;
|
|
4
|
+
prodEnv: string;
|
|
5
|
+
devEnv: string;
|
|
6
|
+
dataBaseHost: string;
|
|
7
|
+
dataBasePort: string;
|
|
8
|
+
dataBaseUser: string;
|
|
9
|
+
dataBasePassword: string;
|
|
10
|
+
dataBaseName: string;
|
|
11
|
+
defaultLocal: string;
|
|
12
|
+
apiVersion: string;
|
|
13
|
+
usernameField: string;
|
|
14
|
+
passwordField: string;
|
|
15
|
+
argumentsDatabaseConnection: string;
|
|
16
|
+
logEnv: any;
|
|
17
|
+
logFileMaxSize: number;
|
|
18
|
+
logFileRotate: boolean;
|
|
19
|
+
logFileEnabled: boolean;
|
|
20
|
+
logRemoteEndPoint: string;
|
|
21
|
+
logRemoteEnabled: boolean;
|
|
22
|
+
logConsoleEnabled: boolean;
|
|
23
|
+
logLevelError: string;
|
|
24
|
+
logLevelInfo: string;
|
|
25
|
+
logLevelSuccess: string;
|
|
26
|
+
logLevelWarning: string;
|
|
27
|
+
logLevelDebug: string;
|
|
28
|
+
protocolTransfert: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare const getEnvVariable: IEnvVariables;
|
|
32
|
+
|
|
33
|
+
export { getEnvVariable };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface IEnvVariables {
|
|
2
|
+
appHost: string;
|
|
3
|
+
appPort: string;
|
|
4
|
+
prodEnv: string;
|
|
5
|
+
devEnv: string;
|
|
6
|
+
dataBaseHost: string;
|
|
7
|
+
dataBasePort: string;
|
|
8
|
+
dataBaseUser: string;
|
|
9
|
+
dataBasePassword: string;
|
|
10
|
+
dataBaseName: string;
|
|
11
|
+
defaultLocal: string;
|
|
12
|
+
apiVersion: string;
|
|
13
|
+
usernameField: string;
|
|
14
|
+
passwordField: string;
|
|
15
|
+
argumentsDatabaseConnection: string;
|
|
16
|
+
logEnv: any;
|
|
17
|
+
logFileMaxSize: number;
|
|
18
|
+
logFileRotate: boolean;
|
|
19
|
+
logFileEnabled: boolean;
|
|
20
|
+
logRemoteEndPoint: string;
|
|
21
|
+
logRemoteEnabled: boolean;
|
|
22
|
+
logConsoleEnabled: boolean;
|
|
23
|
+
logLevelError: string;
|
|
24
|
+
logLevelInfo: string;
|
|
25
|
+
logLevelSuccess: string;
|
|
26
|
+
logLevelWarning: string;
|
|
27
|
+
logLevelDebug: string;
|
|
28
|
+
protocolTransfert: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare const getEnvVariable: IEnvVariables;
|
|
32
|
+
|
|
33
|
+
export { getEnvVariable };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
getEnvVariable: () => getEnvVariable
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(index_exports);
|
|
36
|
+
|
|
37
|
+
// src/domains/environnement/access.env.ts
|
|
38
|
+
var import_dotenv = __toESM(require("dotenv"));
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$;
|
|
40
|
+
var getEnvVariable = {
|
|
41
|
+
apiVersion: String((_b = (_a = import_dotenv.default.config()) == null ? void 0 : _a.parsed) == null ? void 0 : _b.API_VERSION),
|
|
42
|
+
appHost: String((_d = (_c = import_dotenv.default.config()) == null ? void 0 : _c.parsed) == null ? void 0 : _d.APP_HOST),
|
|
43
|
+
appPort: String((_f = (_e = import_dotenv.default.config()) == null ? void 0 : _e.parsed) == null ? void 0 : _f.APP_PORT),
|
|
44
|
+
argumentsDatabaseConnection: String((_h = (_g = import_dotenv.default.config()) == null ? void 0 : _g.parsed) == null ? void 0 : _h.ARGUMENTS_DATABASE_CONNECTION),
|
|
45
|
+
devEnv: String((_j = (_i = import_dotenv.default.config()) == null ? void 0 : _i.parsed) == null ? void 0 : _j.ENV_DEV),
|
|
46
|
+
dataBaseHost: String((_l = (_k = import_dotenv.default.config()) == null ? void 0 : _k.parsed) == null ? void 0 : _l.DATA_BASE_HOST),
|
|
47
|
+
dataBasePort: String((_n = (_m = import_dotenv.default.config()) == null ? void 0 : _m.parsed) == null ? void 0 : _n.DATA_BASE_PORT),
|
|
48
|
+
dataBaseUser: String((_p = (_o = import_dotenv.default.config()) == null ? void 0 : _o.parsed) == null ? void 0 : _p.DATA_BASE_USER),
|
|
49
|
+
dataBasePassword: String((_r = (_q = import_dotenv.default.config()) == null ? void 0 : _q.parsed) == null ? void 0 : _r.DATA_BASE_PASSWORD),
|
|
50
|
+
dataBaseName: String((_t = (_s = import_dotenv.default.config()) == null ? void 0 : _s.parsed) == null ? void 0 : _t.DATA_BASE_NAME),
|
|
51
|
+
defaultLocal: String((_v = (_u = import_dotenv.default.config()) == null ? void 0 : _u.parsed) == null ? void 0 : _v.DEFAULT_LOCAL_LANG),
|
|
52
|
+
protocolTransfert: String((_x = (_w = import_dotenv.default.config()) == null ? void 0 : _w.parsed) == null ? void 0 : _x.PROTOCOL_TRANSFERT),
|
|
53
|
+
logEnv: String((_z = (_y = import_dotenv.default.config()) == null ? void 0 : _y.parsed) == null ? void 0 : _z.LOG_ENVIRONMENT),
|
|
54
|
+
logFileMaxSize: Number((_B = (_A = import_dotenv.default.config()) == null ? void 0 : _A.parsed) == null ? void 0 : _B.LOG_ENVIRONMENT_FILE_MAX_SIZE),
|
|
55
|
+
logFileRotate: Boolean((_D = (_C = import_dotenv.default.config()) == null ? void 0 : _C.parsed) == null ? void 0 : _D.LOG_ENVIRONMENT_FILE_ROTATE),
|
|
56
|
+
logFileEnabled: Boolean((_F = (_E = import_dotenv.default.config()) == null ? void 0 : _E.parsed) == null ? void 0 : _F.LOG_ENVIRONMENT_FILE_ENABLED),
|
|
57
|
+
logRemoteEndPoint: String((_H = (_G = import_dotenv.default.config()) == null ? void 0 : _G.parsed) == null ? void 0 : _H.LOG_ENVIRONMENT_REMOTE_ENDPOINT),
|
|
58
|
+
logRemoteEnabled: Boolean((_J = (_I = import_dotenv.default.config()) == null ? void 0 : _I.parsed) == null ? void 0 : _J.LOG_ENVIRONMENT_REMOTE_ENABLED),
|
|
59
|
+
logConsoleEnabled: Boolean((_L = (_K = import_dotenv.default.config()) == null ? void 0 : _K.parsed) == null ? void 0 : _L.LOG_ENVIRONMENT_CONSOLE_ENABLED),
|
|
60
|
+
logLevelError: String((_N = (_M = import_dotenv.default.config()) == null ? void 0 : _M.parsed) == null ? void 0 : _N.LOG_ENVIRONMENT_LOG_LEVEL_ERROR),
|
|
61
|
+
logLevelInfo: String((_P = (_O = import_dotenv.default.config()) == null ? void 0 : _O.parsed) == null ? void 0 : _P.LOG_ENVIRONMENT_LOG_LEVEL_INFO),
|
|
62
|
+
logLevelSuccess: String((_R = (_Q = import_dotenv.default.config()) == null ? void 0 : _Q.parsed) == null ? void 0 : _R.LOG_ENVIRONMENT_LOG_LEVEL_SUCCESS),
|
|
63
|
+
logLevelWarning: String((_T = (_S = import_dotenv.default.config()) == null ? void 0 : _S.parsed) == null ? void 0 : _T.LOG_ENVIRONMENT_LOG_LEVEL_WARN),
|
|
64
|
+
logLevelDebug: String((_V = (_U = import_dotenv.default.config()) == null ? void 0 : _U.parsed) == null ? void 0 : _V.LOG_ENVIRONMENT_LOG_LEVEL_DEBUG),
|
|
65
|
+
passwordField: String((_X = (_W = import_dotenv.default.config()) == null ? void 0 : _W.parsed) == null ? void 0 : _X.PASSWORD_FIELD),
|
|
66
|
+
prodEnv: String((_Z = (_Y = import_dotenv.default.config()) == null ? void 0 : _Y.parsed) == null ? void 0 : _Z.ENV_PROD),
|
|
67
|
+
usernameField: String((_$ = (__ = import_dotenv.default.config()) == null ? void 0 : __.parsed) == null ? void 0 : _$.USERNAME_FIELD)
|
|
68
|
+
};
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
getEnvVariable
|
|
72
|
+
});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/domains/environnement/access.env.ts
|
|
2
|
+
import dotenv from "dotenv";
|
|
3
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$;
|
|
4
|
+
var getEnvVariable = {
|
|
5
|
+
apiVersion: String((_b = (_a = dotenv.config()) == null ? void 0 : _a.parsed) == null ? void 0 : _b.API_VERSION),
|
|
6
|
+
appHost: String((_d = (_c = dotenv.config()) == null ? void 0 : _c.parsed) == null ? void 0 : _d.APP_HOST),
|
|
7
|
+
appPort: String((_f = (_e = dotenv.config()) == null ? void 0 : _e.parsed) == null ? void 0 : _f.APP_PORT),
|
|
8
|
+
argumentsDatabaseConnection: String((_h = (_g = dotenv.config()) == null ? void 0 : _g.parsed) == null ? void 0 : _h.ARGUMENTS_DATABASE_CONNECTION),
|
|
9
|
+
devEnv: String((_j = (_i = dotenv.config()) == null ? void 0 : _i.parsed) == null ? void 0 : _j.ENV_DEV),
|
|
10
|
+
dataBaseHost: String((_l = (_k = dotenv.config()) == null ? void 0 : _k.parsed) == null ? void 0 : _l.DATA_BASE_HOST),
|
|
11
|
+
dataBasePort: String((_n = (_m = dotenv.config()) == null ? void 0 : _m.parsed) == null ? void 0 : _n.DATA_BASE_PORT),
|
|
12
|
+
dataBaseUser: String((_p = (_o = dotenv.config()) == null ? void 0 : _o.parsed) == null ? void 0 : _p.DATA_BASE_USER),
|
|
13
|
+
dataBasePassword: String((_r = (_q = dotenv.config()) == null ? void 0 : _q.parsed) == null ? void 0 : _r.DATA_BASE_PASSWORD),
|
|
14
|
+
dataBaseName: String((_t = (_s = dotenv.config()) == null ? void 0 : _s.parsed) == null ? void 0 : _t.DATA_BASE_NAME),
|
|
15
|
+
defaultLocal: String((_v = (_u = dotenv.config()) == null ? void 0 : _u.parsed) == null ? void 0 : _v.DEFAULT_LOCAL_LANG),
|
|
16
|
+
protocolTransfert: String((_x = (_w = dotenv.config()) == null ? void 0 : _w.parsed) == null ? void 0 : _x.PROTOCOL_TRANSFERT),
|
|
17
|
+
logEnv: String((_z = (_y = dotenv.config()) == null ? void 0 : _y.parsed) == null ? void 0 : _z.LOG_ENVIRONMENT),
|
|
18
|
+
logFileMaxSize: Number((_B = (_A = dotenv.config()) == null ? void 0 : _A.parsed) == null ? void 0 : _B.LOG_ENVIRONMENT_FILE_MAX_SIZE),
|
|
19
|
+
logFileRotate: Boolean((_D = (_C = dotenv.config()) == null ? void 0 : _C.parsed) == null ? void 0 : _D.LOG_ENVIRONMENT_FILE_ROTATE),
|
|
20
|
+
logFileEnabled: Boolean((_F = (_E = dotenv.config()) == null ? void 0 : _E.parsed) == null ? void 0 : _F.LOG_ENVIRONMENT_FILE_ENABLED),
|
|
21
|
+
logRemoteEndPoint: String((_H = (_G = dotenv.config()) == null ? void 0 : _G.parsed) == null ? void 0 : _H.LOG_ENVIRONMENT_REMOTE_ENDPOINT),
|
|
22
|
+
logRemoteEnabled: Boolean((_J = (_I = dotenv.config()) == null ? void 0 : _I.parsed) == null ? void 0 : _J.LOG_ENVIRONMENT_REMOTE_ENABLED),
|
|
23
|
+
logConsoleEnabled: Boolean((_L = (_K = dotenv.config()) == null ? void 0 : _K.parsed) == null ? void 0 : _L.LOG_ENVIRONMENT_CONSOLE_ENABLED),
|
|
24
|
+
logLevelError: String((_N = (_M = dotenv.config()) == null ? void 0 : _M.parsed) == null ? void 0 : _N.LOG_ENVIRONMENT_LOG_LEVEL_ERROR),
|
|
25
|
+
logLevelInfo: String((_P = (_O = dotenv.config()) == null ? void 0 : _O.parsed) == null ? void 0 : _P.LOG_ENVIRONMENT_LOG_LEVEL_INFO),
|
|
26
|
+
logLevelSuccess: String((_R = (_Q = dotenv.config()) == null ? void 0 : _Q.parsed) == null ? void 0 : _R.LOG_ENVIRONMENT_LOG_LEVEL_SUCCESS),
|
|
27
|
+
logLevelWarning: String((_T = (_S = dotenv.config()) == null ? void 0 : _S.parsed) == null ? void 0 : _T.LOG_ENVIRONMENT_LOG_LEVEL_WARN),
|
|
28
|
+
logLevelDebug: String((_V = (_U = dotenv.config()) == null ? void 0 : _U.parsed) == null ? void 0 : _V.LOG_ENVIRONMENT_LOG_LEVEL_DEBUG),
|
|
29
|
+
passwordField: String((_X = (_W = dotenv.config()) == null ? void 0 : _W.parsed) == null ? void 0 : _X.PASSWORD_FIELD),
|
|
30
|
+
prodEnv: String((_Z = (_Y = dotenv.config()) == null ? void 0 : _Y.parsed) == null ? void 0 : _Z.ENV_PROD),
|
|
31
|
+
usernameField: String((_$ = (__ = dotenv.config()) == null ? void 0 : __.parsed) == null ? void 0 : _$.USERNAME_FIELD)
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
getEnvVariable
|
|
35
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "opticore-env-access",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "opticore environnement access",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
+
"build": "tsup"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/guyzoum77/opticore-requests-called-events.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"opticore"
|
|
16
|
+
],
|
|
17
|
+
"author": "Guy-serge Kouacou",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/guyzoum77/opticore-requests-called-events/issues"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/guyzoum77/opticore-requests-called-events#readme",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"dotenv": "^16.4.7"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.13.5",
|
|
28
|
+
"tslib": "^2.8.1",
|
|
29
|
+
"typescript": "^5.4.5",
|
|
30
|
+
"tsup": "^8.4.0",
|
|
31
|
+
"reflect-metadata": "^0.2.2"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"strict": true,
|
|
4
|
+
"noImplicitAny": true,
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"strictNullChecks": true,
|
|
7
|
+
"module": "commonjs",
|
|
8
|
+
"pretty": true,
|
|
9
|
+
"target": "es2017",
|
|
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
|
+
"@requestsCalledEvents/*": ["*"],
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"include": ["src/**/*.ts", "src/**/*.json", ".env"],
|
|
25
|
+
"exclude": ["node_modules"]
|
|
26
|
+
}
|