exodus-framework 2.0.955 → 2.0.956

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.
Files changed (105) hide show
  1. package/lib/app/classes/broadcast.js +79 -0
  2. package/lib/app/classes/cache.js +94 -0
  3. package/lib/app/classes/communication.js +99 -0
  4. package/lib/app/classes/communicationcontext.js +1 -0
  5. package/lib/app/classes/event.js +94 -0
  6. package/lib/app/classes/index.js +105 -0
  7. package/lib/app/classes/managed.js +145 -0
  8. package/lib/app/classes/service.js +232 -0
  9. package/lib/app/classes/servicemodel.js +22 -0
  10. package/lib/app/classes/singleton.js +26 -0
  11. package/lib/app/classes/socket/clienthandler.js +54 -0
  12. package/lib/app/classes/socket/eventhandler.js +51 -0
  13. package/lib/app/classes/socket/index.js +20 -0
  14. package/lib/app/classes/system.js +49 -0
  15. package/lib/app/controller.js +97 -0
  16. package/lib/app/core.js +47 -0
  17. package/lib/app/error.js +66 -0
  18. package/lib/app/exodus.js +97 -0
  19. package/lib/app/index.js +68 -0
  20. package/lib/app/settings.js +161 -0
  21. package/lib/certificates/private_key.pem +27 -0
  22. package/lib/certificates/public_key.pem +9 -0
  23. package/lib/contracts/communication/communication.js +39 -0
  24. package/lib/contracts/communication/index.js +27 -0
  25. package/lib/contracts/communication/operation.js +5 -0
  26. package/lib/contracts/console.js +5 -0
  27. package/lib/contracts/contansts.js +13 -0
  28. package/lib/contracts/core.js +12 -0
  29. package/lib/contracts/entity.js +5 -0
  30. package/lib/contracts/http.js +52 -0
  31. package/lib/contracts/index.js +104 -0
  32. package/lib/contracts/messaging.js +50 -0
  33. package/lib/contracts/security.js +5 -0
  34. package/lib/contracts/service.js +11 -0
  35. package/lib/contracts/session.js +5 -0
  36. package/lib/contracts/settings.js +5 -0
  37. package/lib/contracts/singleton.js +5 -0
  38. package/lib/contracts/socket.js +11 -0
  39. package/lib/contracts/tasks.js +1 -0
  40. package/lib/controllers/api/file.js +24 -0
  41. package/lib/controllers/api/index.js +13 -0
  42. package/lib/controllers/api/log.js +55 -0
  43. package/lib/controllers/api/report.js +55 -0
  44. package/lib/controllers/index.js +16 -0
  45. package/lib/controllers/messaging/application.js +75 -0
  46. package/lib/controllers/messaging/database.js +64 -0
  47. package/lib/controllers/messaging/environment.js +111 -0
  48. package/lib/express.d.js +5 -0
  49. package/lib/index.js +104 -0
  50. package/lib/middlewares/access.js +114 -0
  51. package/lib/middlewares/authentication.js +104 -0
  52. package/lib/middlewares/file.js +41 -0
  53. package/lib/middlewares/index.js +36 -0
  54. package/lib/models/Application.js +65 -0
  55. package/lib/models/DatabaseHost.js +62 -0
  56. package/lib/models/EnvConnection.js +41 -0
  57. package/lib/models/Log.js +67 -0
  58. package/lib/models/Report.js +65 -0
  59. package/lib/models/System.js +54 -0
  60. package/lib/models/index.js +82 -0
  61. package/lib/routes/api/index.js +16 -0
  62. package/lib/routes/api/v1/index.js +38 -0
  63. package/lib/routes/api/v1/logs.js +19 -0
  64. package/lib/routes/api/v1/report.js +19 -0
  65. package/lib/routes/api/v1/sse.js +36 -0
  66. package/lib/routes/index.js +27 -0
  67. package/lib/routes/messaging/index.js +34 -0
  68. package/lib/services/database.js +136 -0
  69. package/lib/services/ecosystem.js +46 -0
  70. package/lib/services/express.js +162 -0
  71. package/lib/services/file.js +65 -0
  72. package/lib/services/file_new.js +136 -0
  73. package/lib/services/index.js +108 -0
  74. package/lib/services/log.js +26 -0
  75. package/lib/services/rabitmq.js +187 -0
  76. package/lib/services/redis.js +84 -0
  77. package/lib/services/security.js +231 -0
  78. package/lib/services/sequelize.js +313 -0
  79. package/lib/services/socket.js +123 -0
  80. package/lib/services/task/TaskServiceBase.js +17 -0
  81. package/lib/services/task/index.js +40 -0
  82. package/lib/services/task/queue/QueueService.js +48 -0
  83. package/lib/services/task/queue/QueueTask.js +134 -0
  84. package/lib/services/task/queue/SingleQueue.js +68 -0
  85. package/lib/services/task/queue/index.js +27 -0
  86. package/lib/services/task/scheduler/SchedulerService.js +31 -0
  87. package/lib/services/task/scheduler/SchedulerTask.js +211 -0
  88. package/lib/services/task/scheduler/index.js +20 -0
  89. package/lib/services/test.js +27 -0
  90. package/lib/socket.d.js +3 -0
  91. package/lib/tasks/index.js +27 -0
  92. package/lib/tasks/queue/application.js +44 -0
  93. package/lib/tasks/queue/environment.js +92 -0
  94. package/lib/tasks/queue/index.js +20 -0
  95. package/lib/tasks/queue/teste.js +21 -0
  96. package/lib/tasks/schedule/index.js +13 -0
  97. package/lib/tasks/schedule/restart.js +19 -0
  98. package/lib/tasks/schedule/teste.js +61 -0
  99. package/lib/utils/api.js +65 -0
  100. package/lib/utils/database.js +157 -0
  101. package/lib/utils/date.js +28 -0
  102. package/lib/utils/index.js +60 -0
  103. package/lib/utils/logger.js +51 -0
  104. package/lib/utils/session.js +23 -0
  105. package/package.json +1 -1
