exodus-framework 2.0.3 → 2.0.6
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 → lib}/app/app.d.ts +3 -4
- package/lib/app/app.d.ts.map +1 -0
- package/lib/app/app.js +84 -0
- package/{build → lib}/app/controller.d.ts +2 -2
- package/lib/app/controller.d.ts.map +1 -0
- package/{build → lib}/app/controller.js +2 -1
- package/lib/app/core.d.ts +10 -0
- package/lib/app/core.d.ts.map +1 -0
- package/{build → lib}/app/core.js +5 -0
- package/{build → lib}/app/index.d.ts +1 -0
- package/lib/app/index.d.ts.map +1 -0
- package/{build → lib}/app/index.js +9 -1
- package/lib/app/settings.d.ts +24 -0
- package/lib/app/settings.d.ts.map +1 -0
- package/lib/app/settings.js +130 -0
- package/{build → lib}/app/singleton.d.ts +1 -1
- package/{build → lib}/app/singleton.d.ts.map +1 -1
- package/lib/contracts/console.d.ts.map +1 -0
- package/{build/@types → lib/contracts}/entity.d.ts +2 -1
- package/lib/contracts/entity.d.ts.map +1 -0
- package/lib/contracts/http.d.ts.map +1 -0
- package/{build/@types → lib/contracts}/index.d.ts +1 -1
- package/lib/contracts/index.d.ts.map +1 -0
- package/{build/@types → lib/contracts}/index.js +11 -11
- package/{build/@types → lib/contracts}/messaging.d.ts +6 -0
- package/lib/contracts/messaging.d.ts.map +1 -0
- package/{build/@types → lib/contracts}/messaging.js +1 -0
- package/lib/contracts/service.d.ts.map +1 -0
- package/{build/@types → lib/contracts}/session.d.ts +0 -1
- package/lib/contracts/session.d.ts.map +1 -0
- package/lib/contracts/settings.d.ts +62 -0
- package/lib/contracts/settings.d.ts.map +1 -0
- package/{build/@types → lib/contracts}/singleton.d.ts +1 -1
- package/lib/contracts/singleton.d.ts.map +1 -0
- package/{build/@types → lib/contracts}/socket.d.ts +1 -1
- package/lib/contracts/socket.d.ts.map +1 -0
- package/{build → lib}/controllers/api/file.d.ts +1 -1
- package/{build → lib}/controllers/api/file.d.ts.map +1 -1
- package/{build → lib}/controllers/api/file.js +1 -1
- package/{build → lib}/controllers/api/index.d.ts.map +1 -1
- package/{build → lib}/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -0
- package/{build → lib}/index.js +4 -16
- package/{build → lib}/middlewares/access.d.ts +2 -2
- package/lib/middlewares/access.d.ts.map +1 -0
- package/{build → lib}/middlewares/access.js +1 -1
- package/{build → lib}/middlewares/authentication.d.ts +1 -1
- package/{build → lib}/middlewares/authentication.d.ts.map +1 -1
- package/{build → lib}/middlewares/authentication.js +9 -4
- package/{build → lib}/middlewares/file.d.ts +1 -1
- package/{build → lib}/middlewares/file.d.ts.map +1 -1
- package/{build → lib}/middlewares/file.js +3 -3
- package/lib/middlewares/index.d.ts.map +1 -0
- package/{build → lib}/services/error.d.ts +1 -1
- package/{build → lib}/services/error.d.ts.map +1 -1
- package/{build → lib}/services/error.js +4 -10
- package/{build → lib}/services/express.d.ts +3 -3
- package/lib/services/express.d.ts.map +1 -0
- package/{build → lib}/services/express.js +12 -14
- package/lib/services/file.d.ts +13 -0
- package/lib/services/file.d.ts.map +1 -0
- package/{build → lib}/services/file.js +17 -6
- package/lib/services/index.d.ts.map +1 -0
- package/{build → lib}/services/rabitmq.d.ts +3 -3
- package/lib/services/rabitmq.d.ts.map +1 -0
- package/{build → lib}/services/rabitmq.js +2 -2
- package/{build → lib}/services/redis.d.ts +2 -2
- package/lib/services/redis.d.ts.map +1 -0
- package/{build → lib}/services/redis.js +3 -3
- package/{build → lib}/services/sequelize.d.ts +2 -2
- package/lib/services/sequelize.d.ts.map +1 -0
- package/{build → lib}/services/sequelize.js +6 -6
- package/{build → lib}/services/socket.d.ts +3 -3
- package/lib/services/socket.d.ts.map +1 -0
- package/{build → lib}/services/task.d.ts +5 -5
- package/lib/services/task.d.ts.map +1 -0
- package/{build → lib}/services/task.js +15 -12
- package/{build → lib}/utils/api.d.ts +2 -2
- package/{build → lib}/utils/api.d.ts.map +1 -1
- package/lib/utils/database.d.ts.map +1 -0
- package/{build → lib}/utils/database.js +9 -9
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/logger.d.ts.map +1 -0
- package/lib/utils/logger.js +48 -0
- package/package.json +7 -6
- package/build/@types/app.d.ts +0 -5
- package/build/@types/app.d.ts.map +0 -1
- package/build/@types/console.d.ts.map +0 -1
- package/build/@types/entity.d.ts.map +0 -1
- package/build/@types/http.d.ts.map +0 -1
- package/build/@types/index.d.ts.map +0 -1
- package/build/@types/messaging.d.ts.map +0 -1
- package/build/@types/service.d.ts.map +0 -1
- package/build/@types/session.d.ts.map +0 -1
- package/build/@types/singleton.d.ts.map +0 -1
- package/build/@types/socket.d.ts.map +0 -1
- package/build/app/app.d.ts.map +0 -1
- package/build/app/app.js +0 -68
- package/build/app/controller.d.ts.map +0 -1
- package/build/app/core.d.ts +0 -7
- package/build/app/core.d.ts.map +0 -1
- package/build/app/index.d.ts.map +0 -1
- package/build/config/app.d.ts +0 -16
- package/build/config/app.d.ts.map +0 -1
- package/build/config/app.js +0 -25
- package/build/config/auth.d.ts +0 -5
- package/build/config/auth.d.ts.map +0 -1
- package/build/config/auth.js +0 -11
- package/build/config/cache.d.ts +0 -7
- package/build/config/cache.d.ts.map +0 -1
- package/build/config/cache.js +0 -12
- package/build/config/db.d.ts +0 -13
- package/build/config/db.d.ts.map +0 -1
- package/build/config/db.js +0 -17
- package/build/config/http.d.ts +0 -5
- package/build/config/http.d.ts.map +0 -1
- package/build/config/http.js +0 -10
- package/build/config/index.d.ts +0 -9
- package/build/config/index.d.ts.map +0 -1
- package/build/config/index.js +0 -92
- package/build/config/logger.d.ts +0 -7
- package/build/config/logger.d.ts.map +0 -1
- package/build/config/logger.js +0 -33
- package/build/config/messaging.d.ts +0 -7
- package/build/config/messaging.d.ts.map +0 -1
- package/build/config/messaging.js +0 -12
- package/build/config/task.d.ts +0 -6
- package/build/config/task.d.ts.map +0 -1
- package/build/config/task.js +0 -13
- package/build/index.d.ts.map +0 -1
- package/build/middlewares/access.d.ts.map +0 -1
- package/build/middlewares/index.d.ts.map +0 -1
- package/build/services/express.d.ts.map +0 -1
- package/build/services/file.d.ts +0 -12
- package/build/services/file.d.ts.map +0 -1
- package/build/services/index.d.ts.map +0 -1
- package/build/services/rabitmq.d.ts.map +0 -1
- package/build/services/redis.d.ts.map +0 -1
- package/build/services/sequelize.d.ts.map +0 -1
- package/build/services/socket.d.ts.map +0 -1
- package/build/services/task.d.ts.map +0 -1
- package/build/utils/database.d.ts.map +0 -1
- package/build/utils/index.d.ts.map +0 -1
- package/build/utils/logger.d.ts.map +0 -1
- package/build/utils/logger.js +0 -45
- /package/{build → lib}/app/service.d.ts +0 -0
- /package/{build → lib}/app/service.d.ts.map +0 -0
- /package/{build → lib}/app/service.js +0 -0
- /package/{build → lib}/app/singleton.js +0 -0
- /package/{build/@types → lib/contracts}/console.d.ts +0 -0
- /package/{build/@types → lib/contracts}/console.js +0 -0
- /package/{build/@types → lib/contracts}/entity.js +0 -0
- /package/{build/@types → lib/contracts}/http.d.ts +0 -0
- /package/{build/@types → lib/contracts}/http.js +0 -0
- /package/{build/@types → lib/contracts}/service.d.ts +0 -0
- /package/{build/@types → lib/contracts}/service.js +0 -0
- /package/{build/@types → lib/contracts}/session.js +0 -0
- /package/{build/@types/app.js → lib/contracts/settings.js} +0 -0
- /package/{build/@types → lib/contracts}/singleton.js +0 -0
- /package/{build/@types → lib/contracts}/socket.js +0 -0
- /package/{build → lib}/controllers/api/index.d.ts +0 -0
- /package/{build → lib}/controllers/api/index.js +0 -0
- /package/{build → lib}/controllers/index.d.ts +0 -0
- /package/{build → lib}/controllers/index.d.ts.map +0 -0
- /package/{build → lib}/controllers/index.js +0 -0
- /package/{build/@types → lib}/express.d.js +0 -0
- /package/{build → lib}/middlewares/index.d.ts +0 -0
- /package/{build → lib}/middlewares/index.js +0 -0
- /package/{build → lib}/models/Connection.d.ts +0 -0
- /package/{build → lib}/models/Connection.d.ts.map +0 -0
- /package/{build → lib}/models/Connection.js +0 -0
- /package/{build → lib}/models/index.d.ts +0 -0
- /package/{build → lib}/models/index.d.ts.map +0 -0
- /package/{build → lib}/models/index.js +0 -0
- /package/{build → lib}/services/index.d.ts +0 -0
- /package/{build → lib}/services/index.js +0 -0
- /package/{build → lib}/services/socket.js +0 -0
- /package/{build → lib}/utils/api.js +0 -0
- /package/{build → lib}/utils/database.d.ts +0 -0
- /package/{build → lib}/utils/date.d.ts +0 -0
- /package/{build → lib}/utils/date.d.ts.map +0 -0
- /package/{build → lib}/utils/date.js +0 -0
- /package/{build → lib}/utils/index.d.ts +0 -0
- /package/{build → lib}/utils/index.js +0 -0
- /package/{build → lib}/utils/logger.d.ts +0 -0
- /package/{build → lib}/utils/session.d.ts +0 -0
- /package/{build → lib}/utils/session.d.ts.map +0 -0
- /package/{build → lib}/utils/session.js +0 -0
@@ -1,16 +1,15 @@
|
|
1
|
-
import {
|
2
|
-
import { IService } from '../@types/service';
|
1
|
+
import { IService } from '../contracts/service';
|
3
2
|
import Core from './core';
|
4
3
|
declare class Exodus extends Core {
|
5
4
|
private services;
|
6
|
-
|
7
|
-
constructor(props: TApplicationCreationProps);
|
5
|
+
constructor();
|
8
6
|
start(): Promise<void>;
|
9
7
|
initMaster(): Promise<void>;
|
10
8
|
initCluster(): Promise<void>;
|
11
9
|
createClusters(): Promise<void>;
|
12
10
|
registerSingletonService(service: IService): void;
|
13
11
|
initServices(): Promise<void>;
|
12
|
+
getVersion(): string | undefined;
|
14
13
|
}
|
15
14
|
export default Exodus;
|
16
15
|
//# sourceMappingURL=app.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/app/app.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,IAAI,MAAM,QAAQ,CAAC;AAQ1B,cAAM,MAAO,SAAQ,IAAI;IACvB,OAAO,CAAC,QAAQ,CAAa;;IAOvB,KAAK;IASL,UAAU;IAOV,WAAW;IAIX,cAAc;IAgBpB,wBAAwB,CAAC,OAAO,EAAE,QAAQ;IAGpC,YAAY;IASlB,UAAU,IAAI,MAAM,GAAG,SAAS;CAUjC;AACD,eAAe,MAAM,CAAC"}
|
package/lib/app/app.js
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _cluster = _interopRequireDefault(require("cluster"));
|
8
|
+
var fs = _interopRequireWildcard(require("fs"));
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
10
|
+
var _core = _interopRequireDefault(require("./core"));
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
14
|
+
/**
|
15
|
+
* Classe da aplicação principal
|
16
|
+
* Responsável por inicializar todos os recursos usados por este micro-serviço
|
17
|
+
*
|
18
|
+
* @class Application
|
19
|
+
* @extends {Core}
|
20
|
+
*/
|
21
|
+
class Exodus extends _core.default {
|
22
|
+
services;
|
23
|
+
|
24
|
+
//* Initialization
|
25
|
+
constructor() {
|
26
|
+
super();
|
27
|
+
this.services = [];
|
28
|
+
}
|
29
|
+
async start() {
|
30
|
+
if (_cluster.default.isPrimary) {
|
31
|
+
this.initMaster();
|
32
|
+
} else {
|
33
|
+
await this.initCluster();
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
//* Cluster Managment
|
38
|
+
async initMaster() {
|
39
|
+
this.log(`✨ Starting ${_core.default.settings.getAppication().description} · Clusters: ${_core.default.settings.getAppication().clusters}`);
|
40
|
+
this.log(`✨ Core version ${this.getVersion()}`);
|
41
|
+
this.createClusters();
|
42
|
+
}
|
43
|
+
async initCluster() {
|
44
|
+
this.log(`📊 Cluster ${_cluster.default.worker.id} started · PID ${_cluster.default.worker.process.pid}`);
|
45
|
+
this.initServices();
|
46
|
+
}
|
47
|
+
async createClusters() {
|
48
|
+
for (let i = 0; i < _core.default.settings.getAppication().clusters; i++) {
|
49
|
+
_cluster.default.fork();
|
50
|
+
}
|
51
|
+
_cluster.default.on('exit', (worker, _code, _signal) => {
|
52
|
+
this.log(`Cluester ${worker.process.pid} foi encerrado`, 'warning');
|
53
|
+
if (_core.default.settings.getAppication().clustersRestarts) {
|
54
|
+
this.log(`Reiniciando cluster`, 'warning');
|
55
|
+
_cluster.default.fork();
|
56
|
+
}
|
57
|
+
});
|
58
|
+
}
|
59
|
+
|
60
|
+
//* Service Managment
|
61
|
+
registerSingletonService(service) {
|
62
|
+
this.services.push(service);
|
63
|
+
}
|
64
|
+
async initServices() {
|
65
|
+
for (const service of this.services) {
|
66
|
+
await service.init().catch(error => {
|
67
|
+
this.log(`Erro on starting service: ${error.message || 'unknow'}`, 'danger');
|
68
|
+
});
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
// *System
|
73
|
+
getVersion() {
|
74
|
+
try {
|
75
|
+
const packageJson = fs.readFileSync(_path.default.resolve(__dirname, '../../package.json'), 'utf8');
|
76
|
+
const packageData = JSON.parse(packageJson);
|
77
|
+
return packageData.version;
|
78
|
+
} catch (error) {
|
79
|
+
console.error('Error reading package.json:', error);
|
80
|
+
return undefined;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
84
|
+
var _default = exports.default = Exodus;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { NextFunction, Response } from 'express';
|
2
|
-
import { THttpResponse, TSocket, TSocketEventDataMap, TSocketEventHandle } from '
|
2
|
+
import { THttpResponse, TSocket, TSocketEventDataMap, TSocketEventHandle } from '../contracts';
|
3
3
|
import Core from './core';
|
4
|
-
declare abstract class HttpController extends Core {
|
4
|
+
export declare abstract class HttpController extends Core {
|
5
5
|
constructor();
|
6
6
|
protected send<D = any>(objResponse: THttpResponse<D>, res: Response, next?: NextFunction): void;
|
7
7
|
protected validate(data: Record<string, any>): Promise<void>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/app/controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/F,OAAO,IAAI,MAAM,QAAQ,CAAC;AAS1B,8BAAsB,cAAe,SAAQ,IAAI;;IAe/C,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,IAAI;IAIhG,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAG7C;AAUD,8BAAsB,gBAAiB,SAAQ,IAAI;;IAKjD,SAAS,CAAC,gBAAgB,CAAC,CAAC,SAAS,MAAM,mBAAmB,EAAE,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,SAC1E,aAAa,QAAQ,mBAAmB,CAAC,CAAC,CAAC;IAM1D,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM;CAGpC;AACD,qBAAa,aAAc,SAAQ,IAAI;IACrC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,KAAK,EAAE,MAAM,mBAAmB,CAAC;gBAE/B,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB;IAM7D,IAAI,CAAC,CAAC,SAAS,MAAM,mBAAmB,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAInF,QAAQ;IAGR,SAAS;IAIT,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG;CAGjC;AAED,8BAAsB,mBAAoB,SAAQ,IAAI;;IAKpD,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM;CAGpC;AAED,eAAe,cAAc,CAAC"}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.default = exports.SocketRequest = exports.SocketController = exports.MessagingController = void 0;
|
6
|
+
exports.default = exports.SocketRequest = exports.SocketController = exports.MessagingController = exports.HttpController = void 0;
|
7
7
|
var _express = _interopRequireDefault(require("../services/express"));
|
8
8
|
var _core = _interopRequireDefault(require("./core"));
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
@@ -45,6 +45,7 @@ class HttpController extends _core.default {
|
|
45
45
|
* @class SocketController
|
46
46
|
* @extends {Core}
|
47
47
|
*/
|
48
|
+
exports.HttpController = HttpController;
|
48
49
|
class SocketController extends _core.default {
|
49
50
|
constructor() {
|
50
51
|
super();
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { TLoggerLevel } from '../contracts/console';
|
2
|
+
import CoreSettings from './settings';
|
3
|
+
declare abstract class Core {
|
4
|
+
static settings: CoreSettings;
|
5
|
+
constructor();
|
6
|
+
log(msg: string, level?: TLoggerLevel): void;
|
7
|
+
static setSettings(settings: CoreSettings): void;
|
8
|
+
}
|
9
|
+
export default Core;
|
10
|
+
//# sourceMappingURL=core.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/app/core.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,YAAY,MAAM,YAAY,CAAC;AAWtC,uBAAe,IAAI;IACjB,MAAM,CAAC,QAAQ,eAAsB;;IAK9B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,YAAuB;IA2CtD,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,YAAY;CAG1C;AAED,eAAe,IAAI,CAAC"}
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.default = void 0;
|
7
7
|
var _cluster = _interopRequireDefault(require("cluster"));
|
8
8
|
var _dateFns = require("date-fns");
|
9
|
+
var _settings = _interopRequireDefault(require("./settings"));
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
10
11
|
/**
|
11
12
|
* Class base responsável pelo gerênciamento RUNTIME da aplicação
|
@@ -17,6 +18,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
17
18
|
* @class Core
|
18
19
|
*/
|
19
20
|
class Core {
|
21
|
+
static settings = new _settings.default();
|
20
22
|
constructor() {
|
21
23
|
// #TODO
|
22
24
|
}
|
@@ -57,5 +59,8 @@ class Core {
|
|
57
59
|
params.push(msg);
|
58
60
|
console.log(query, ...params);
|
59
61
|
}
|
62
|
+
static setSettings(settings) {
|
63
|
+
this.settings = settings;
|
64
|
+
}
|
60
65
|
}
|
61
66
|
var _default = exports.default = Core;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
@@ -7,7 +7,8 @@ var _exportNames = {
|
|
7
7
|
Exodus: true,
|
8
8
|
Core: true,
|
9
9
|
Service: true,
|
10
|
-
Singleton: true
|
10
|
+
Singleton: true,
|
11
|
+
CoreSettings: true
|
11
12
|
};
|
12
13
|
Object.defineProperty(exports, "Core", {
|
13
14
|
enumerable: true,
|
@@ -15,6 +16,12 @@ Object.defineProperty(exports, "Core", {
|
|
15
16
|
return _core.default;
|
16
17
|
}
|
17
18
|
});
|
19
|
+
Object.defineProperty(exports, "CoreSettings", {
|
20
|
+
enumerable: true,
|
21
|
+
get: function () {
|
22
|
+
return _settings.default;
|
23
|
+
}
|
24
|
+
});
|
18
25
|
Object.defineProperty(exports, "Exodus", {
|
19
26
|
enumerable: true,
|
20
27
|
get: function () {
|
@@ -49,4 +56,5 @@ Object.keys(_controller).forEach(function (key) {
|
|
49
56
|
var _core = _interopRequireDefault(require("./core"));
|
50
57
|
var _service = _interopRequireDefault(require("./service"));
|
51
58
|
var _singleton = _interopRequireDefault(require("./singleton"));
|
59
|
+
var _settings = _interopRequireDefault(require("./settings"));
|
52
60
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import 'dotenv/config';
|
2
|
+
import { GeneralSettings, TApplicationSettings, TAuthenticationSettings, TCacheSettings, THttpSettings, TdatabaseSettings, Tlogger, TmessagingSettings } from '../contracts/settings';
|
3
|
+
declare class CoreSettings {
|
4
|
+
application: Partial<TApplicationSettings>;
|
5
|
+
authentication: Partial<TAuthenticationSettings>;
|
6
|
+
cache: Partial<TCacheSettings>;
|
7
|
+
database: Partial<TdatabaseSettings>;
|
8
|
+
http: Partial<THttpSettings>;
|
9
|
+
logger: Partial<Tlogger>;
|
10
|
+
messaging: Partial<TmessagingSettings>;
|
11
|
+
defaults: GeneralSettings;
|
12
|
+
settings: GeneralSettings;
|
13
|
+
constructor();
|
14
|
+
protected mergeSettings(): void;
|
15
|
+
getAppication(): TApplicationSettings;
|
16
|
+
getAuthentication(): TAuthenticationSettings;
|
17
|
+
getCache(): TCacheSettings;
|
18
|
+
getDatabase(): TdatabaseSettings;
|
19
|
+
getHttp(): THttpSettings;
|
20
|
+
getLogger(): Tlogger;
|
21
|
+
getMessaging(): TmessagingSettings;
|
22
|
+
}
|
23
|
+
export default CoreSettings;
|
24
|
+
//# sourceMappingURL=settings.d.ts.map
|
@@ -0,0 +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,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"}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
require("dotenv/config");
|
8
|
+
var _os = _interopRequireDefault(require("os"));
|
9
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
10
|
+
var _path = _interopRequireDefault(require("path"));
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
12
|
+
class CoreSettings {
|
13
|
+
application = {};
|
14
|
+
authentication = {};
|
15
|
+
cache = {};
|
16
|
+
database = {};
|
17
|
+
http = {};
|
18
|
+
logger = {};
|
19
|
+
messaging = {};
|
20
|
+
defaults = {
|
21
|
+
application: {
|
22
|
+
appId: process.env.APP_ID,
|
23
|
+
port: Number(process.env.APP_PORT),
|
24
|
+
host: process.env.APP_URL || 'http://localhost',
|
25
|
+
description: process.env.APP_DESCRIPTION || '',
|
26
|
+
clusters: Number(process.env.APP_CLUESTERS) || _os.default.cpus().length,
|
27
|
+
clustersRestarts: true,
|
28
|
+
/* File */
|
29
|
+
filePaths: {
|
30
|
+
temporary: _path.default.resolve(__dirname, '..', '..', 'public', 'tmp'),
|
31
|
+
image: _path.default.resolve(__dirname, '..', '..', 'public', 'images'),
|
32
|
+
audio: _path.default.resolve(__dirname, '..', '..', 'public', 'audios'),
|
33
|
+
document: _path.default.resolve(__dirname, '..', '..', 'public', 'documents'),
|
34
|
+
video: _path.default.resolve(__dirname, '..', '..', 'public', 'videos')
|
35
|
+
}
|
36
|
+
},
|
37
|
+
authentication: {
|
38
|
+
host: process.env.APP_SESSION_URL,
|
39
|
+
/* APPAuthID:APPAuthPort/SECURITY_JWT_ISSUER */
|
40
|
+
issuer: `exodus.session.hub:4000/${process.env.SECURITY_JWT_ISSUER}`
|
41
|
+
},
|
42
|
+
cache: {
|
43
|
+
host: process.env.CACHE_HOST || 'localhost',
|
44
|
+
port: Number(process.env.CACHE_PORT) || 6379,
|
45
|
+
password: process.env.CACHE_USER || 'eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81'
|
46
|
+
},
|
47
|
+
database: {
|
48
|
+
master: {
|
49
|
+
database: process.env.MASTER_DB_NAME || 'common',
|
50
|
+
dialect: process.env.MASTER_DB_DIALECT || 'mariadb',
|
51
|
+
username: process.env.MASTER_DB_USER || 'root',
|
52
|
+
password: process.env.MASTER_DB_PASS || ''
|
53
|
+
},
|
54
|
+
service: {
|
55
|
+
database: process.env.SERVICE_DB_NAME || 'unknow'
|
56
|
+
}
|
57
|
+
},
|
58
|
+
http: {
|
59
|
+
publicPath: '',
|
60
|
+
formulation: process.env.RESPONSE_FORMULATION_TYPE || 'standart'
|
61
|
+
},
|
62
|
+
logger: {
|
63
|
+
/**
|
64
|
+
* Diretório pardrão de logs
|
65
|
+
* @date 24/03/2023 - 20:19:18
|
66
|
+
*
|
67
|
+
*/
|
68
|
+
path: '../../logs',
|
69
|
+
/**
|
70
|
+
* Formato de saída dos arquivos de logs
|
71
|
+
* @date 24/03/2023 - 20:19:18
|
72
|
+
*
|
73
|
+
*/
|
74
|
+
fileformat: '.json',
|
75
|
+
/**
|
76
|
+
* Nível do logger
|
77
|
+
*/
|
78
|
+
level: process.env.LOGGER_LEVEL || 'info',
|
79
|
+
/**
|
80
|
+
* Transportar logs para o console do prompt
|
81
|
+
* @date 24/03/2023 - 20:19:18
|
82
|
+
*
|
83
|
+
*/
|
84
|
+
console: !!parseInt(process.env.LOGGER_CONSOLE) || false
|
85
|
+
},
|
86
|
+
messaging: {
|
87
|
+
user: process.env.MSG_USER || 'guest',
|
88
|
+
pass: process.env.MSG_PASS || 'guest',
|
89
|
+
host: process.env.MSG_HOST || 'localhost'
|
90
|
+
}
|
91
|
+
};
|
92
|
+
settings;
|
93
|
+
constructor() {
|
94
|
+
this.mergeSettings();
|
95
|
+
}
|
96
|
+
mergeSettings() {
|
97
|
+
this.settings = _lodash.default.merge({}, this.defaults, {
|
98
|
+
application: this.application,
|
99
|
+
authentication: this.authentication,
|
100
|
+
cache: this.cache,
|
101
|
+
database: this.database,
|
102
|
+
http: this.http,
|
103
|
+
logger: this.logger,
|
104
|
+
messaging: this.messaging
|
105
|
+
});
|
106
|
+
// console.log(this.settings);
|
107
|
+
}
|
108
|
+
getAppication() {
|
109
|
+
return this.settings.application;
|
110
|
+
}
|
111
|
+
getAuthentication() {
|
112
|
+
return this.settings.authentication;
|
113
|
+
}
|
114
|
+
getCache() {
|
115
|
+
return this.settings.cache;
|
116
|
+
}
|
117
|
+
getDatabase() {
|
118
|
+
return this.settings.database;
|
119
|
+
}
|
120
|
+
getHttp() {
|
121
|
+
return this.settings.http;
|
122
|
+
}
|
123
|
+
getLogger() {
|
124
|
+
return this.settings.logger;
|
125
|
+
}
|
126
|
+
getMessaging() {
|
127
|
+
return this.settings.messaging;
|
128
|
+
}
|
129
|
+
}
|
130
|
+
var _default = exports.default = CoreSettings;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../src/app/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../src/app/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,IAAI,MAAM,QAAQ,CAAC;AAW1B,uBAAe,SAAU,SAAQ,IAAI;IAEnC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC;;WAKb,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,GAE3C,CAAC;CAE5B;AAED,eAAe,SAAS,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/contracts/console.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,SAAS,GACT,UAAU,GACV,SAAS,GACT,QAAQ,CAAC"}
|
@@ -21,11 +21,12 @@ export interface IAccount {
|
|
21
21
|
name: string;
|
22
22
|
params?: Record<string, any> | null;
|
23
23
|
picture: string | null;
|
24
|
-
type:
|
24
|
+
type: TAccountType;
|
25
25
|
username: string;
|
26
26
|
uuid: string;
|
27
27
|
comments: string;
|
28
28
|
}
|
29
|
+
export type TAccountType = 'ADMINISTRATOR' | 'BUSINESS' | 'SUPORT' | 'AGENT' | 'SUPERVISOR';
|
29
30
|
export interface IEnvironment {
|
30
31
|
uuid: string;
|
31
32
|
name: string;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/contracts/entity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,KAAK,EACL,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,KAAK,IAAI,WAAW,CAAC,eAAe,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC,CAAC;AAC5F,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,KAAK,IAAI,YAAY,CAAC,eAAe,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC,CAAC;AAC9F,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,KAAK,IAAI,IAAI,CAC/C,mBAAmB,CAAC,uBAA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GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB;AACD,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,CAAC,EAAE,CAAC;CACX;AAED,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,MAAM,YAAY,CAAC,IAAI,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC"}
|
@@ -1,10 +1,10 @@
|
|
1
|
-
export * from './app';
|
2
1
|
export * from './console';
|
3
2
|
export * from './entity';
|
4
3
|
export * from './http';
|
5
4
|
export * from './messaging';
|
6
5
|
export * from './service';
|
7
6
|
export * from './session';
|
7
|
+
export * from './settings';
|
8
8
|
export * from './singleton';
|
9
9
|
export * from './socket';
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
@@ -3,17 +3,6 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
var _app = require("./app");
|
7
|
-
Object.keys(_app).forEach(function (key) {
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
9
|
-
if (key in exports && exports[key] === _app[key]) return;
|
10
|
-
Object.defineProperty(exports, key, {
|
11
|
-
enumerable: true,
|
12
|
-
get: function () {
|
13
|
-
return _app[key];
|
14
|
-
}
|
15
|
-
});
|
16
|
-
});
|
17
6
|
var _console = require("./console");
|
18
7
|
Object.keys(_console).forEach(function (key) {
|
19
8
|
if (key === "default" || key === "__esModule") return;
|
@@ -80,6 +69,17 @@ Object.keys(_session).forEach(function (key) {
|
|
80
69
|
}
|
81
70
|
});
|
82
71
|
});
|
72
|
+
var _settings = require("./settings");
|
73
|
+
Object.keys(_settings).forEach(function (key) {
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
75
|
+
if (key in exports && exports[key] === _settings[key]) return;
|
76
|
+
Object.defineProperty(exports, key, {
|
77
|
+
enumerable: true,
|
78
|
+
get: function () {
|
79
|
+
return _settings[key];
|
80
|
+
}
|
81
|
+
});
|
82
|
+
});
|
83
83
|
var _singleton = require("./singleton");
|
84
84
|
Object.keys(_singleton).forEach(function (key) {
|
85
85
|
if (key === "default" || key === "__esModule") return;
|
@@ -3,6 +3,7 @@ export declare enum EMessagingQueue {
|
|
3
3
|
test = "exodus.queue.test",
|
4
4
|
accountCreated = "exodus.account.created",
|
5
5
|
environmentCreated = "exodus.environment.created",
|
6
|
+
environmentDeleted = "exodus.environment.deleted",
|
6
7
|
environmentUpdatedToken = "exodus.environment.updated.token"
|
7
8
|
}
|
8
9
|
export type TMessageQueueDataMap = {
|
@@ -16,6 +17,11 @@ export type TMessageQueueDataMap = {
|
|
16
17
|
oldToken: string;
|
17
18
|
newToken: string;
|
18
19
|
};
|
20
|
+
[EMessagingQueue.environmentDeleted]: {
|
21
|
+
uuid: string;
|
22
|
+
token: string;
|
23
|
+
database: string;
|
24
|
+
};
|
19
25
|
};
|
20
26
|
export type TMessagingQueueHandler<K extends keyof TMessageQueueDataMap = any> = (data: TMessageQueueDataMap[K], ack: () => void) => void;
|
21
27
|
export type TMessagingQueueEventList = Partial<Record<keyof TMessageQueueDataMap, TMessagingQueueHandler>>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/contracts/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAElD,oBAAY,eAAe;IACzB,IAAI,sBAAsB;IAG1B,cAAc,2BAA2B;IAGzC,kBAAkB,+BAA+B;IACjD,kBAAkB,+BAA+B;IACjD,uBAAuB,qCAAqC;CAC7D;AAGD,MAAM,MAAM,oBAAoB,GAAG;IACjC,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE;QACtB,IAAI,EAAE,GAAG,CAAC;KACX,CAAC;IACF,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC3C,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,YAAY,CAAC;IACnD,CAAC,eAAe,CAAC,uBAAuB,CAAC,EAAE;QACzC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE;QACpC,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,MAAM,oBAAoB,GAAG,GAAG,IAAI,CAC/E,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,EAC7B,GAAG,EAAE,MAAM,IAAI,KACZ,IAAI,CAAC;AAEV,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,MAAM,CAAC,MAAM,oBAAoB,EAAE,sBAAsB,CAAC,CAC3D,CAAC"}
|
@@ -8,6 +8,7 @@ let EMessagingQueue = exports.EMessagingQueue = /*#__PURE__*/function (EMessagin
|
|
8
8
|
EMessagingQueue["test"] = "exodus.queue.test";
|
9
9
|
EMessagingQueue["accountCreated"] = "exodus.account.created";
|
10
10
|
EMessagingQueue["environmentCreated"] = "exodus.environment.created";
|
11
|
+
EMessagingQueue["environmentDeleted"] = "exodus.environment.deleted";
|
11
12
|
EMessagingQueue["environmentUpdatedToken"] = "exodus.environment.updated.token";
|
12
13
|
return EMessagingQueue;
|
13
14
|
}({}); // Mapeamento de tópicos para tipos
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/contracts/service.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/contracts/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,QAAQ,CAAC;CACnB"}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import { Dialect } from 'sequelize';
|
2
|
+
export type TFilePathSettings = {
|
3
|
+
temporary: string;
|
4
|
+
image: string;
|
5
|
+
audio: string;
|
6
|
+
document: string;
|
7
|
+
video: string;
|
8
|
+
};
|
9
|
+
export type TApplicationSettings = {
|
10
|
+
appId: string;
|
11
|
+
port: number;
|
12
|
+
host: string;
|
13
|
+
description: string;
|
14
|
+
clusters: number;
|
15
|
+
clustersRestarts: boolean;
|
16
|
+
filePaths: TFilePathSettings;
|
17
|
+
};
|
18
|
+
export type TAuthenticationSettings = {
|
19
|
+
host: string;
|
20
|
+
issuer: string;
|
21
|
+
};
|
22
|
+
export type TCacheSettings = {
|
23
|
+
host: string;
|
24
|
+
port: number;
|
25
|
+
password: string;
|
26
|
+
};
|
27
|
+
export type TdatabaseSettings = {
|
28
|
+
master: {
|
29
|
+
database: string;
|
30
|
+
dialect: Dialect;
|
31
|
+
username: string;
|
32
|
+
password: string;
|
33
|
+
};
|
34
|
+
service: {
|
35
|
+
database: string;
|
36
|
+
};
|
37
|
+
};
|
38
|
+
export type THttpSettings = {
|
39
|
+
publicPath: string;
|
40
|
+
formulation: 'standart' | 'direct';
|
41
|
+
};
|
42
|
+
export type Tlogger = {
|
43
|
+
path: string;
|
44
|
+
fileformat: '.json' | '.log';
|
45
|
+
level: 'warn' | 'info' | 'error' | 'trace';
|
46
|
+
console: boolean;
|
47
|
+
};
|
48
|
+
export type TmessagingSettings = {
|
49
|
+
user: string;
|
50
|
+
pass: string;
|
51
|
+
host: string;
|
52
|
+
};
|
53
|
+
export type GeneralSettings = {
|
54
|
+
application: TApplicationSettings;
|
55
|
+
authentication: TAuthenticationSettings;
|
56
|
+
cache: TCacheSettings;
|
57
|
+
database: TdatabaseSettings;
|
58
|
+
http: THttpSettings;
|
59
|
+
logger: Tlogger;
|
60
|
+
messaging: TmessagingSettings;
|
61
|
+
};
|
62
|
+
//# sourceMappingURL=settings.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/contracts/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OA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AS,EAAE,kBAAkB,CAAC;CAC/B,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"singleton.d.ts","sourceRoot":"","sources":["../../src/contracts/singleton.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAEzC,KAAK,kBAAkB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,UAAU,GAAG,GAAG,KAAK,GAAG,CAAC;CAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AACjG,KAAK,cAAc,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,SAAS,IAAI,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAAE,QAAQ,CAAC,CAAA;CAAE,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"socket.d.ts","sourceRoot":"","sources":["../../src/contracts/socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,oBAAY,YAAY;IACtB,IAAI,6BAA6B;IACjC,KAAK,8BAA8B;CACpC;AAED,KAAK,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3C,KAAK,kBAAkB,GAAG,CAAC,MAAM,CAAC,CAAC;AAGnC,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,kBAAkB,CAAC;IACxC,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC1C,CAAC;AACF,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,CAAC,CAAC;AAExF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,MAAM,mBAAmB,IAAI,CACtE,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,MAAM,KACV,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE3B,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,mBAAmB,IAAI,CAEpE,OAAO,EAAE,aAAa,EACtB,GAAG,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAC5B,IAAI,CAAC;AAEV,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACpC,MAAM,CAAC,MAAM,mBAAmB,EAAE,kBAAkB,CAAC,MAAM,mBAAmB,CAAC,CAAC,CACjF,CAAC;AAEF,MAAM,MAAM,6BAA6B,CAAC,CAAC,SAAS,MAAM,mBAAmB,GAAG,GAAG,IAAI,CACrF,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,KACzB,IAAI,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/controllers/api/file.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/controllers/api/file.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,sBAAsB,CAAC;AAG9B,cAAM,cAAe,SAAQ,cAAc;IACzC,MAAM,EAAE,cAAc,CAWpB;CACH;AAED,eAAe,cAAc,CAAC"}
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
exports.default = void 0;
|
7
7
|
var _controller = _interopRequireDefault(require("../../app/controller"));
|
8
8
|
require("express-async-errors");
|
9
|
-
var _http = require("
|
9
|
+
var _http = require("../../contracts/http");
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
11
11
|
// !Tratamento de erros asyncronos
|
12
12
|
|