@konplit-services/common 1.0.214 → 1.0.216
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/build/app.configs.d.ts
CHANGED
|
@@ -101,6 +101,9 @@ interface NIBSS {
|
|
|
101
101
|
bvn: BVN;
|
|
102
102
|
resetURL: string;
|
|
103
103
|
}
|
|
104
|
+
interface DSN {
|
|
105
|
+
dsn: string;
|
|
106
|
+
}
|
|
104
107
|
declare class AppConfigs {
|
|
105
108
|
private env;
|
|
106
109
|
constructor(processEnv: typeof env);
|
|
@@ -199,6 +202,7 @@ declare class AppConfigs {
|
|
|
199
202
|
getValue(key: string): string;
|
|
200
203
|
ensureValues(keys?: string[]): this;
|
|
201
204
|
getNODE_ENV(): string | undefined;
|
|
205
|
+
getDSN_Key(): DSN;
|
|
202
206
|
}
|
|
203
207
|
declare const appConfigs: AppConfigs;
|
|
204
208
|
export { appConfigs };
|
package/build/app.configs.js
CHANGED
|
@@ -713,6 +713,15 @@ class AppConfigs {
|
|
|
713
713
|
getNODE_ENV() {
|
|
714
714
|
return this.env.NODE_ENV;
|
|
715
715
|
}
|
|
716
|
+
//DNS Secret Keys for ALL 14 Services
|
|
717
|
+
getDSN_Key() {
|
|
718
|
+
if (!this.env.SENTRY_LOG_DNS) {
|
|
719
|
+
throw new Error("SENTRY_LOG_DNS is required");
|
|
720
|
+
}
|
|
721
|
+
return {
|
|
722
|
+
dsn: this.env.SENTRY_LOG_DNS
|
|
723
|
+
};
|
|
724
|
+
}
|
|
716
725
|
}
|
|
717
726
|
// make sure all keys are available on startup
|
|
718
727
|
const appConfigs = new AppConfigs(process.env);
|
|
@@ -16,6 +16,7 @@ const constants_1 = require("../redis/constants");
|
|
|
16
16
|
const notAuthorized_1 = require("../errors/notAuthorized");
|
|
17
17
|
const language_1 = require("../helper/lang/language");
|
|
18
18
|
const error_codes_1 = require("../helper/errorCodes/error-codes");
|
|
19
|
+
const app_configs_1 = require("../app.configs");
|
|
19
20
|
const currentUser = (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
21
|
if (!req.headers["authorization"])
|
|
21
22
|
return next();
|
|
@@ -34,7 +35,9 @@ const currentUser = (req, res, next) => __awaiter(void 0, void 0, void 0, functi
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
catch (error) {
|
|
37
|
-
|
|
38
|
+
if (app_configs_1.appConfigs.getNODE_ENV() !== "production") {
|
|
39
|
+
console.log(error);
|
|
40
|
+
}
|
|
38
41
|
}
|
|
39
42
|
next();
|
|
40
43
|
});
|