exodus-framework 2.0.763 → 2.0.766
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/controllers/messaging/database.d.ts +1 -1
- package/lib/controllers/messaging/database.d.ts.map +1 -1
- package/lib/controllers/messaging/database.js +3 -2
- package/lib/models/System.d.ts +10 -0
- package/lib/models/System.d.ts.map +1 -0
- package/lib/models/System.js +51 -0
- package/lib/models/index.d.ts.map +1 -1
- package/lib/models/index.js +2 -1
- package/lib/services/ecosystem.d.ts +11 -0
- package/lib/services/ecosystem.d.ts.map +1 -0
- package/lib/services/ecosystem.js +47 -0
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +9 -1
- package/lib/services/log.d.ts +3 -1
- package/lib/services/log.d.ts.map +1 -1
- package/lib/services/log.js +1 -0
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { MessagingController } from '../../app';
|
1
|
+
import { MessagingController } from '../../app/controller';
|
2
2
|
import { EMessagingQueue, TMessagingQueueHandler } from '../../contracts';
|
3
3
|
declare class DatabaseController extends MessagingController {
|
4
4
|
created: TMessagingQueueHandler<EMessagingQueue.databaseCreated>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/controllers/messaging/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/controllers/messaging/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAK1E,cAAM,kBAAmB,SAAQ,mBAAmB;IAClD,OAAO,EAAE,sBAAsB,CAAC,eAAe,CAAC,eAAe,CAAC,CAQ9D;IAEF,MAAM,EAAE,sBAAsB,CAAC,eAAe,CAAC,cAAc,CAAC,CAW5D;IAEF,MAAM,EAAE,sBAAsB,CAAC,eAAe,CAAC,eAAe,CAAC,CAW7D;IAEF,IAAI,EAAE,sBAAsB,CAAC,eAAe,CAAC,YAAY,CAAC,CAoBxD;CACH;AAED,eAAe,kBAAkB,CAAC"}
|
@@ -4,10 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
|
-
var
|
7
|
+
var _controller = require("../../app/controller");
|
8
8
|
var _models = require("../../models");
|
9
|
+
var _app = require("../../app");
|
9
10
|
var _utils = require("../../utils");
|
10
|
-
class DatabaseController extends
|
11
|
+
class DatabaseController extends _controller.MessagingController {
|
11
12
|
created = async (data, ack) => {
|
12
13
|
try {
|
13
14
|
await _models.DatabaseHost.create(data);
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { CreationOptional, InferAttributes, InferCreationAttributes, Model, Sequelize } from 'sequelize';
|
2
|
+
export declare class System extends Model<InferAttributes<System>, InferCreationAttributes<System>> {
|
3
|
+
uuid: CreationOptional<string>;
|
4
|
+
key: string;
|
5
|
+
value: string;
|
6
|
+
comments: string;
|
7
|
+
data: CreationOptional<Record<string, any>>;
|
8
|
+
static initialize(connection: Sequelize): import("sequelize").ModelCtor<System>;
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=System.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"System.d.ts","sourceRoot":"","sources":["../../src/models/System.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEhB,eAAe,EACf,uBAAuB,EAEvB,KAAK,EAGL,SAAS,EACV,MAAM,WAAW,CAAC;AAInB,qBAAa,MAAO,SAAQ,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACjF,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAEpD,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,SAAS;CAGxC"}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.System = void 0;
|
7
|
+
var _sequelize = require("sequelize");
|
8
|
+
var _database = require("../utils/database");
|
9
|
+
class System extends _sequelize.Model {
|
10
|
+
static initialize(connection) {
|
11
|
+
return connection.define('system', SystemParams, SystemConnParams);
|
12
|
+
}
|
13
|
+
}
|
14
|
+
exports.System = System;
|
15
|
+
const SystemParams = {
|
16
|
+
uuid: {
|
17
|
+
type: _sequelize.DataTypes.UUID,
|
18
|
+
defaultValue: _sequelize.DataTypes.UUIDV4,
|
19
|
+
primaryKey: true,
|
20
|
+
allowNull: false,
|
21
|
+
autoIncrement: false
|
22
|
+
},
|
23
|
+
key: {
|
24
|
+
type: _sequelize.DataTypes.STRING(100),
|
25
|
+
allowNull: false
|
26
|
+
},
|
27
|
+
value: {
|
28
|
+
type: _sequelize.DataTypes.STRING(255),
|
29
|
+
allowNull: false
|
30
|
+
},
|
31
|
+
comments: {
|
32
|
+
type: _sequelize.DataTypes.STRING(255),
|
33
|
+
allowNull: true
|
34
|
+
},
|
35
|
+
data: {
|
36
|
+
type: _sequelize.DataTypes.JSON,
|
37
|
+
defaultValue: {},
|
38
|
+
allowNull: true
|
39
|
+
}
|
40
|
+
};
|
41
|
+
const SystemConnParams = {
|
42
|
+
tableName: 'system',
|
43
|
+
sequelize: _database.serviceDB,
|
44
|
+
indexes: [{
|
45
|
+
fields: ['key']
|
46
|
+
}, {
|
47
|
+
fields: ['value']
|
48
|
+
}, {
|
49
|
+
fields: ['comments']
|
50
|
+
}]
|
51
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAOxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAE9B,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,GAAG,CAAC,EAAwD,CAAC"}
|
package/lib/models/index.js
CHANGED
@@ -44,4 +44,5 @@ Object.keys(_Application).forEach(function (key) {
|
|
44
44
|
});
|
45
45
|
});
|
46
46
|
var _Log = require("./Log");
|
47
|
-
|
47
|
+
var _System = require("./System");
|
48
|
+
const NativeModels = exports.NativeModels = [_DatabaseHost.DatabaseHost, _EnvConnection.EnvDBHost, _Application.Application, _Log.Log, _System.System];
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { Service } from '../app';
|
2
|
+
import { IService } from '../contracts';
|
3
|
+
import { System } from '../models/System';
|
4
|
+
declare class EcosystemService extends Service implements IService {
|
5
|
+
init(): Promise<void>;
|
6
|
+
static getSystemVariable(tenantId: string, key: string): Promise<System>;
|
7
|
+
static setSystemVariable(tenantId: string, key: string, value: string): Promise<void>;
|
8
|
+
static createSystemVariable(tenantId: string, key: string, value: string): Promise<System>;
|
9
|
+
}
|
10
|
+
export default EcosystemService;
|
11
|
+
//# sourceMappingURL=ecosystem.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ecosystem.d.ts","sourceRoot":"","sources":["../../src/services/ecosystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,cAAM,gBAAiB,SAAQ,OAAQ,YAAW,QAAQ;IAClD,IAAI;WAEG,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM;WAI/C,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;WAS9D,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAO/E;AAED,eAAe,gBAAgB,CAAC"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
var _app = require("../app");
|
8
|
+
var _System = require("../models/System");
|
9
|
+
var _sequelize = _interopRequireDefault(require("./sequelize"));
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
11
|
+
class EcosystemService extends _app.Service {
|
12
|
+
async init() {}
|
13
|
+
static async getSystemVariable(tenantId, key) {
|
14
|
+
const Entity = await _sequelize.default.singleton().getModel(_System.System, tenantId);
|
15
|
+
return Entity.findOne({
|
16
|
+
where: {
|
17
|
+
key
|
18
|
+
}
|
19
|
+
});
|
20
|
+
}
|
21
|
+
static async setSystemVariable(tenantId, key, value) {
|
22
|
+
const Entity = await _sequelize.default.singleton().getModel(_System.System, tenantId);
|
23
|
+
const variable = await Entity.findOne({
|
24
|
+
where: {
|
25
|
+
key
|
26
|
+
}
|
27
|
+
});
|
28
|
+
if (!variable) throw new Error('System variable not found: ' + key);
|
29
|
+
variable.value = value;
|
30
|
+
variable.changed('value', true);
|
31
|
+
await variable.save();
|
32
|
+
}
|
33
|
+
static async createSystemVariable(tenantId, key, value) {
|
34
|
+
const Entity = await _sequelize.default.singleton().getModel(_System.System, tenantId);
|
35
|
+
const variable = await Entity.findOne({
|
36
|
+
where: {
|
37
|
+
key
|
38
|
+
}
|
39
|
+
});
|
40
|
+
if (variable) throw new Error('System variable has exists: ' + key);
|
41
|
+
return await Entity.create({
|
42
|
+
key,
|
43
|
+
value
|
44
|
+
});
|
45
|
+
}
|
46
|
+
}
|
47
|
+
var _default = exports.default = EcosystemService;
|
package/lib/services/index.d.ts
CHANGED
@@ -6,5 +6,6 @@ export { default as SequelizeService } from './sequelize';
|
|
6
6
|
export { default as SocketIOService } from './socket';
|
7
7
|
export { default as SecurityService } from './security';
|
8
8
|
export { default as LogService } from './log';
|
9
|
+
export { default as EcosystemService } from './ecosystem';
|
9
10
|
export * from './task';
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,OAAO,CAAC;AAC9C,cAAc,QAAQ,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,cAAc,QAAQ,CAAC"}
|
package/lib/services/index.js
CHANGED
@@ -11,8 +11,15 @@ var _exportNames = {
|
|
11
11
|
SequelizeService: true,
|
12
12
|
SocketIOService: true,
|
13
13
|
SecurityService: true,
|
14
|
-
LogService: true
|
14
|
+
LogService: true,
|
15
|
+
EcosystemService: true
|
15
16
|
};
|
17
|
+
Object.defineProperty(exports, "EcosystemService", {
|
18
|
+
enumerable: true,
|
19
|
+
get: function () {
|
20
|
+
return _ecosystem.default;
|
21
|
+
}
|
22
|
+
});
|
16
23
|
Object.defineProperty(exports, "ExpressService", {
|
17
24
|
enumerable: true,
|
18
25
|
get: function () {
|
@@ -69,6 +76,7 @@ var _sequelize = _interopRequireDefault(require("./sequelize"));
|
|
69
76
|
var _socket = _interopRequireDefault(require("./socket"));
|
70
77
|
var _security = _interopRequireDefault(require("./security"));
|
71
78
|
var _log = _interopRequireDefault(require("./log"));
|
79
|
+
var _ecosystem = _interopRequireDefault(require("./ecosystem"));
|
72
80
|
var _task = require("./task");
|
73
81
|
Object.keys(_task).forEach(function (key) {
|
74
82
|
if (key === "default" || key === "__esModule") return;
|
package/lib/services/log.d.ts
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import { Service } from '../app';
|
2
|
-
|
2
|
+
import { IService } from '../contracts';
|
3
|
+
declare class LogService extends Service implements IService {
|
4
|
+
init(): Promise<void>;
|
3
5
|
register(tenantId: string, data: {
|
4
6
|
origin: string;
|
5
7
|
action: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/services/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,OAAO,EAAE,MAAM,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/services/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,OAAO,EAAE,MAAM,QAAQ,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,cAAM,UAAW,SAAQ,OAAQ,YAAW,QAAQ;IAC5C,IAAI;IACJ,QAAQ,CACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC5B;CAeJ;AAED,eAAe,UAAU,CAAC"}
|
package/lib/services/log.js
CHANGED
@@ -10,6 +10,7 @@ var _Log = require("../models/Log");
|
|
10
10
|
var _sequelize = _interopRequireDefault(require("./sequelize"));
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
12
12
|
class LogService extends _app.Service {
|
13
|
+
async init() {}
|
13
14
|
async register(tenantId, data) {
|
14
15
|
try {
|
15
16
|
const Entity = await _sequelize.default.singleton().getModel(_Log.Log, tenantId);
|