@yobytechautomation/config-lib 0.1.4 → 0.1.5
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.
|
@@ -58,7 +58,7 @@ export interface BaseConfigService {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* 🔥
|
|
61
|
+
* 🔥 BASE IMPLEMENTATION (LICENSE CONTROL)
|
|
62
62
|
*/
|
|
63
63
|
export declare abstract class BaseConfigServiceImpl implements BaseConfigService {
|
|
64
64
|
protected env: Record<string, any>;
|
|
@@ -74,7 +74,4 @@ export declare abstract class BaseConfigServiceImpl implements BaseConfigService
|
|
|
74
74
|
abstract getMailConfig(): any;
|
|
75
75
|
abstract getKAFKAConfig(): any;
|
|
76
76
|
}
|
|
77
|
-
/**
|
|
78
|
-
* TOKEN
|
|
79
|
-
*/
|
|
80
77
|
export declare const BASE_CONFIG_SERVICE: unique symbol;
|
|
@@ -1,17 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
39
|
exports.BASE_CONFIG_SERVICE = exports.BaseConfigServiceImpl = void 0;
|
|
7
40
|
const axios_1 = __importDefault(require("axios"));
|
|
41
|
+
const dotenv = __importStar(require("dotenv"));
|
|
42
|
+
// 🔥 LOAD ENV FILE FIRST (VERY IMPORTANT)
|
|
43
|
+
dotenv.config();
|
|
8
44
|
/**
|
|
9
|
-
* 🔥
|
|
45
|
+
* 🔥 BASE IMPLEMENTATION (LICENSE CONTROL)
|
|
10
46
|
*/
|
|
11
47
|
class BaseConfigServiceImpl {
|
|
12
48
|
constructor() {
|
|
49
|
+
// 🔥 reload env AFTER dotenv
|
|
13
50
|
this.env = process.env;
|
|
14
|
-
this.validateLicense();
|
|
51
|
+
this.validateLicense();
|
|
15
52
|
}
|
|
16
53
|
async validateLicense() {
|
|
17
54
|
try {
|
|
@@ -31,12 +68,9 @@ class BaseConfigServiceImpl {
|
|
|
31
68
|
}
|
|
32
69
|
catch (err) {
|
|
33
70
|
console.error('❌ LICENSE ERROR:', err.message);
|
|
34
|
-
process.exit(1);
|
|
71
|
+
process.exit(1);
|
|
35
72
|
}
|
|
36
73
|
}
|
|
37
74
|
}
|
|
38
75
|
exports.BaseConfigServiceImpl = BaseConfigServiceImpl;
|
|
39
|
-
/**
|
|
40
|
-
* TOKEN
|
|
41
|
-
*/
|
|
42
76
|
exports.BASE_CONFIG_SERVICE = Symbol('BASE_CONFIG_SERVICE');
|