exodus-framework 2.0.58 → 2.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/app.d.ts +1 -1
- package/lib/app/app.d.ts.map +1 -1
- package/lib/app/app.js +2 -2
- package/lib/contracts/messaging.d.ts +6 -0
- package/lib/contracts/messaging.d.ts.map +1 -1
- package/lib/contracts/messaging.js +1 -0
- package/lib/services/file.d.ts +1 -0
- package/lib/services/file.d.ts.map +1 -1
- package/lib/services/file.js +11 -0
- package/lib/utils/session.d.ts +2 -1
- package/lib/utils/session.d.ts.map +1 -1
- package/lib/utils/session.js +3 -1
- package/package.json +1 -1
package/lib/app/app.d.ts
CHANGED
@@ -9,7 +9,7 @@ declare class Exodus extends Core {
|
|
9
9
|
createClusters(): Promise<void>;
|
10
10
|
registerSingletonService(service: IService): void;
|
11
11
|
initServices(): Promise<void>;
|
12
|
-
getVersion(): string | undefined;
|
12
|
+
static getVersion(): string | undefined;
|
13
13
|
}
|
14
14
|
export default Exodus;
|
15
15
|
//# sourceMappingURL=app.d.ts.map
|
package/lib/app/app.d.ts.map
CHANGED
@@ -1 +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;
|
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,MAAM,CAAC,UAAU,IAAI,MAAM,GAAG,SAAS;CAUxC;AACD,eAAe,MAAM,CAAC"}
|
package/lib/app/app.js
CHANGED
@@ -37,7 +37,7 @@ class Exodus extends _core.default {
|
|
37
37
|
//* Cluster Managment
|
38
38
|
async initMaster() {
|
39
39
|
this.log(`✨ Starting ${_core.default.settings.getAppication().description} · Clusters: ${_core.default.settings.getAppication().clusters}`);
|
40
|
-
this.log(`✨ Core version ${
|
40
|
+
this.log(`✨ Core version ${Exodus.getVersion()}`);
|
41
41
|
this.createClusters();
|
42
42
|
}
|
43
43
|
async initCluster() {
|
@@ -70,7 +70,7 @@ class Exodus extends _core.default {
|
|
70
70
|
}
|
71
71
|
|
72
72
|
// *System
|
73
|
-
getVersion() {
|
73
|
+
static getVersion() {
|
74
74
|
try {
|
75
75
|
const packageJson = fs.readFileSync(_path.default.resolve(__dirname, '../../package.json'), 'utf8');
|
76
76
|
const packageData = JSON.parse(packageJson);
|
@@ -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>>;
|
@@ -1 +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,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;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"}
|
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
|
package/lib/services/file.d.ts
CHANGED
@@ -6,6 +6,7 @@ declare class FileService extends Service implements IService {
|
|
6
6
|
private checkPaths;
|
7
7
|
private cleanTemp;
|
8
8
|
save(filename: string, destiny: keyof TFilePathSettings): Promise<string | boolean>;
|
9
|
+
delete(filename: string, destiny: keyof TFilePathSettings): Promise<boolean>;
|
9
10
|
listFiles(origin: keyof TFilePathSettings, cb: (file: string[]) => void): void;
|
10
11
|
}
|
11
12
|
export default FileService;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/services/file.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAIrC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,cAAM,WAAY,SAAQ,OAAQ,YAAW,QAAQ;IAC7C,IAAI;YAKI,UAAU;YAKV,SAAS;IASjB,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB;
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/services/file.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAIrC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,cAAM,WAAY,SAAQ,OAAQ,YAAW,QAAQ;IAC7C,IAAI;YAKI,UAAU;YAKV,SAAS;IASjB,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB;IAavD,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB;IAW/D,SAAS,CAAC,MAAM,EAAE,MAAM,iBAAiB,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI;CAIxE;AACD,eAAe,WAAW,CAAC"}
|
package/lib/services/file.js
CHANGED
@@ -46,6 +46,17 @@ class FileService extends _service.default {
|
|
46
46
|
return false;
|
47
47
|
});
|
48
48
|
}
|
49
|
+
async delete(filename, destiny) {
|
50
|
+
const d = _app.Core.settings.getAppication().filePaths[destiny] + '/' + filename;
|
51
|
+
return await fsPromisses.unlink(d).then(() => true).catch(e => {
|
52
|
+
(0, _logger.default)().error({
|
53
|
+
filename,
|
54
|
+
destiny,
|
55
|
+
erro: e
|
56
|
+
}, 'Não foi possível deletar o arquivo');
|
57
|
+
return false;
|
58
|
+
});
|
59
|
+
}
|
49
60
|
listFiles(origin, cb) {
|
50
61
|
const p = _app.Core.settings.getAppication().filePaths[origin];
|
51
62
|
fs.readdir(p, (_, file) => cb(file));
|
package/lib/utils/session.d.ts
CHANGED
@@ -2,7 +2,8 @@ import Api from './api';
|
|
2
2
|
export declare class SessionAPI extends Api {
|
3
3
|
host: string;
|
4
4
|
headers: {
|
5
|
-
'
|
5
|
+
'X-Exodus-App-Sec': string;
|
6
|
+
'X-Exodus-Core-Version': string;
|
6
7
|
};
|
7
8
|
validateStatus(status: number): boolean;
|
8
9
|
getCertificate(): Promise<import("..").IApiResponse<string>>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/utils/session.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/utils/session.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,qBAAa,UAAW,SAAQ,GAAG;IACjC,IAAI,SAA+B;IACnC,OAAO;;;MAGL;IAEF,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIjC,cAAc;CAGrB"}
|
package/lib/utils/session.js
CHANGED
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.SessionAPI = void 0;
|
7
|
+
var _app = require("../app");
|
7
8
|
var _api = _interopRequireDefault(require("./api"));
|
8
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
9
10
|
class SessionAPI extends _api.default {
|
10
11
|
host = process.env.APP_SESSION_URL;
|
11
12
|
headers = {
|
12
|
-
'
|
13
|
+
'X-Exodus-App-Sec': this.getLogicalSecurityId(),
|
14
|
+
'X-Exodus-Core-Version': _app.Exodus.getVersion()
|
13
15
|
};
|
14
16
|
validateStatus(status) {
|
15
17
|
return status < 400;
|