exodus-framework 2.0.55 → 2.0.57
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/lib/app/settings.d.ts +2 -2
- package/lib/app/settings.d.ts.map +1 -1
- package/lib/app/settings.js +8 -7
- package/lib/middlewares/authentication.d.ts.map +1 -1
- package/lib/middlewares/authentication.js +7 -2
- package/lib/services/error.d.ts.map +1 -1
- package/lib/services/error.js +3 -10
- package/package.json +1 -1
package/lib/app/settings.d.ts
CHANGED
@@ -8,8 +8,8 @@ declare class CoreSettings {
|
|
8
8
|
http: Partial<THttpSettings>;
|
9
9
|
logger: Partial<Tlogger>;
|
10
10
|
messaging: Partial<TmessagingSettings>;
|
11
|
-
|
12
|
-
|
11
|
+
defaults: GeneralSettings;
|
12
|
+
settings: GeneralSettings;
|
13
13
|
constructor();
|
14
14
|
protected mergeSettings(): void;
|
15
15
|
getAppication(): TApplicationSettings;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/app/settings.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAKvB,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,cAAM,YAAY;IAChB,WAAW,EAAE,OAAO,CAAC,oBAAoB,CAAC,
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/app/settings.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAKvB,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,cAAM,YAAY;IAChB,WAAW,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAM;IAChD,cAAc,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAM;IACtD,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,CAAM;IACpC,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAM;IAC1C,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAM;IAClC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAM;IAC9B,SAAS,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAM;IAE5C,QAAQ,EAAE,eAAe,CA2EvB;IACF,QAAQ,EAAE,eAAe,CAAC;;IAM1B,SAAS,CAAC,aAAa;IAavB,aAAa;IAGb,iBAAiB;IAGjB,QAAQ;IAGR,WAAW;IAGX,OAAO;IAGP,SAAS;IAGT,YAAY;CAGb;AAED,eAAe,YAAY,CAAC"}
|
package/lib/app/settings.js
CHANGED
@@ -10,13 +10,13 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
10
10
|
var _path = _interopRequireDefault(require("path"));
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
12
12
|
class CoreSettings {
|
13
|
-
application;
|
14
|
-
authentication;
|
15
|
-
cache;
|
16
|
-
database;
|
17
|
-
http;
|
18
|
-
logger;
|
19
|
-
messaging;
|
13
|
+
application = {};
|
14
|
+
authentication = {};
|
15
|
+
cache = {};
|
16
|
+
database = {};
|
17
|
+
http = {};
|
18
|
+
logger = {};
|
19
|
+
messaging = {};
|
20
20
|
defaults = {
|
21
21
|
application: {
|
22
22
|
appId: process.env.APP_ID,
|
@@ -103,6 +103,7 @@ class CoreSettings {
|
|
103
103
|
logger: this.logger,
|
104
104
|
messaging: this.messaging
|
105
105
|
});
|
106
|
+
// console.log(this.settings);
|
106
107
|
}
|
107
108
|
getAppication() {
|
108
109
|
return this.settings.application;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middlewares/authentication.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,cAAM,wBAAyB,SAAQ,cAAc;IACnD,YAAY,EAAE,cAAc,
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../../src/middlewares/authentication.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,cAAM,wBAAyB,SAAQ,cAAc;IACnD,YAAY,EAAE,cAAc,CAYzB;CACJ;AAED,eAAe,wBAAwB,CAAC"}
|
@@ -12,8 +12,13 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
12
12
|
class AuthenticationMiddleware extends _controller.default {
|
13
13
|
decryptToken = (0, _expressJwt.expressjwt)({
|
14
14
|
secret: async () => {
|
15
|
-
|
16
|
-
|
15
|
+
try {
|
16
|
+
const api = new _session.SessionAPI();
|
17
|
+
return (await api.getCertificate()).data;
|
18
|
+
} catch (error) {
|
19
|
+
this.log('Não foi possível obter o certificado de segurança.', 'danger');
|
20
|
+
return '';
|
21
|
+
}
|
17
22
|
},
|
18
23
|
issuer: _app.Core.settings.getAuthentication().issuer,
|
19
24
|
algorithms: ['RS256']
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/services/error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,IAAI,MAAM,aAAa,CAAC;AAE/B,cAAM,eAAgB,SAAQ,IAAI;;CAIjC;AAED,qBAAa,wBAAyB,SAAQ,eAAe;IAC3D,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,KAAK,EAAE,oBAAoB,CAAC;IACrC,IAAI,EAAE,OAAO,CAAC;gBAGnB,OAAO,EAAE,MAAM,EACf,UAAU,oBAAgC,EAC1C,KAAK,GAAE,oBAA8B,EACrC,IAAI,CAAC,EAAE,OAAO;IAUhB,OAAO,CAAC,MAAM;
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/services/error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,IAAI,MAAM,aAAa,CAAC;AAE/B,cAAM,eAAgB,SAAQ,IAAI;;CAIjC;AAED,qBAAa,wBAAyB,SAAQ,eAAe;IAC3D,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,KAAK,EAAE,oBAAoB,CAAC;IACrC,IAAI,EAAE,OAAO,CAAC;gBAGnB,OAAO,EAAE,MAAM,EACf,UAAU,oBAAgC,EAC1C,KAAK,GAAE,oBAA8B,EACrC,IAAI,CAAC,EAAE,OAAO;IAUhB,OAAO,CAAC,MAAM;CAIf;AAED,qBAAa,oBAAqB,SAAQ,eAAe;IACvD,SAAgB,OAAO,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;gBAER,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAOxC,OAAO,CAAC,MAAM;CAKf"}
|
package/lib/services/error.js
CHANGED
@@ -27,7 +27,8 @@ class ApplicationHttpException extends ExodusErrorBase {
|
|
27
27
|
this.handle();
|
28
28
|
}
|
29
29
|
handle() {
|
30
|
-
(0, _logger.default)().warn(this.message, this.statusCode
|
30
|
+
(0, _logger.default)().warn(this.message, this.statusCode);
|
31
|
+
(0, _logger.default)().warn(this.data);
|
31
32
|
}
|
32
33
|
}
|
33
34
|
exports.ApplicationHttpException = ApplicationHttpException;
|
@@ -42,15 +43,7 @@ class ApplicationException extends ExodusErrorBase {
|
|
42
43
|
}
|
43
44
|
handle() {
|
44
45
|
this.log(`${this.message}`, 'danger');
|
45
|
-
(0, _logger.default)().error(
|
46
|
-
message: this.message,
|
47
|
-
/* erro: {
|
48
|
-
name: this.error.name,
|
49
|
-
message: this.error.message,
|
50
|
-
stack: this.error.stack
|
51
|
-
} */
|
52
|
-
erro: this.error
|
53
|
-
});
|
46
|
+
(0, _logger.default)().error(this.error);
|
54
47
|
}
|
55
48
|
}
|
56
49
|
exports.ApplicationException = ApplicationException;
|