exodus-framework 2.0.994 → 2.0.996

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.
@@ -0,0 +1,8 @@
1
+ import { QueryInterface } from 'sequelize';
2
+ export type UmzugMigration = {
3
+ path: string;
4
+ name: string;
5
+ context: QueryInterface;
6
+ queryGenerator: unknown;
7
+ };
8
+ //# sourceMappingURL=database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/contracts/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,cAAc,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -7,4 +7,5 @@ export * from './settings';
7
7
  export * from './singleton';
8
8
  export * from './socket';
9
9
  export * from './communication';
10
+ export * from './database';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC"}
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,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
@@ -101,4 +101,15 @@ Object.keys(_communication).forEach(function (key) {
101
101
  return _communication[key];
102
102
  }
103
103
  });
104
+ });
105
+ var _database = require("./database");
106
+ Object.keys(_database).forEach(function (key) {
107
+ if (key === "default" || key === "__esModule") return;
108
+ if (key in exports && exports[key] === _database[key]) return;
109
+ Object.defineProperty(exports, key, {
110
+ enumerable: true,
111
+ get: function () {
112
+ return _database[key];
113
+ }
114
+ });
104
115
  });
@@ -0,0 +1,4 @@
1
+ import { UmzugMigration } from '../../contracts';
2
+ export declare function up({ context }: UmzugMigration): Promise<void>;
3
+ export declare function down({ context }: UmzugMigration): Promise<void>;
4
+ //# sourceMappingURL=00-logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"00-logs.d.ts","sourceRoot":"","sources":["../../../src/models/migrations/00-logs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKjD,wBAAsB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,cAAc,iBAsDnD;AAED,wBAAsB,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,cAAc,iBAErD"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.down = down;
7
+ exports.up = up;
8
+ var _sequelize = require("sequelize");
9
+ var _utils = require("../../utils");
10
+ const tablename = 'logs';
11
+ async function up({
12
+ context
13
+ }) {
14
+ await context.createTable(tablename, {
15
+ uuid: {
16
+ type: _sequelize.DataTypes.UUID,
17
+ defaultValue: _sequelize.DataTypes.UUIDV4,
18
+ primaryKey: true,
19
+ allowNull: false,
20
+ autoIncrement: false
21
+ },
22
+ happenedAt: {
23
+ type: _sequelize.DataTypes.DATE,
24
+ allowNull: false
25
+ },
26
+ category: {
27
+ type: _sequelize.DataTypes.STRING(100),
28
+ allowNull: false
29
+ },
30
+ origin: {
31
+ type: _sequelize.DataTypes.STRING(100),
32
+ allowNull: false
33
+ },
34
+ action: {
35
+ type: _sequelize.DataTypes.STRING(100),
36
+ allowNull: false
37
+ },
38
+ comments: {
39
+ type: _sequelize.DataTypes.STRING(255),
40
+ allowNull: true
41
+ },
42
+ data: {
43
+ type: _sequelize.DataTypes.JSON,
44
+ defaultValue: {},
45
+ allowNull: true
46
+ },
47
+ params: {
48
+ type: _sequelize.DataTypes.JSON,
49
+ defaultValue: {},
50
+ allowNull: true
51
+ }
52
+ });
53
+ const indexes = [{
54
+ fields: ['category']
55
+ }, {
56
+ fields: ['origin']
57
+ }, {
58
+ fields: ['action']
59
+ }];
60
+ await (0, _utils.InsertIndexes)(context, tablename, indexes);
61
+ }
62
+ async function down({
63
+ context
64
+ }) {
65
+ await context.dropTable(tablename);
66
+ }
@@ -0,0 +1,4 @@
1
+ import { UmzugMigration } from '../../contracts';
2
+ export declare function up({ context }: UmzugMigration): Promise<void>;
3
+ export declare function down({ context }: UmzugMigration): Promise<void>;
4
+ //# sourceMappingURL=00-reports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"00-reports.d.ts","sourceRoot":"","sources":["../../../src/models/migrations/00-reports.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKjD,wBAAsB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,cAAc,iBAsDnD;AAED,wBAAsB,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,cAAc,iBAErD"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.down = down;
7
+ exports.up = up;
8
+ var _sequelize = require("sequelize");
9
+ var _utils = require("../../utils");
10
+ const tablename = 'reports';
11
+ async function up({
12
+ context
13
+ }) {
14
+ await context.createTable(tablename, {
15
+ uuid: {
16
+ type: _sequelize.DataTypes.UUID,
17
+ defaultValue: _sequelize.DataTypes.UUIDV4,
18
+ primaryKey: true,
19
+ allowNull: false,
20
+ autoIncrement: false
21
+ },
22
+ category: {
23
+ type: _sequelize.DataTypes.STRING(100),
24
+ allowNull: false
25
+ },
26
+ origin: {
27
+ type: _sequelize.DataTypes.STRING(100),
28
+ allowNull: false
29
+ },
30
+ description: {
31
+ type: _sequelize.DataTypes.STRING(255),
32
+ allowNull: true
33
+ },
34
+ file: {
35
+ type: _sequelize.DataTypes.STRING(255),
36
+ allowNull: true
37
+ },
38
+ total: {
39
+ type: _sequelize.DataTypes.INTEGER(),
40
+ allowNull: true
41
+ },
42
+ params: {
43
+ type: _sequelize.DataTypes.JSON,
44
+ defaultValue: {},
45
+ allowNull: true
46
+ },
47
+ status: {
48
+ type: _sequelize.DataTypes.ENUM('PENDING', 'COMPLETED'),
49
+ allowNull: false,
50
+ defaultValue: 'PENDING'
51
+ }
52
+ });
53
+ const indexes = [{
54
+ fields: ['category']
55
+ }, {
56
+ fields: ['description']
57
+ }, {
58
+ fields: ['file']
59
+ }];
60
+ await (0, _utils.InsertIndexes)(context, tablename, indexes);
61
+ }
62
+ async function down({
63
+ context
64
+ }) {
65
+ await context.dropTable(tablename);
66
+ }
@@ -0,0 +1,4 @@
1
+ import { UmzugMigration } from '../../contracts';
2
+ export declare function up({ context }: UmzugMigration): Promise<void>;
3
+ export declare function down({ context }: UmzugMigration): Promise<void>;
4
+ //# sourceMappingURL=00-system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"00-system.d.ts","sourceRoot":"","sources":["../../../src/models/migrations/00-system.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAKjD,wBAAsB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,cAAc,iBAyCnD;AAED,wBAAsB,IAAI,CAAC,EAAE,OAAO,EAAE,EAAE,cAAc,iBAErD"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.down = down;
7
+ exports.up = up;
8
+ var _sequelize = require("sequelize");
9
+ var _utils = require("../../utils");
10
+ const tablename = 'system';
11
+ async function up({
12
+ context
13
+ }) {
14
+ await context.createTable(tablename, {
15
+ uuid: {
16
+ type: _sequelize.DataTypes.UUID,
17
+ defaultValue: _sequelize.DataTypes.UUIDV4,
18
+ primaryKey: true,
19
+ allowNull: false,
20
+ autoIncrement: false
21
+ },
22
+ key: {
23
+ type: _sequelize.DataTypes.STRING(100),
24
+ allowNull: false
25
+ },
26
+ value: {
27
+ type: _sequelize.DataTypes.STRING(255),
28
+ allowNull: false
29
+ },
30
+ comments: {
31
+ type: _sequelize.DataTypes.STRING(255),
32
+ allowNull: true
33
+ },
34
+ data: {
35
+ type: _sequelize.DataTypes.JSON,
36
+ defaultValue: {},
37
+ allowNull: true
38
+ }
39
+ });
40
+ const indexes = [{
41
+ fields: ['key']
42
+ }, {
43
+ fields: ['value']
44
+ }, {
45
+ fields: ['comments']
46
+ }];
47
+ await (0, _utils.InsertIndexes)(context, tablename, indexes);
48
+ }
49
+ async function down({
50
+ context
51
+ }) {
52
+ await context.dropTable(tablename);
53
+ }
@@ -27,7 +27,8 @@ declare class DatabaseService extends Service {
27
27
  createDB(hostId: string, name: string): Promise<boolean>;
28
28
  deleteDB(hostId: string, name: string): Promise<boolean>;
29
29
  hasDB(hostId: string, name: string): Promise<boolean>;
30
- migrate(connection: Sequelize): Promise<void>;
30
+ migrateServiceEntities(connection: Sequelize): Promise<void>;
31
+ migrateCoreEntities(connection: Sequelize): Promise<void>;
31
32
  }
