UNPKG

@lakutata/core

Version:

Lakutata Framework Core

89 lines 2.65 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Application = void 0; const Module_1 = require("./base/abstracts/Module"); const Security_1 = require("./plugins/Security"); const Crypto_1 = require("./plugins/Crypto"); const HttpRequest_1 = require("./plugins/HttpRequest"); const Formatter_1 = require("./plugins/Formatter"); const MessagePack_1 = require("./plugins/MessagePack"); const JSON_1 = require("./plugins/JSON"); const Logger_1 = require("./plugins/Logger"); const moment_timezone_1 = __importDefault(require("moment-timezone")); const Shell_1 = require("./plugins/Shell"); class Application extends Module_1.Module { constructor() { super(...arguments); this.plugins = [ { class: Security_1.Security, saltRound: 8 }, { class: Crypto_1.Crypto, bits: 512 }, { class: HttpRequest_1.HttpRequest }, { class: MessagePack_1.MessagePack }, { class: JSON_1.JSON }, { class: Shell_1.Shell }, { class: Formatter_1.Formatter, dateFormat: 'YYYY-MM-DD HH:mm:ss' }, { class: Logger_1.Logger, scope: 'Singleton', level: 'debug', meta: { appId: process.env.appId, appName: process.env.appName }, transports: [] } ]; this.components = {}; this.modules = {}; this.processes = []; this.threads = []; this.workflows = []; this.tz = (() => { if (!process.env.TZ) { process.env.TZ = moment_timezone_1.default.tz.guess(); } return process.env.TZ; })(); } async initialize() { this.setProperty('id', process.env.appId); process.nextTick(async () => { await this.container.initialize(); }); } getTimezone() { return this.tz; } setTimezone(tz) { process.env.TZ = tz; this.tz = tz; } getID() { return process.env.appId; } getName() { return process.env.appName; } } exports.Application = Application; //# sourceMappingURL=Application.js.map