@@ -0,0 +1,97 @@
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 _ = require(".");
9
+ var _managed = _interopRequireDefault(require("./classes/managed"));
10
+ var _core = _interopRequireDefault(require("./core"));
11
+ var _event = _interopRequireDefault(require("./classes/event"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ /**
14
+ * Classe da aplicação principal
15
+ * Responsável por inicializar todos os recursos usados por este micro-serviço
16
+ *
17
+ * @class Exodus
18
+ * @extends {Core}
19
+ */
20
+ class Exodus extends _managed.default {
21
+ services;
22
+ constructor(settings) {
23
+ super();
24
+ _core.default.setSettings(settings);
25
+ this.services = [];
26
+ }
27
+ async start() {
28
+ _event.default.Start();
29
+ if (this.isMaster()) {
30
+ this.log(`Iniciando em Master ${process.pid}`);
31
+ if (await this.initServices()) {
32
+ await Promise.all(this.services.map(async s => {
33
+ !s.isStartFailed() && (await s.onExodusStarted());
34
+ }));
35
+ this.createClusters();
36
+ }
37
+ }
38
+ if (this.isCluster()) {
39
+ this.log(`Iniciando em Cluster ${this.getWorkId()}`);
40
+ if (await this.initServices()) {
41
+ this.services.forEach(s => s.onExodusStarted());
42
+ }
43
+ }
44
+ }
45
+
46
+ //# Cluster Management
47
+ createClusters() {
48
+ for (let i = 0; i < _core.default.settings.getAppication().clusters; i++) {
49
+ _cluster.default.fork();
50
+ }
51
+ _event.default.registerClusterExitHandle((_code, worker) => {
52
+ this.log(`Cluster ${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 Management
61
+ register(service) {
62
+ this.services.push(service.getService());
63
+ }
64
+ async initServices() {
65
+ for (const service of this.services) {
66
+ try {
67
+ await this.startService(service);
68
+ } catch (error) {
69
+ new _.ErrorHandler(`Erro on starting service: ${service.constructor.name} | reason: ${error.message || 'unknow'}`, error);
70
+ this.log('Não foi possível iniciar os serviços', 'warning');
71
+ return false;
72
+ }
73
+ }
74
+ this.log('Serviços iniciados');
75
+ return true;
76
+ }
77
+ async startService(service) {
78
+ let starting = true;
79
+ await service.onServiceInit();
80
+ while (starting) {
81
+ if (service.isStartFailed()) {
82
+ await service.onStartFail();
83
+ starting = false;
84
+ break;
85
+ }
86
+ if (await service.onStart()) {
87
+ starting = false;
88
+ await service.onStartSuccessfully();
89
+ break;
90
+ } else {
91
+ await service.onStartAttempt();
92
+ }
93
+ await new Promise(resolve => setTimeout(() => resolve(true), service.getAttemptDelay()));
94
+ }
95
+ }
96
+ }
97
+ var _default = exports.default = Exodus;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ Exodus: true,
8
+ Core: true,
9
+ CoreSettings: true
10
+ };
11
+ Object.defineProperty(exports, "Core", {
12
+ enumerable: true,
13
+ get: function () {
14
+ return _core.default;
15
+ }
16
+ });
17
+ Object.defineProperty(exports, "CoreSettings", {
18
+ enumerable: true,
19
+ get: function () {
20
+ return _settings.default;
21
+ }
22
+ });
23
+ Object.defineProperty(exports, "Exodus", {
24
+ enumerable: true,
25
+ get: function () {
26
+ return _exodus.default;
27
+ }
28
+ });
29
+ var _exodus = _interopRequireDefault(require("./exodus"));
30
+ var _controller = require("./controller");
31
+ Object.keys(_controller).forEach(function (key) {
32
+ if (key === "default" || key === "__esModule") return;
33
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
34
+ if (key in exports && exports[key] === _controller[key]) return;
35
+ Object.defineProperty(exports, key, {
36
+ enumerable: true,
37
+ get: function () {
38
+ return _controller[key];
39
+ }
40
+ });
41
+ });
42
+ var _error = require("./error");
43
+ Object.keys(_error).forEach(function (key) {
44
+ if (key === "default" || key === "__esModule") return;
45
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
46
+ if (key in exports && exports[key] === _error[key]) return;
47
+ Object.defineProperty(exports, key, {
48
+ enumerable: true,
49
+ get: function () {
50
+ return _error[key];
51
+ }
52
+ });
53
+ });
54
+ var _classes = require("./classes");
55
+ Object.keys(_classes).forEach(function (key) {
56
+ if (key === "default" || key === "__esModule") return;
57
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
58
+ if (key in exports && exports[key] === _classes[key]) return;
59
+ Object.defineProperty(exports, key, {
60
+ enumerable: true,
61
+ get: function () {
62
+ return _classes[key];
63
+ }
64
+ });
65
+ });
66
+ var _core = _interopRequireDefault(require("./core"));
67
+ var _settings = _interopRequireDefault(require("./settings"));
68
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -0,0 +1,161 @@
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
+ issuer: `${process.env.APP_ID}/${process.env.SECURITY_JWT_ISSUER}`,
40
+ serviceIssuer: `exodus.session.hub:4000/${process.env.SECURITY_JWT_ISSUER}`,
41
+ servicePublicKeyPath: _path.default.resolve(__dirname, '../certificates/service_key.pem'),
42
+ certPath: _path.default.resolve(__dirname, '../certificates'),
43
+ algorithm: 'aes-256-cbc',
44
+ initialVector: 16,
45
+ signExpirationSecs: 60 * 60 * 4 //4hours
46
+ },
47
+ cache: {
48
+ host: process.env.CACHE_HOST || 'localhost',
49
+ port: Number(process.env.CACHE_PORT) || 6379,
50
+ password: process.env.CACHE_USER || 'eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81'
51
+ },
52
+ database: {
53
+ main: {
54
+ database: process.env.DB_NAME || 'unknow',
55
+ dialect: process.env.DB_DIALECT || 'mariadb',
56
+ username: process.env.DB_USER || 'root',
57
+ password: process.env.DB_PASS || '',
58
+ log: (_sql, _timing) => {
59
+ return;
60
+ },
61
+ pool: {
62
+ max: 2,
63
+ // Número máximo de conexões no pool
64
+ min: 0,
65
+ // Número mínimo de conexões no pool
66
+ acquire: 30000,
67
+ // Tempo máximo (em ms) para adquirir uma conexão do pool
68
+ idle: 10000 // Tempo máximo (em ms) que uma conexão pode ficar inativa
69
+ }
70
+ },
71
+ service: {
72
+ log: (_sql, _timing) => {
73
+ return;
74
+ },
75
+ pool: {
76
+ max: 100,
77
+ // Número máximo de conexões no pool
78
+ min: 5,
79
+ // Número mínimo de conexões no pool
80
+ acquire: 30000,
81
+ // Tempo máximo (em ms) para adquirir uma conexão do pool
82
+ idle: 10000 // Tempo máximo (em ms) que uma conexão pode ficar inativa
83
+ }
84
+ }
85
+ },
86
+ http: {
87
+ publicPath: _path.default.resolve(__dirname, '..', '..', 'public'),
88
+ formulation: process.env.RESPONSE_FORMULATION_TYPE || 'standart'
89
+ },
90
+ logger: {
91
+ /**
92
+ * Diretório pardrão de logs
93
+ * @date 24/03/2023 - 20:19:18
94
+ *
95
+ */
96
+ path: _path.default.resolve(__dirname, '../../logs'),
97
+ /**
98
+ * Formato de saída dos arquivos de logs
99
+ * @date 24/03/2023 - 20:19:18
100
+ *
101
+ */
102
+ fileformat: '.json',
103
+ /**
104
+ * Nível do logger
105
+ */
106
+ level: process.env.LOGGER_LEVEL || 'info',
107
+ /**
108
+ * Transportar logs para o console do prompt
109
+ * @date 24/03/2023 - 20:19:18
110
+ *
111
+ */
112
+ console: !!parseInt(process.env.LOGGER_CONSOLE) || false
113
+ },
114
+ messaging: {
115
+ user: process.env.MSG_USER || 'guest',
116
+ pass: process.env.MSG_PASS || 'guest',
117
+ host: process.env.MSG_HOST || 'localhost',
118
+ exchanges: {
119
+ main: 'exodus.messaging.events.exchange'
120
+ }
121
+ }
122
+ };
123
+ settings;
124
+ constructor() {
125
+ this.mergeSettings();
126
+ }
127
+ mergeSettings() {
128
+ this.settings = _lodash.default.merge({}, this.defaults, {
129
+ application: this.application,
130
+ authentication: this.authentication,
131
+ cache: this.cache,
132
+ database: this.database,
133
+ http: this.http,
134
+ logger: this.logger,
135
+ messaging: this.messaging
136
+ });
137
+ // console.log(this.settings);
138
+ }
139
+ getAppication() {
140
+ return this.settings.application;
141
+ }
142
+ getAuthentication() {
143
+ return this.settings.authentication;
144
+ }
145
+ getCache() {
146
+ return this.settings.cache;
147
+ }
148
+ getDatabase() {
149
+ return this.settings.database;
150
+ }
151
+ getHttp() {
152
+ return this.settings.http;
153
+ }
154
+ getLogger() {
155
+ return this.settings.logger;
156
+ }
157
+ getMessaging() {
158
+ return this.settings.messaging;
159
+ }
160
+ }
161
+ var _default = exports.default = CoreSettings;
@@ -0,0 +1,27 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEogIBAAKCAQEAxINXETYzypGXPKCCECqCqf8dAceAfQV5TIas9T3Pgo00cw3c
3
+ rcaeV+mAbOUrlQy5pnBQGM0od3zJESkkyI6z4DMUhmK260iQsPE2v7Mi5/nc6zKB
4
+ 9lYodWB2+DLc4fFjSA7t5OK4bwiaQ3k2ZtAbYrPIZ2iBv/p0ptIoMWYJUy1XkGWF
5
+ pb0ktDLSdxgJCo0lTNE8Nqh9vM4k/xFmbHfPSMyTV3s0zQO0CAS1rafQtgP4ZqQ2
6
+ 0B6MnidiJVi/Uyne24pCQMBZkG3mGMvXHqZOPVxC3ZvT0+bczR1qAsnARbAszTVp
7
+ AXhFysh7r5GYfuZEc/fAbpu7hOG3VIvOb/yMCQIDAQABAoIBAETWMTChSQEjgNPG
8
+ 8eiRy5Wa/OE7rkGdIkFxR7LchQ0ZQ48uAuiIk7z92XPLzzl17K5l11jovM0mVBSD
9
+ 0hPDETVvDziH6cV/dNfWlzQNnyOdfgqRdb8BrUh4kxQcVQ18jieWuzSbSrnyTH9o
10
+ PWtEaONpUMEQdar3I9ev9E5hjNCqiiTDwC2ay2bU+G9nWmbb5l1EzNQLxm73eKbI
11
+ +MDNA8FPMjmjyJ1zktt7bNtJa81/Ub+7RpMchlpREUhiVAckASd6y/B2Znm4R/Po
12
+ 9Blb05A0oN/XC7PaqnxbBXXNxe5iwbRbxqd1q+om2qH25f17Wm5qtgBsUjcikPpo
13
+ 1BFpV7UCgYEA/O5OR5jZUABUWLb49gd9EOj4BzVFOZN25EhwKbjyloqefsd0A+Wu
14
+ k87IrskecustdrDl40Gve3uqdZ28V3B2O5QSYfdA890ebNnyrNox1y/3A6sCH95H
15
+ PfZgnCowOTle01qRAKWaInHJwIiWGXMpHAqRWrsQ8at0r6XW111ZnTMCgYEAxuXH
16
+ vtrX40U18XpFqO1tC5+M9Bhz+gfX66jibsMLqp290HxhImpegCsojZHp5BDa/3Ze
17
+ 1aSXINlAuP6fLYlslvZ3RO+JVXDGARaat8M2YCWxJxsMvqS9OSweAwonRkHkWxMa
18
+ k+EzMiW5WaXBYy+Ktd5JQRnw1oA9iRIwjKoiGdMCgYB4hiH9EgOzkISgxYe6zPS2
19
+ oxzVanfzKKbFvxLbfsryG1nNNcO9u6vFuQp9505AGnrOjRrugLVbFSGz7Bb8X5Wn
20
+ bDaaQhTMX7iIzA5Meai4Tp3ZPJrFjsjJ6OY+ZAgYrJLYCdcAxOi+sxQdT7iepfaX
21
+ 6x06a9t2HWp77H2EoHH8awKBgGnbYbPyRXRwIYWjze9abe8Bu8MuQIuSIRkLiXfp
22
+ 1wu3aI7No+TtN95/GdY/EnyPe/76wP5z2vtgpVHQMmfJ/EFca54E3tLacoehwDaN
23
+ byM87Ewj2WSdyRfkoxR7EuwRpbfTMxIBiX3nFf7geUyQwQKKi/JaHBQNrLKHO8+h
24
+ vQSBAoGAe+wjhUmrzYWoFtTHDLZyxiBA2ps5oXvjojk9GQPVVwAxxfIfXiiQ2rYE
25
+ oL1ZQuRHn2aZXwEpc+Tr0LeMMiWSzSsYSrnhlez4WX0/TPuervB7xZ7g1dj4kK2E
26
+ j+P9Z1wIWVy6h+N5OTM68GEe5GajaB/jpWbrmuLGDNaYJhwmw/Q=
27
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1,9 @@
1
+ -----BEGIN PUBLIC KEY-----
2
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxINXETYzypGXPKCCECqC
3
+ qf8dAceAfQV5TIas9T3Pgo00cw3crcaeV+mAbOUrlQy5pnBQGM0od3zJESkkyI6z
4
+ 4DMUhmK260iQsPE2v7Mi5/nc6zKB9lYodWB2+DLc4fFjSA7t5OK4bwiaQ3k2ZtAb
5
+ YrPIZ2iBv/p0ptIoMWYJUy1XkGWFpb0ktDLSdxgJCo0lTNE8Nqh9vM4k/xFmbHfP
6
+ SMyTV3s0zQO0CAS1rafQtgP4ZqQ20B6MnidiJVi/Uyne24pCQMBZkG3mGMvXHqZO
7
+ PVxC3ZvT0+bczR1qAsnARbAszTVpAXhFysh7r5GYfuZEc/fAbpu7hOG3VIvOb/yM
8
+ CQIDAQAB
9
+ -----END PUBLIC KEY-----
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.eMessageType = exports.eMessageStateType = exports.eConversationPresence = exports.eConversationChannel = void 0;
7
+ let eMessageStateType = exports.eMessageStateType = /*#__PURE__*/function (eMessageStateType) {
8
+ eMessageStateType["SENT"] = "SENT";
9
+ eMessageStateType["RECEIVED"] = "RECEIVED";
10
+ eMessageStateType["READ"] = "READ";
11
+ eMessageStateType["ERROR"] = "ERROR";
12
+ eMessageStateType["PENDING"] = "PENDING";
13
+ return eMessageStateType;
14
+ }({});
15
+ let eMessageType = exports.eMessageType = /*#__PURE__*/function (eMessageType) {
16
+ eMessageType["TEXT"] = "TEXT";
17
+ eMessageType["AUDIO"] = "AUDIO";
18
+ eMessageType["VIDEO"] = "VIDEO";
19
+ eMessageType["IMAGE"] = "IMAGE";
20
+ eMessageType["FILE"] = "FILE";
21
+ eMessageType["STICKER"] = "STICKER";
22
+ eMessageType["LOCATION"] = "LOCATION";
23
+ eMessageType["CONTACT"] = "CONTACT";
24
+ return eMessageType;
25
+ }({});
26
+ let eConversationChannel = exports.eConversationChannel = /*#__PURE__*/function (eConversationChannel) {
27
+ eConversationChannel["FACEBOOK"] = "facebook";
28
+ eConversationChannel["WHATSAPP"] = "whatsapp";
29
+ eConversationChannel["TELEGRAM"] = "telegram";
30
+ return eConversationChannel;
31
+ }({});
32
+ let eConversationPresence = exports.eConversationPresence = /*#__PURE__*/function (eConversationPresence) {
33
+ eConversationPresence[eConversationPresence["ONLINE"] = 0] = "ONLINE";
34
+ eConversationPresence[eConversationPresence["OFFLINE"] = 1] = "OFFLINE";
35
+ eConversationPresence[eConversationPresence["COMPOSING"] = 2] = "COMPOSING";
36
+ eConversationPresence[eConversationPresence["RECORDING"] = 3] = "RECORDING";
37
+ eConversationPresence[eConversationPresence["PAUSED"] = 4] = "PAUSED";
38
+ return eConversationPresence;
39
+ }({});
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _communication = require("./communication");
7
+ Object.keys(_communication).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _communication[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _communication[key];
14
+ }
15
+ });
16
+ });
17
+ var _operation = require("./operation");
18
+ Object.keys(_operation).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _operation[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _operation[key];
25
+ }
26
+ });
27
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.eScheduleTaskInterval = void 0;
7
+ let eScheduleTaskInterval = exports.eScheduleTaskInterval = /*#__PURE__*/function (eScheduleTaskInterval) {
8
+ eScheduleTaskInterval["CRITICAL"] = "*/1 * * * * *";
9
+ eScheduleTaskInterval["DEFAULT"] = "*/3 * * * * *";
10
+ eScheduleTaskInterval["REPORT"] = "*/10 * * * * *";
11
+ eScheduleTaskInterval["SYNC"] = "*/60 * * * * *";
12
+ return eScheduleTaskInterval;
13
+ }({});
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.eExecutionSide = void 0;
7
+ let eExecutionSide = exports.eExecutionSide = /*#__PURE__*/function (eExecutionSide) {
8
+ eExecutionSide[eExecutionSide["MASTER"] = 0] = "MASTER";
9
+ eExecutionSide[eExecutionSide["CLUSTER"] = 1] = "CLUSTER";
10
+ eExecutionSide[eExecutionSide["ANY"] = 2] = "ANY";
11
+ return eExecutionSide;
12
+ }({});
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EHttpResponseCode = exports.EApiRequestMethod = void 0;
7
+ /**
8
+ * Tipo de respostas
9
+ * @date 26/03/2023 - 21:45:23
10
+ *
11
+ */
12
+ /**
13
+ * Objeto de response padronizado
14
+ * @date 26/03/2023 - 21:45:23
15
+ *
16
+ */
17
+ /**
18
+ * Tipos de Status-Code para responses do Express
19
+ *
20
+ * @export
21
+ * @enum {number}
22
+ */
23
+ let EHttpResponseCode = exports.EHttpResponseCode = /*#__PURE__*/function (EHttpResponseCode) {
24
+ EHttpResponseCode[EHttpResponseCode["continue"] = 100] = "continue";
25
+ EHttpResponseCode[EHttpResponseCode["accepted"] = 202] = "accepted";
26
+ EHttpResponseCode[EHttpResponseCode["created"] = 201] = "created";
27
+ EHttpResponseCode[EHttpResponseCode["successfullyProcessedInformation"] = 200] = "successfullyProcessedInformation";
28
+ EHttpResponseCode[EHttpResponseCode["partiallyCompletedProcess"] = 206] = "partiallyCompletedProcess";
29
+ EHttpResponseCode[EHttpResponseCode["redirectingForResponse"] = 303] = "redirectingForResponse";
30
+ EHttpResponseCode[EHttpResponseCode["incompleteRequest"] = 400] = "incompleteRequest";
31
+ EHttpResponseCode[EHttpResponseCode["informationNotFound"] = 404] = "informationNotFound";
32
+ EHttpResponseCode[EHttpResponseCode["informationAlreadyExists"] = 409] = "informationAlreadyExists";
33
+ EHttpResponseCode[EHttpResponseCode["preconditionRequired"] = 428] = "preconditionRequired";
34
+ EHttpResponseCode[EHttpResponseCode["unprocessableEntity"] = 422] = "unprocessableEntity";
35
+ EHttpResponseCode[EHttpResponseCode["iternalErro"] = 500] = "iternalErro";
36
+ EHttpResponseCode[EHttpResponseCode["serviceUnavailable"] = 503] = "serviceUnavailable";
37
+ EHttpResponseCode[EHttpResponseCode["methodNotAllowed"] = 405] = "methodNotAllowed";
38
+ EHttpResponseCode[EHttpResponseCode["informationNotTrue"] = 406] = "informationNotTrue";
39
+ EHttpResponseCode[EHttpResponseCode["preProcessNotInitialized"] = 424] = "preProcessNotInitialized";
40
+ EHttpResponseCode[EHttpResponseCode["requestTimeOut"] = 408] = "requestTimeOut";
41
+ EHttpResponseCode[EHttpResponseCode["informationUnauthorized"] = 401] = "informationUnauthorized";
42
+ EHttpResponseCode[EHttpResponseCode["informationBlocked"] = 403] = "informationBlocked";
43
+ return EHttpResponseCode;
44
+ }({});
45
+ let EApiRequestMethod = exports.EApiRequestMethod = /*#__PURE__*/function (EApiRequestMethod) {
46
+ EApiRequestMethod["POST"] = "post";
47
+ EApiRequestMethod["GET"] = "get";
48
+ EApiRequestMethod["PUT"] = "put";
49
+ EApiRequestMethod["DELETE"] = "delete";
50
+ EApiRequestMethod["PATCH"] = "patch";
51
+ return EApiRequestMethod;
52
+ }({});
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _console = require("./console");
7
+ Object.keys(_console).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _console[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _console[key];
14
+ }
15
+ });
16
+ });
17
+ var _entity = require("./entity");
18
+ Object.keys(_entity).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _entity[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _entity[key];
25
+ }
26
+ });
27
+ });
28
+ var _http = require("./http");
29
+ Object.keys(_http).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _http[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _http[key];
36
+ }
37
+ });
38
+ });
39
+ var _messaging = require("./messaging");
40
+ Object.keys(_messaging).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _messaging[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _messaging[key];
47
+ }
48
+ });
49
+ });
50
+ var _session = require("./session");
51
+ Object.keys(_session).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _session[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _session[key];
58
+ }
59
+ });
60
+ });
61
+ var _settings = require("./settings");
62
+ Object.keys(_settings).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _settings[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _settings[key];
69
+ }
70
+ });
71
+ });
72
+ var _singleton = require("./singleton");
73
+ Object.keys(_singleton).forEach(function (key) {
74
+ if (key === "default" || key === "__esModule") return;
75
+ if (key in exports && exports[key] === _singleton[key]) return;
76
+ Object.defineProperty(exports, key, {
77
+ enumerable: true,
78
+ get: function () {
79
+ return _singleton[key];
80
+ }
81
+ });
82
+ });
83
+ var _socket = require("./socket");
84
+ Object.keys(_socket).forEach(function (key) {
85
+ if (key === "default" || key === "__esModule") return;
86
+ if (key in exports && exports[key] === _socket[key]) return;
87
+ Object.defineProperty(exports, key, {
88
+ enumerable: true,
89
+ get: function () {
90
+ return _socket[key];
91
+ }
92
+ });
93
+ });
94
+ var _communication = require("./communication");
95
+ Object.keys(_communication).forEach(function (key) {
96
+ if (key === "default" || key === "__esModule") return;
97
+ if (key in exports && exports[key] === _communication[key]) return;
98
+ Object.defineProperty(exports, key, {
99
+ enumerable: true,
100
+ get: function () {
101
+ return _communication[key];
102
+ }
103
+ });
104
+ });