32
33
  export default DatabaseService;
33
34
  //# sourceMappingURL=database.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/services/database.ts"],"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AO,CAAC,qBAAqB;IAIhB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IA2BrC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAmBrC,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAkBlC,sBAAsB,CAAC,UAAU,EAAE,SAAS;IAa5C,mBAAmB,CAAC,UAAU,EAAE,SAAS;CAavD;AAED,eAAe,eAAe,CAAC"}
@@ -10,6 +10,7 @@ var _models = require("../models");
10
10
  var _utils = require("../utils");
11
11
  var _security = _interopRequireDefault(require("./security"));
12
12
  var _umzug = require("umzug");
13
+ var _path = _interopRequireDefault(require("path"));
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
15
  class DatabaseService extends _app.Service {
15
16
  entities;
@@ -63,7 +64,8 @@ class DatabaseService extends _app.Service {
63
64
  }
64
65
  const password = data.payload;
65
66
  const connection = await this.createConnection(address, port, database, dbHost.username, password, dbHost.dialect);
66
- await this.migrate(connection);
67
+ await this.migrateCoreEntities(connection);
68
+ await this.migrateServiceEntities(connection);
67
69
  this.connections.set(tenantId, connection);
68
70
  this.log(`Conexão para o tenant ${tenantId} foi criada com sucesso`, 'success');
69
71
  }
@@ -228,7 +230,7 @@ class DatabaseService extends _app.Service {
228
230
  return false;
229
231
  }
230
232
  }
231
- async migrate(connection) {
233
+ async migrateServiceEntities(connection) {
232
234
  const umzung = new _umzug.Umzug({
233
235
  migrations: {
234
236
  glob: `${_app.Core.settings.getDatabase().migrationsPath}/*.js`
@@ -241,5 +243,19 @@ class DatabaseService extends _app.Service {
241
243
  });
242
244
  await umzung.up();
243
245
  }
246
+ async migrateCoreEntities(connection) {
247
+ const migrations = _path.default.resolve(__dirname, '../models/migrations');
248
+ const umzung = new _umzug.Umzug({
249
+ migrations: {
250
+ glob: `${migrations}/*.js`
251
+ },
252
+ context: connection.getQueryInterface(),
253
+ storage: new _umzug.SequelizeStorage({
254
+ sequelize: connection
255
+ }),
256
+ logger: console
257
+ });
258
+ await umzung.up();
259
+ }
244
260
  }
245
261
  var _default = exports.default = DatabaseService;
@@ -1,5 +1,9 @@
1
1
  import { Sequelize, WhereOptions } from 'sequelize';
2
- import { IRequestFilterCondition, LogicalCondition } from '../contracts';
2
+ import { IRequestFilterCondition, LogicalCondition, UmzugMigration } from '../contracts';
3
3
  export declare const mainDb: Sequelize;
4
4
  export declare function processFilters<D>(filters?: Partial<Record<keyof D, IRequestFilterCondition<D>> | LogicalCondition<D>>): WhereOptions<D>;
5
+ export declare function InsertIndexes(context: UmzugMigration['context'], tableName: string, indexes: {
6
+ fields: string[];
7
+ unique?: boolean;
8
+ }[]): Promise<void>;
5
9
  //# sourceMappingURL=database.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/utils/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEzE,eAAO,MAAM,MAAM,WASjB,CAAC;AA8FH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,GACnF,YAAY,CAAC,CAAC,CAAC,CAwCjB"}
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/utils/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGzF,eAAO,MAAM,MAAM,WASjB,CAAC;AAgFH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,GACnF,YAAY,CAAC,CAAC,CAAC,CAwCjB;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,EAClC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,iBAalD"}
@@ -3,10 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.InsertIndexes = InsertIndexes;
6
7
  exports.mainDb = void 0;
7
8
  exports.processFilters = processFilters;
8
9
  var _sequelize = require("sequelize");
9
10
  var _core = _interopRequireDefault(require("../app/core"));
11
+ var _error = require("../app/error");
10
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
13
  const mainDb = exports.mainDb = new _sequelize.Sequelize({
12
14
  database: _core.default.settings.getDatabase().main.database,
@@ -20,21 +22,6 @@ const mainDb = exports.mainDb = new _sequelize.Sequelize({
20
22
  timezone: '-03:00',
21
23
  logging: _core.default.settings.getDatabase().service.log
22
24
  });
23
-
24
- //!nunca foi usado
25
- /* export const masterDB = new Sequelize({
26
- database: Core.settings.getDatabase().master.database,
27
- dialect: Core.settings.getDatabase().master.dialect,
28
- username: Core.settings.getDatabase().master.username,
29
- password: Core.settings.getDatabase().master.password,
30
- pool: Core.settings.getDatabase().master.pool,
31
- define: {
32
- timestamps: true
33
- },
34
- timezone: '-03:00',
35
- logging: Core.settings.getDatabase().service.log
36
- }); */
37
-
38
25
  function processCondition(cond) {
39
26
  if ('or' in cond) {
40
27
  return {
@@ -154,4 +141,17 @@ function processFilters(filters) {
154
141
  }
155
142
  });
156
143
  return where;
144
+ }
145
+ async function InsertIndexes(context, tableName, indexes) {
146
+ for (const index of indexes) {
147
+ try {
148
+ await context.addIndex(tableName, index.fields, {
149
+ name: `${tableName}_${index.fields.join('_')}`,
150
+ unique: index.unique
151
+ });
152
+ } catch (error) {
153
+ new _error.ErrorHandler('tentativa de adicionar index falhou', error);
154
+ console.log('tentativa de adicionar index falhou');
155
+ }
156
+ }
157
157
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exodus-framework",
3
- "version": "2.0.994",
3
+ "version": "2.0.996",
4
4
  "description": "Exodus Framework",
5
5
  "author": "jhownpaixao",
6
6
  "license": "ISC",