diff --git a/dist/fort.js b/dist/fort.js
index e876cd20..147097e0 100644
--- a/dist/fort.js
+++ b/dist/fort.js
@@ -1,5 +1,5 @@
/*!
- * @license :fortjs - V1.8.2 - 30/10/2019
+ * @license :fortjs - V1.8.3 - 30/10/2019
* https://github.com/ujjwalguptaofficial/fortjs
* Copyright (c) 2019 @Ujjwal Gupta; Licensed MIT
*/
@@ -87,800 +87,1162 @@ module.exports =
/******/
/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts");
+/******/ return __webpack_require__(__webpack_require__.s = 14);
/******/ })
/************************************************************************/
-/******/ ({
-
-/***/ "./src/abstracts/controller.ts":
-/*!*************************************!*\
- !*** ./src/abstracts/controller.ts ***!
- \*************************************/
-/*! exports provided: Controller */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Controller", function() { return Controller; });
-/* harmony import */ var _test_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../test_helpers */ "./src/test_helpers/index.ts");
+/******/ ([
+/* 0 */
+/***/ (function(module, exports) {
-var Controller = /** @class */ (function () {
- function Controller() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- }
- Controller.prototype.initialize = function (data) {
- Object(_test_helpers__WEBPACK_IMPORTED_MODULE_0__["initController"])(this, data);
- };
- return Controller;
-}());
+module.exports = require("path");
+/***/ }),
+/* 1 */
+/***/ (function(module, exports) {
+module.exports = require("fs-extra");
/***/ }),
+/* 2 */
+/***/ (function(module, exports) {
-/***/ "./src/abstracts/guard.ts":
-/*!********************************!*\
- !*** ./src/abstracts/guard.ts ***!
- \********************************/
-/*! exports provided: Guard */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+module.exports = require("negotiator");
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Guard", function() { return Guard; });
-/* harmony import */ var _test_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../test_helpers */ "./src/test_helpers/index.ts");
+/***/ }),
+/* 3 */
+/***/ (function(module, exports) {
-var Guard = /** @class */ (function () {
- function Guard() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- }
- Guard.prototype.initialize = function (data) {
- return Object(_test_helpers__WEBPACK_IMPORTED_MODULE_0__["initGuard"])(this, data);
- };
- return Guard;
-}());
+module.exports = require("fs");
+/***/ }),
+/* 4 */
+/***/ (function(module, exports) {
+module.exports = require("jsontoxml");
/***/ }),
+/* 5 */
+/***/ (function(module, exports) {
-/***/ "./src/abstracts/index.ts":
-/*!********************************!*\
- !*** ./src/abstracts/index.ts ***!
- \********************************/
-/*! exports provided: Controller, Shield, SessionProvider, Guard, ViewEngine, Wall, XmlParser */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+module.exports = require("url");
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _controller__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./controller */ "./src/abstracts/controller.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Controller", function() { return _controller__WEBPACK_IMPORTED_MODULE_0__["Controller"]; });
+/***/ }),
+/* 6 */
+/***/ (function(module, exports) {
-/* harmony import */ var _shield__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shield */ "./src/abstracts/shield.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Shield", function() { return _shield__WEBPACK_IMPORTED_MODULE_1__["Shield"]; });
+module.exports = require("etag");
-/* harmony import */ var _session_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./session_provider */ "./src/abstracts/session_provider.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SessionProvider", function() { return _session_provider__WEBPACK_IMPORTED_MODULE_2__["SessionProvider"]; });
+/***/ }),
+/* 7 */
+/***/ (function(module, exports) {
-/* harmony import */ var _guard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./guard */ "./src/abstracts/guard.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Guard", function() { return _guard__WEBPACK_IMPORTED_MODULE_3__["Guard"]; });
+module.exports = require("fresh");
-/* harmony import */ var _view_engine__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./view_engine */ "./src/abstracts/view_engine.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewEngine", function() { return _view_engine__WEBPACK_IMPORTED_MODULE_4__["ViewEngine"]; });
+/***/ }),
+/* 8 */
+/***/ (function(module, exports) {
-/* harmony import */ var _wall__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./wall */ "./src/abstracts/wall.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Wall", function() { return _wall__WEBPACK_IMPORTED_MODULE_5__["Wall"]; });
+module.exports = require("content-type");
-/* harmony import */ var _xml_parser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./xml_parser */ "./src/abstracts/xml_parser.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XmlParser", function() { return _xml_parser__WEBPACK_IMPORTED_MODULE_6__["XmlParser"]; });
+/***/ }),
+/* 9 */
+/***/ (function(module, exports) {
+module.exports = require("querystring");
+/***/ }),
+/* 10 */
+/***/ (function(module, exports) {
+module.exports = require("multiparty");
+/***/ }),
+/* 11 */
+/***/ (function(module, exports) {
+module.exports = require("mustache");
+/***/ }),
+/* 12 */
+/***/ (function(module, exports) {
+module.exports = require("uniqid");
+/***/ }),
+/* 13 */
+/***/ (function(module, exports) {
+module.exports = require("http");
/***/ }),
-
-/***/ "./src/abstracts/session_provider.ts":
-/*!*******************************************!*\
- !*** ./src/abstracts/session_provider.ts ***!
- \*******************************************/
-/*! exports provided: SessionProvider */
+/* 14 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SessionProvider", function() { return SessionProvider; });
-/* harmony import */ var uniqid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uniqid */ "uniqid");
-/* harmony import */ var uniqid__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(uniqid__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../global */ "./src/global.ts");
-
-var SessionProvider = /** @class */ (function () {
- function SessionProvider() {
- }
- SessionProvider.prototype.createSession = function () {
- var now = new Date();
- this.sessionId = uniqid__WEBPACK_IMPORTED_MODULE_0__();
- this.cookie.addCookie({
- name: _global__WEBPACK_IMPORTED_MODULE_1__["Global"].appSessionIdentifier,
- value: this.sessionId,
- httpOnly: true,
- path: "/",
- expires: new Date(now.setMinutes(now.getMinutes() + _global__WEBPACK_IMPORTED_MODULE_1__["Global"].sessionTimeOut)),
- maxAge: _global__WEBPACK_IMPORTED_MODULE_1__["Global"].sessionTimeOut * 60
- });
- };
- SessionProvider.prototype.destroySession = function () {
- var cookie = this.cookie.getCookie(_global__WEBPACK_IMPORTED_MODULE_1__["Global"].appSessionIdentifier);
- cookie.httpOnly = true;
- cookie.path = "/";
- this.cookie.removeCookie(cookie);
- };
- return SessionProvider;
-}());
+// CONCATENATED MODULE: ./src/enums/mime_type.ts
+var MIME_TYPE;
+(function (MIME_TYPE) {
+ MIME_TYPE["Text"] = "text/plain";
+ MIME_TYPE["Json"] = "application/json";
+ MIME_TYPE["Html"] = "text/html";
+ MIME_TYPE["FormUrlEncoded"] = "application/x-www-form-urlencoded";
+ MIME_TYPE["Css"] = "text/css";
+ MIME_TYPE["Csv"] = "text/csv";
+ MIME_TYPE["Js"] = "application/javascript";
+ MIME_TYPE["Bmp"] = "image/bmp";
+ MIME_TYPE["Jpeg"] = "image/jpeg";
+ MIME_TYPE["Gif"] = "image/gif";
+ MIME_TYPE["Ico"] = "image/x-icon";
+ MIME_TYPE["Png"] = "image/png";
+ MIME_TYPE["Pdf"] = "application/pdf";
+ MIME_TYPE["Svg"] = "image/svg+xml";
+ MIME_TYPE["Rtf"] = "application/rtf";
+ MIME_TYPE["Xml"] = "application/xml";
+ MIME_TYPE["Xls"] = "application/vnd.ms-excel";
+ MIME_TYPE["Xlsx"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
+ MIME_TYPE["Ttf"] = "font/ttf";
+ MIME_TYPE["Woff"] = "font/woff";
+ MIME_TYPE["Woff2"] = "font/woff2";
+ MIME_TYPE["Eot"] = "application/vnd.ms-fontobject";
+ MIME_TYPE["Otf"] = "font/otf";
+ MIME_TYPE["Swf"] = "application/x-shockwave-flash";
+ MIME_TYPE["Avi"] = "video/avi";
+ MIME_TYPE["FormMultiPart"] = "multipart/form-data";
+})(MIME_TYPE || (MIME_TYPE = {}));
+// CONCATENATED MODULE: ./src/enums/http_method.ts
+var HTTP_METHOD;
+(function (HTTP_METHOD) {
+ HTTP_METHOD["Get"] = "GET";
+ HTTP_METHOD["Post"] = "POST";
+ HTTP_METHOD["Put"] = "PUT";
+ HTTP_METHOD["Patch"] = "PATCH";
+ HTTP_METHOD["Delete"] = "DELETE";
+ HTTP_METHOD["Options"] = "OPTIONS";
+ HTTP_METHOD["Head"] = "HEAD";
+})(HTTP_METHOD || (HTTP_METHOD = {}));
+// CONCATENATED MODULE: ./src/enums/http_status_code.ts
+var HTTP_STATUS_CODE;
+(function (HTTP_STATUS_CODE) {
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["BadRequest"] = 400] = "BadRequest";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["Unauthorized"] = 401] = "Unauthorized";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["Forbidden"] = 403] = "Forbidden";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["NotFound"] = 404] = "NotFound";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["Ok"] = 200] = "Ok";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["Created"] = 201] = "Created";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["NoContent"] = 204] = "NoContent";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["Redirect"] = 302] = "Redirect";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["NotModified"] = 304] = "NotModified";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["MethodNotAllowed"] = 405] = "MethodNotAllowed";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["NotAcceptable"] = 406] = "NotAcceptable";
+ HTTP_STATUS_CODE[HTTP_STATUS_CODE["InternalServerError"] = 500] = "InternalServerError";
+})(HTTP_STATUS_CODE || (HTTP_STATUS_CODE = {}));
-/***/ }),
+// CONCATENATED MODULE: ./src/enums/etag_type.ts
+var ETag_Type;
+(function (ETag_Type) {
+ ETag_Type["Strong"] = "strong";
+ ETag_Type["Weak"] = "weak";
+})(ETag_Type || (ETag_Type = {}));
-/***/ "./src/abstracts/shield.ts":
-/*!*********************************!*\
- !*** ./src/abstracts/shield.ts ***!
- \*********************************/
-/*! exports provided: Shield */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// CONCATENATED MODULE: ./src/enums/error_type.ts
+var ERROR_TYPE;
+(function (ERROR_TYPE) {
+ ERROR_TYPE["InvalidControllerName"] = "invalid_controller_name";
+ ERROR_TYPE["InvalidContentType"] = "invalid_content_type";
+ ERROR_TYPE["PortInUse"] = "port_in_use";
+ ERROR_TYPE["UndefinedViewEngine"] = "undefined_view_engine";
+})(ERROR_TYPE || (ERROR_TYPE = {}));
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Shield", function() { return Shield; });
-/* harmony import */ var _test_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../test_helpers */ "./src/test_helpers/index.ts");
+// CONCATENATED MODULE: ./src/enums/index.ts
-var Shield = /** @class */ (function () {
- function Shield() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- }
- Shield.prototype.initialize = function (data) {
- return Object(_test_helpers__WEBPACK_IMPORTED_MODULE_0__["initShield"])(this, data);
- };
- return Shield;
-}());
-/***/ }),
-/***/ "./src/abstracts/view_engine.ts":
-/*!**************************************!*\
- !*** ./src/abstracts/view_engine.ts ***!
- \**************************************/
-/*! exports provided: ViewEngine */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ViewEngine", function() { return ViewEngine; });
-var ViewEngine = /** @class */ (function () {
- function ViewEngine() {
- }
- return ViewEngine;
-}());
+// CONCATENATED MODULE: ./src/helpers/json_result.ts
+var jsonResult = function (value, statusCode) {
+ return {
+ contentType: MIME_TYPE.Json,
+ responseData: value,
+ statusCode: statusCode || HTTP_STATUS_CODE.Ok
+ };
+};
-/***/ }),
+// CONCATENATED MODULE: ./src/helpers/text_result.ts
-/***/ "./src/abstracts/wall.ts":
-/*!*******************************!*\
- !*** ./src/abstracts/wall.ts ***!
- \*******************************/
-/*! exports provided: Wall */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Wall", function() { return Wall; });
-/* harmony import */ var _test_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../test_helpers */ "./src/test_helpers/index.ts");
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
+var textResult = function (text, statusCode) {
+ return {
+ contentType: MIME_TYPE.Text,
+ responseData: text,
+ statusCode: statusCode || HTTP_STATUS_CODE.Ok
+ };
};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
+
+// CONCATENATED MODULE: ./src/helpers/html_result.ts
+
+
+var htmlResult = function (html, statusCode) {
+ return {
+ contentType: MIME_TYPE.Html,
+ responseData: html,
+ statusCode: statusCode || HTTP_STATUS_CODE.Ok
+ };
};
-var Wall = /** @class */ (function () {
- function Wall() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
+// CONCATENATED MODULE: ./src/global.ts
+var Global = /** @class */ (function () {
+ function Global() {
}
- Wall.prototype.onOutgoing = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return __awaiter(this, void 0, void 0, function () {
- return __generator(this, function (_a) {
- return [2 /*return*/, null];
- });
- });
- };
- Wall.prototype.initialize = function (data) {
- return Object(_test_helpers__WEBPACK_IMPORTED_MODULE_0__["initWall"])(this, data);
- };
- return Wall;
+ Global.walls = [];
+ return Global;
}());
+// CONCATENATED MODULE: ./src/helpers/is_env_dev.ts
+var isEnvDev = function () {
+ return process.env.NODE_ENV === 'development';
+};
-/***/ }),
+// CONCATENATED MODULE: ./src/helpers/log_helper.ts
-/***/ "./src/abstracts/xml_parser.ts":
-/*!*************************************!*\
- !*** ./src/abstracts/xml_parser.ts ***!
- \*************************************/
-/*! exports provided: XmlParser */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XmlParser", function() { return XmlParser; });
-var XmlParser = /** @class */ (function () {
- function XmlParser() {
+var log_helper_LogHelper = /** @class */ (function () {
+ function LogHelper(type, info) {
+ this.type = type;
+ this.info_ = info;
+ this.message = this.getMsg_();
}
- return XmlParser;
+ LogHelper.prototype.throw = function () {
+ var errMsg = this.get();
+ throw JSON.stringify(errMsg);
+ };
+ LogHelper.log = function (msg) {
+ console.log(msg);
+ };
+ LogHelper.prototype.logError = function () {
+ console.error(this.get());
+ };
+ LogHelper.prototype.logWarning = function () {
+ console.warn(this.get());
+ };
+ LogHelper.prototype.get = function () {
+ return {
+ message: this.message,
+ type: this.type
+ };
+ };
+ LogHelper.prototype.getMsg_ = function () {
+ var errMsg;
+ switch (this.type) {
+ case ERROR_TYPE.InvalidControllerName:
+ errMsg = "Invalid controller name - '" + this.info_ + "'. Controller name must contain 'controller'.";
+ break;
+ case ERROR_TYPE.InvalidContentType:
+ errMsg = "Content type - '" + this.info_ + "' is not valid. Please create an issue if you think this is valid type.";
+ break;
+ case ERROR_TYPE.PortInUse:
+ errMsg = "Port " + this.info_ + " is being used by another process.";
+ break;
+ case ERROR_TYPE.UndefinedViewEngine:
+ errMsg = "View engine is not initiated.Initiate the view engine where fort is created.";
+ break;
+ default:
+ errMsg = this.message;
+ break;
+ }
+ return errMsg;
+ };
+ return LogHelper;
}());
+// CONCATENATED MODULE: ./src/helpers/render_view.ts
-/***/ }),
-
-/***/ "./src/constant.ts":
-/*!*************************!*\
- !*** ./src/constant.ts ***!
- \*************************/
-/*! exports provided: __ContentType, __AppName, __Cookie, __SetCookie, __CurrentPath, __ContentLength, __Constructor */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__ContentType", function() { return __ContentType; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__AppName", function() { return __AppName; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__Cookie", function() { return __Cookie; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__SetCookie", function() { return __SetCookie; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__CurrentPath", function() { return __CurrentPath; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__ContentLength", function() { return __ContentLength; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__Constructor", function() { return __Constructor; });
-/* tslint:disable */
-var __ContentType = "Content-Type";
-var __AppName = "fort";
-var __Cookie = "Cookie";
-var __SetCookie = 'Set-Cookie';
-var __CurrentPath = process.cwd();
-var __ContentLength = "Content-Length";
-var __Constructor = "const_constructor";
-/***/ }),
+var renderView = function (viewName, model) {
+ if (isEnvDev()) {
+ if (Global.viewEngine == null) {
+ new log_helper_LogHelper(ERROR_TYPE.UndefinedViewEngine).throw();
+ }
+ }
+ return Global.viewEngine.render({
+ view: viewName,
+ model: model
+ });
+};
-/***/ "./src/decorators/assign.ts":
-/*!**********************************!*\
- !*** ./src/decorators/assign.ts ***!
- \**********************************/
-/*! exports provided: Assign */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// CONCATENATED MODULE: ./src/helpers/download_result.ts
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return Assign; });
-/* harmony import */ var _handlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../handlers */ "./src/handlers/index.ts");
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
+var downloadResult = function (filePath, downloadFileName) {
+ return {
+ statusCode: HTTP_STATUS_CODE.Ok,
+ file: {
+ filePath: filePath,
+ shouldDownload: true,
+ alias: downloadFileName
+ }
+ };
+};
+// CONCATENATED MODULE: ./src/helpers/file_result.ts
-// tslint:disable-next-line
-var Assign = function (value) {
- return function (target, methodName, paramIndex) {
- var className = target.name || target.constructor.name;
- if (methodName == null) {
- methodName = _constant__WEBPACK_IMPORTED_MODULE_1__["__Constructor"];
+var fileResult = function (filePath) {
+ return {
+ statusCode: HTTP_STATUS_CODE.Ok,
+ file: {
+ filePath: filePath
}
- _handlers__WEBPACK_IMPORTED_MODULE_0__["InjectorHandler"].addWorkerValue(className, methodName, paramIndex, value);
};
};
+// CONCATENATED MODULE: ./src/helpers/redirect_result.ts
-/***/ }),
-/***/ "./src/decorators/default_worker.ts":
-/*!******************************************!*\
- !*** ./src/decorators/default_worker.ts ***!
- \******************************************/
-/*! exports provided: DefaultWorker */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var redirectResult = function (url) {
+ return {
+ contentType: MIME_TYPE.Text,
+ responseData: url,
+ statusCode: HTTP_STATUS_CODE.Redirect,
+ shouldRedirect: true
+ };
+};
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultWorker", function() { return DefaultWorker; });
-/* harmony import */ var _handlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../handlers */ "./src/handlers/index.ts");
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
+// CONCATENATED MODULE: ./src/helpers/view_result.ts
+var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+var view_result_this = undefined;
-// tslint:disable-next-line
-var DefaultWorker = function (allowedMethods) {
- return function (target, methodName, descriptor) {
- var className = target.constructor.name;
- var actionInfo = {
- workerName: methodName,
- methodsAllowed: allowedMethods == null ? [_enums__WEBPACK_IMPORTED_MODULE_1__["HTTP_METHOD"].Get] : allowedMethods,
- guards: [],
- pattern: "/",
- values: []
- };
- _handlers__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"].addWorker(actionInfo, className);
- };
-};
+var viewResult = function (viewName, model) { return __awaiter(view_result_this, void 0, void 0, function () {
+ var viewData;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0: return [4 /*yield*/, renderView(viewName, model)];
+ case 1:
+ viewData = _a.sent();
+ return [2 /*return*/, {
+ contentType: MIME_TYPE.Html,
+ responseData: viewData,
+ statusCode: HTTP_STATUS_CODE.Ok
+ }];
+ }
+ });
+}); };
+// EXTERNAL MODULE: external "fs-extra"
+var external_fs_extra_ = __webpack_require__(1);
-/***/ }),
+// CONCATENATED MODULE: ./src/helpers/is_env_production.ts
+var isEnvProduction = function () {
+ return process.env.NODE_ENV === "production";
+};
-/***/ "./src/decorators/guards.ts":
-/*!**********************************!*\
- !*** ./src/decorators/guards.ts ***!
- \**********************************/
-/*! exports provided: Guards */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// EXTERNAL MODULE: external "path"
+var external_path_ = __webpack_require__(0);
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Guards", function() { return Guards; });
-/* harmony import */ var _handlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../handlers */ "./src/handlers/index.ts");
+// CONCATENATED MODULE: ./src/constant.ts
+/* tslint:disable */
+var __ContentType = "Content-Type";
+var __AppName = "fort";
+var __Cookie = "Cookie";
+var __SetCookie = 'Set-Cookie';
+var __CurrentPath = process.cwd();
+var __ContentLength = "Content-Length";
+var __Constructor = "const_constructor";
-// tslint:disable-next-line
-var Guards = function (value) {
- return (function (target, methodName, descriptor) {
- var className = target.constructor.name;
- _handlers__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"].addGuards(value, className, methodName);
+// CONCATENATED MODULE: ./src/helpers/get_view_from_file.ts
+var get_view_from_file_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
+var get_view_from_file_generator = (undefined && undefined.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
-/***/ }),
-/***/ "./src/decorators/index.ts":
-/*!*********************************!*\
- !*** ./src/decorators/index.ts ***!
- \*********************************/
-/*! exports provided: Worker, Shields, Guards, Route, DefaultWorker, Assign, Singleton */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _worker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./worker */ "./src/decorators/worker.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Worker", function() { return _worker__WEBPACK_IMPORTED_MODULE_0__["Worker"]; });
-/* harmony import */ var _shields__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shields */ "./src/decorators/shields.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Shields", function() { return _shields__WEBPACK_IMPORTED_MODULE_1__["Shields"]; });
+var viewCache = {};
+var getViewFromFile = function (fileLocation) {
+ return get_view_from_file_awaiter(this, void 0, void 0, function () {
+ var readView, _a, _b;
+ return get_view_from_file_generator(this, function (_c) {
+ switch (_c.label) {
+ case 0:
+ readView = function () {
+ var pathOfView = external_path_["join"](__CurrentPath, Global.viewPath + "/" + fileLocation);
+ return Object(external_fs_extra_["readFile"])(pathOfView, {
+ encoding: 'utf8'
+ });
+ };
+ if (!isEnvProduction()) return [3 /*break*/, 3];
+ if (!(viewCache[fileLocation] == null)) return [3 /*break*/, 2];
+ _a = viewCache;
+ _b = fileLocation;
+ return [4 /*yield*/, readView()];
+ case 1:
+ _a[_b] = _c.sent();
+ _c.label = 2;
+ case 2: return [2 /*return*/, viewCache[fileLocation]];
+ case 3: return [4 /*yield*/, readView()];
+ case 4: return [2 /*return*/, _c.sent()];
+ }
+ });
+ });
+};
-/* harmony import */ var _guards__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./guards */ "./src/decorators/guards.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Guards", function() { return _guards__WEBPACK_IMPORTED_MODULE_2__["Guards"]; });
+// CONCATENATED MODULE: ./src/helpers/promise.ts
+var promise = function (callBack) {
+ return new Promise(callBack);
+};
-/* harmony import */ var _route__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./route */ "./src/decorators/route.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return _route__WEBPACK_IMPORTED_MODULE_3__["Route"]; });
+// CONCATENATED MODULE: ./src/enums/data_type.ts
+var DATA_TYPE;
+(function (DATA_TYPE) {
+ DATA_TYPE["String"] = "string";
+ DATA_TYPE["Number"] = "number";
+ DATA_TYPE["Array"] = "array";
+ DATA_TYPE["Object"] = "object";
+ DATA_TYPE["Function"] = "function";
+})(DATA_TYPE || (DATA_TYPE = {}));
-/* harmony import */ var _default_worker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./default_worker */ "./src/decorators/default_worker.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DefaultWorker", function() { return _default_worker__WEBPACK_IMPORTED_MODULE_4__["DefaultWorker"]; });
+// CONCATENATED MODULE: ./src/helpers/get_data_type.ts
-/* harmony import */ var _assign__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./assign */ "./src/decorators/assign.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return _assign__WEBPACK_IMPORTED_MODULE_5__["Assign"]; });
+var getDataType = function (value) {
+ var type = typeof value;
+ switch (type) {
+ case 'object':
+ if (Array.isArray(value)) {
+ return DATA_TYPE.Array;
+ }
+ default:
+ return type;
+ }
+};
-/* harmony import */ var _singleton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./singleton */ "./src/decorators/singleton.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Singleton", function() { return _singleton__WEBPACK_IMPORTED_MODULE_6__["Singleton"]; });
+// EXTERNAL MODULE: external "jsontoxml"
+var external_jsontoxml_ = __webpack_require__(4);
+// CONCATENATED MODULE: ./src/helpers/xml_helper.ts
+var xml_helper_XmlHelper = /** @class */ (function () {
+ function XmlHelper() {
+ }
+ XmlHelper.fromJsToXml = function (value) {
+ var addKeyToObjectIfNeeded = function (key, obj) {
+ var _a;
+ var type = getDataType(obj);
+ if (type === DATA_TYPE.Object) {
+ var keys = Object.keys(obj);
+ if (keys.length !== 1) {
+ obj = (_a = {},
+ _a[key] = obj,
+ _a);
+ }
+ }
+ return obj;
+ };
+ var dataType = getDataType(value);
+ switch (dataType) {
+ case DATA_TYPE.Array:
+ value.forEach(function (val, index) {
+ value[index] = addKeyToObjectIfNeeded("item", val);
+ });
+ value = {
+ root: value
+ };
+ break;
+ case DATA_TYPE.Object:
+ value = addKeyToObjectIfNeeded("root", value);
+ }
+ return external_jsontoxml_(value, {
+ xmlHeader: true
+ });
+ };
+ return XmlHelper;
+}());
+// CONCATENATED MODULE: ./src/helpers/get_mime_type_from_extension.ts
-
-
-
-/***/ }),
-
-/***/ "./src/decorators/route.ts":
-/*!*********************************!*\
- !*** ./src/decorators/route.ts ***!
- \*********************************/
-/*! exports provided: Route */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return Route; });
-/* harmony import */ var _handlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../handlers */ "./src/handlers/index.ts");
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers */ "./src/helpers/index.ts");
-
-
-// tslint:disable-next-line
-var Route = function (format) {
- return (function (target, methodName, descriptor) {
- var className = target.constructor.name;
- // remove / from route
- if (format != null && format !== '/') {
- format = Object(_helpers__WEBPACK_IMPORTED_MODULE_1__["removeLastSlash"])(format);
- }
- _handlers__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"].addPattern(format, className, methodName);
- });
+var getMimeTypeFromExtension = function (ext) {
+ switch (ext) {
+ case ".htm":
+ case ".html":
+ return MIME_TYPE.Html;
+ case ".css":
+ return MIME_TYPE.Css;
+ case ".js":
+ return MIME_TYPE.Js;
+ case ".png":
+ return MIME_TYPE.Png;
+ case ".woff":
+ return MIME_TYPE.Woff;
+ case ".woff2":
+ return MIME_TYPE.Woff2;
+ case ".json":
+ return MIME_TYPE.Json;
+ case ".txt":
+ return MIME_TYPE.Text;
+ case ".jpg":
+ case ".jpeg":
+ return MIME_TYPE.Jpeg;
+ case ".rtf":
+ return MIME_TYPE.Rtf;
+ case ".ttf":
+ return MIME_TYPE.Ttf;
+ case ".eot":
+ return MIME_TYPE.Eot;
+ case '.otf':
+ return MIME_TYPE.Otf;
+ case ".swf":
+ return MIME_TYPE.Swf;
+ case ".avi":
+ return MIME_TYPE.Avi;
+ case ".Svg":
+ return MIME_TYPE.Svg;
+ case ".pdf":
+ return MIME_TYPE.Pdf;
+ case ".xml":
+ return MIME_TYPE.Xml;
+ case ".csv":
+ return MIME_TYPE.Csv;
+ case ".xls":
+ return MIME_TYPE.Xls;
+ case ".xlsx":
+ return MIME_TYPE.Xlsx;
+ case ".bmp":
+ return MIME_TYPE.Bmp;
+ case ".gif":
+ return MIME_TYPE.Gif;
+ default:
+ return "application/octet-stream";
+ }
};
+// CONCATENATED MODULE: ./src/utils/is_null_or_empty.ts
+var isNullOrEmpty = function (value) {
+ return value == null || value.length === 0;
+};
-/***/ }),
-
-/***/ "./src/decorators/shields.ts":
-/*!***********************************!*\
- !*** ./src/decorators/shields.ts ***!
- \***********************************/
-/*! exports provided: Shields */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Shields", function() { return Shields; });
-/* harmony import */ var _handlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../handlers */ "./src/handlers/index.ts");
+// CONCATENATED MODULE: ./src/utils/is_null.ts
+var isNull = function (value) {
+ return value == null;
+};
-// tslint:disable-next-line
-var Shields = function (shieldsValue) {
- return function (target) {
- var className = target.name;
- _handlers__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"].addShields(shieldsValue, className);
- };
+// CONCATENATED MODULE: ./src/utils/is_array.ts
+var isArray = function (value) {
+ return Array.isArray(value);
};
+// CONCATENATED MODULE: ./src/utils/index.ts
-/***/ }),
-/***/ "./src/decorators/singleton.ts":
-/*!*************************************!*\
- !*** ./src/decorators/singleton.ts ***!
- \*************************************/
-/*! exports provided: Singleton */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Singleton", function() { return Singleton; });
-/* harmony import */ var _handlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../handlers */ "./src/handlers/index.ts");
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
+// CONCATENATED MODULE: ./src/handlers/route_handler.ts
-// tslint:disable-next-line
-var Singleton = function (value) {
- return function (target, methodName, paramIndex) {
- var className = target.name || target.constructor.name;
- if (methodName == null || methodName === 'constructor') {
- methodName = _constant__WEBPACK_IMPORTED_MODULE_1__["__Constructor"];
+var routerCollection = [];
+var getActionPattern = function (parentRoute, pattern) {
+ return (isNull(parentRoute.path) || parentRoute.path === "*") ? pattern : "/" + parentRoute.path + pattern;
+};
+var RouteHandler = /** @class */ (function () {
+ function RouteHandler() {
+ }
+ Object.defineProperty(RouteHandler, "routerCollection", {
+ get: function () {
+ return routerCollection;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ RouteHandler.addToRouterCollection = function (value) {
+ var route = routerCollection.find(function (x) { return x.controllerName === value.controller.name; });
+ if (route == null) {
+ routerCollection.push({
+ workers: [],
+ controller: value.controller,
+ controllerName: value.controller.name,
+ path: value.path,
+ shields: [],
+ values: []
+ });
+ }
+ else {
+ route.controller = value.controller;
+ route.path = value.path;
+ // change pattern value since we have controller name now.
+ route.workers.forEach(function (actionInfo) {
+ actionInfo.pattern = getActionPattern(value, actionInfo.pattern);
+ });
}
- _handlers__WEBPACK_IMPORTED_MODULE_0__["InjectorHandler"].addSingleton(className, methodName, paramIndex, value);
};
-};
-
+ RouteHandler.addShields = function (shields, className) {
+ var index = routerCollection.findIndex(function (x) { return x.controllerName === className; });
+ if (index < 0) {
+ routerCollection.push({
+ workers: [],
+ controller: null,
+ controllerName: className,
+ shields: shields,
+ path: null,
+ values: []
+ });
+ }
+ else {
+ routerCollection[index].shields = shields;
+ }
+ };
+ RouteHandler.addWorker = function (newAction, className) {
+ var router = routerCollection.find(function (x) { return x.controllerName === className; });
+ if (router == null) {
+ routerCollection.push({
+ workers: [newAction],
+ controller: null,
+ controllerName: className,
+ shields: [],
+ path: null,
+ values: []
+ });
+ }
+ else {
+ var savedAction = router.workers.find(function (val) { return val.workerName === newAction.workerName; });
+ if (savedAction == null) {
+ newAction.pattern = getActionPattern(router, newAction.pattern);
+ router.workers.push(newAction);
+ }
+ else {
+ savedAction.methodsAllowed = newAction.methodsAllowed;
+ savedAction.pattern = router.path == null ? savedAction.pattern : "/" + router.path + savedAction.pattern;
+ }
+ }
+ };
+ RouteHandler.addGuards = function (guards, className, actionName) {
+ var index = routerCollection.findIndex(function (x) { return x.controllerName === className; });
+ var pattern = actionName.toLowerCase();
+ if (index < 0) {
+ routerCollection.push({
+ workers: [{
+ workerName: actionName,
+ guards: guards,
+ methodsAllowed: null,
+ pattern: pattern,
+ values: []
+ }],
+ controller: null,
+ controllerName: className,
+ shields: [],
+ path: null,
+ values: []
+ });
+ }
+ else {
+ var savedAction = routerCollection[index].workers.find(function (val) { return val.workerName === actionName; });
+ if (savedAction == null) {
+ routerCollection[index].workers.push({
+ workerName: actionName,
+ guards: guards,
+ methodsAllowed: null,
+ pattern: pattern,
+ values: []
+ });
+ }
+ else {
+ savedAction.guards = guards;
+ }
+ }
+ };
+ RouteHandler.addPattern = function (pattern, className, actionName) {
+ var router = routerCollection.find(function (x) { return x.controllerName === className; });
+ if (router == null) {
+ routerCollection.push({
+ workers: [{
+ workerName: actionName,
+ guards: [],
+ methodsAllowed: null,
+ pattern: pattern,
+ values: []
+ }],
+ controller: null,
+ controllerName: className,
+ shields: [],
+ path: null,
+ values: []
+ });
+ }
+ else {
+ var savedAction = router.workers.find(function (val) { return val.workerName === actionName; });
+ pattern = getActionPattern(router, pattern);
+ if (savedAction == null) {
+ router.workers.push({
+ workerName: actionName,
+ guards: [],
+ methodsAllowed: null,
+ pattern: pattern,
+ values: []
+ });
+ }
+ else {
+ savedAction.pattern = pattern;
+ }
+ }
+ };
+ return RouteHandler;
+}());
-/***/ }),
-/***/ "./src/decorators/worker.ts":
-/*!**********************************!*\
- !*** ./src/decorators/worker.ts ***!
- \**********************************/
-/*! exports provided: Worker */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// CONCATENATED MODULE: ./src/helpers/parse_match_route.ts
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Worker", function() { return Worker; });
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _handlers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../handlers */ "./src/handlers/index.ts");
+var checkRouteInWorkerForDefaultRoute = function (route, httpMethod, urlParts) {
+ var matchedRoute = {
+ allowedHttpMethod: []
+ };
+ matchedRoute.controller = route.controller;
+ var urlPartLength = urlParts.length;
+ var regex1 = /{(.*)}(?!.)/;
+ var regex2 = /{(.*)}\.(\w+)(?!.)/;
+ route.workers.every(function (routeActionInfo) {
+ var patternSplit = routeActionInfo.pattern.split("/");
+ if (urlPartLength === patternSplit.length) {
+ var isMatched_1 = true;
+ var params_1 = {};
+ urlParts.every(function (urlPart, i) {
+ var regMatch1 = patternSplit[i].match(regex1);
+ var regMatch2 = patternSplit[i].match(regex2);
+ if (regMatch1 != null) {
+ params_1[regMatch1[1]] = urlPart;
+ }
+ else if (regMatch2 != null) {
+ var splitByDot = urlPart.split(".");
+ if (splitByDot[1] === regMatch2[2]) {
+ params_1[regMatch2[1]] = splitByDot[0];
+ }
+ else {
+ isMatched_1 = false;
+ return false;
+ }
+ }
+ else if (urlPart !== patternSplit[i]) {
+ isMatched_1 = false;
+ return false;
+ }
+ return true;
+ });
+ if (isMatched_1 === true) {
+ if (routeActionInfo.methodsAllowed.indexOf(httpMethod) >= 0) {
+ matchedRoute.workerInfo = routeActionInfo;
+ matchedRoute.params = params_1;
+ matchedRoute.shields = route.shields;
+ return false;
+ }
+ else {
+ matchedRoute.allowedHttpMethod = matchedRoute.allowedHttpMethod.concat(routeActionInfo.methodsAllowed);
+ }
+ }
+ }
+ return true;
+ });
+ if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {
+ return null;
+ }
+ return matchedRoute;
+};
+var checkRouteInWorker = function (route, httpMethod, urlParts) {
+ var matchedRoute = {
+ allowedHttpMethod: []
+ };
+ matchedRoute.controller = route.controller;
+ var urlPartLength = urlParts.length;
+ if (urlPartLength === 2) { // url does not have action path
+ var pattern_1 = "/" + route.path + "/";
+ route.workers.every(function (action) {
+ if (action.pattern === pattern_1) {
+ if (action.methodsAllowed.indexOf(httpMethod) >= 0) {
+ matchedRoute.workerInfo = action;
+ matchedRoute.params = {};
+ matchedRoute.shields = route.shields;
+ return false;
+ }
+ else {
+ matchedRoute.allowedHttpMethod = matchedRoute.allowedHttpMethod.concat(action.methodsAllowed);
+ }
+ }
+ return true;
+ });
+ }
+ else {
+ var regex1_1 = /{(.*)}(?!.)/;
+ var regex2_1 = /{(.*)}\.(\w+)(?!.)/;
+ route.workers.every(function (routeActionInfo) {
+ var patternSplit = routeActionInfo.pattern.split("/");
+ if (urlPartLength === patternSplit.length) {
+ var isMatched_2 = true;
+ var params_2 = {};
+ urlParts.every(function (urlPart, i) {
+ var regMatch1 = patternSplit[i].match(regex1_1);
+ var regMatch2 = patternSplit[i].match(regex2_1);
+ if (regMatch1 != null) {
+ params_2[regMatch1[1]] = urlPart;
+ }
+ else if (regMatch2 != null) {
+ var splitByDot = urlPart.split(".");
+ if (splitByDot[1] === regMatch2[2]) {
+ params_2[regMatch2[1]] = splitByDot[0];
+ }
+ else {
+ isMatched_2 = false;
+ return false;
+ }
+ }
+ else if (urlPart !== patternSplit[i]) {
+ isMatched_2 = false;
+ return false;
+ }
+ return true;
+ });
+ if (isMatched_2 === true) {
+ if (routeActionInfo.methodsAllowed.indexOf(httpMethod) >= 0) {
+ matchedRoute.workerInfo = routeActionInfo;
+ matchedRoute.params = params_2;
+ matchedRoute.shields = route.shields;
+ return false;
+ }
+ else {
+ matchedRoute.allowedHttpMethod = matchedRoute.allowedHttpMethod.concat(routeActionInfo.methodsAllowed);
+ }
+ }
+ }
+ return true;
+ });
+ }
+ if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {
+ return null;
+ }
+ return matchedRoute;
+};
+var parseAndMatchRoute = function (url, httpMethod) {
+ if (url !== "/") {
+ url = removeLastSlash(url);
+ }
+ var urlParts = url.split("/");
+ var firstPart = urlParts[1];
+ var route = RouteHandler.routerCollection.find(function (qry) { return qry.path === firstPart; });
+ if (route == null) {
+ route = RouteHandler.routerCollection.find(function (qry) { return qry.path === "*"; });
+ return checkRouteInWorkerForDefaultRoute(route, httpMethod, urlParts);
+ }
+ else {
+ return checkRouteInWorker(route, httpMethod, urlParts);
+ }
+};
-// tslint:disable-next-line
-var Worker = function (allowedMethods) {
- return function (target, methodName, descriptor) {
- var className = target.constructor.name;
- var actionInfo = {
- workerName: methodName,
- methodsAllowed: allowedMethods == null ? [
- _enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_METHOD"].Delete, _enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_METHOD"].Get, _enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_METHOD"].Post, _enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_METHOD"].Patch, _enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_METHOD"].Put
- ] : allowedMethods,
- guards: [],
- pattern: "/" + methodName.toLowerCase(),
- values: []
- };
- _handlers__WEBPACK_IMPORTED_MODULE_1__["RouteHandler"].addWorker(actionInfo, className);
+// CONCATENATED MODULE: ./src/helpers/parse_cookie.ts
+
+var parseCookie = function (cookie) {
+ var value = {};
+ if (!isNullOrEmpty(cookie)) {
+ cookie.split(';').forEach(function (val) {
+ var parts = val.split('=');
+ value[parts.shift().trim()] = decodeURI(parts.join('='));
+ });
+ }
+ return value;
+};
+
+// CONCATENATED MODULE: ./src/helpers/json_helper.ts
+var JsonHelper = /** @class */ (function () {
+ function JsonHelper() {
+ }
+ JsonHelper.parse = function (value) {
+ try {
+ return JSON.parse(value);
+ }
+ catch (ex) {
+ // tslint:disable-next-line
+ throw {
+ message: "Post data is invalid"
+ };
+ }
+ };
+ JsonHelper.stringify = function (value) {
+ return JSON.stringify(value);
};
+ return JsonHelper;
+}());
+
+
+// CONCATENATED MODULE: ./src/helpers/remove_last_slash.ts
+var removeLastSlash = function (url) {
+ var urlLength = url.length;
+ // removing / from url;
+ if (url[urlLength - 1] === "/") {
+ return url.substr(0, urlLength - 1);
+ }
+ return url;
};
+// CONCATENATED MODULE: ./src/helpers/remove_first_slash.ts
+var removeFirstSlash = function (value) {
+ // remove / from string at 0th index
+ if (value[0] === "/") {
+ return value.substr(1);
+ }
+ return value;
+};
-/***/ }),
+// CONCATENATED MODULE: ./src/helpers/reverse_loop.ts
+var reverseLoop = function (values, cb) {
+ for (var length_1 = values.length, i = length_1 - 1; i >= 0; i--) {
+ cb(values[i], i);
+ }
+};
-/***/ "./src/enums/data_type.ts":
-/*!********************************!*\
- !*** ./src/enums/data_type.ts ***!
- \********************************/
-/*! exports provided: DATA_TYPE */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// CONCATENATED MODULE: ./src/helpers/index.ts
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DATA_TYPE", function() { return DATA_TYPE; });
-var DATA_TYPE;
-(function (DATA_TYPE) {
- DATA_TYPE["String"] = "string";
- DATA_TYPE["Number"] = "number";
- DATA_TYPE["Array"] = "array";
- DATA_TYPE["Object"] = "object";
- DATA_TYPE["Function"] = "function";
-})(DATA_TYPE || (DATA_TYPE = {}));
-/***/ }),
-/***/ "./src/enums/error_type.ts":
-/*!*********************************!*\
- !*** ./src/enums/error_type.ts ***!
- \*********************************/
-/*! exports provided: ERROR_TYPE */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ERROR_TYPE", function() { return ERROR_TYPE; });
-var ERROR_TYPE;
-(function (ERROR_TYPE) {
- ERROR_TYPE["InvalidControllerName"] = "invalid_controller_name";
- ERROR_TYPE["InvalidContentType"] = "invalid_content_type";
- ERROR_TYPE["PortInUse"] = "port_in_use";
- ERROR_TYPE["UndefinedViewEngine"] = "undefined_view_engine";
-})(ERROR_TYPE || (ERROR_TYPE = {}));
-/***/ }),
-/***/ "./src/enums/etag_type.ts":
-/*!********************************!*\
- !*** ./src/enums/etag_type.ts ***!
- \********************************/
-/*! exports provided: ETag_Type */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ETag_Type", function() { return ETag_Type; });
-var ETag_Type;
-(function (ETag_Type) {
- ETag_Type["Strong"] = "strong";
- ETag_Type["Weak"] = "weak";
-})(ETag_Type || (ETag_Type = {}));
-/***/ }),
-/***/ "./src/enums/http_method.ts":
-/*!**********************************!*\
- !*** ./src/enums/http_method.ts ***!
- \**********************************/
-/*! exports provided: HTTP_METHOD */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HTTP_METHOD", function() { return HTTP_METHOD; });
-var HTTP_METHOD;
-(function (HTTP_METHOD) {
- HTTP_METHOD["Get"] = "GET";
- HTTP_METHOD["Post"] = "POST";
- HTTP_METHOD["Put"] = "PUT";
- HTTP_METHOD["Patch"] = "PATCH";
- HTTP_METHOD["Delete"] = "DELETE";
- HTTP_METHOD["Options"] = "OPTIONS";
- HTTP_METHOD["Head"] = "HEAD";
-})(HTTP_METHOD || (HTTP_METHOD = {}));
-/***/ }),
-/***/ "./src/enums/http_status_code.ts":
-/*!***************************************!*\
- !*** ./src/enums/http_status_code.ts ***!
- \***************************************/
-/*! exports provided: HTTP_STATUS_CODE */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HTTP_STATUS_CODE", function() { return HTTP_STATUS_CODE; });
-var HTTP_STATUS_CODE;
-(function (HTTP_STATUS_CODE) {
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["BadRequest"] = 400] = "BadRequest";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["Unauthorized"] = 401] = "Unauthorized";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["Forbidden"] = 403] = "Forbidden";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["NotFound"] = 404] = "NotFound";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["Ok"] = 200] = "Ok";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["Created"] = 201] = "Created";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["NoContent"] = 204] = "NoContent";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["Redirect"] = 302] = "Redirect";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["NotModified"] = 304] = "NotModified";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["MethodNotAllowed"] = 405] = "MethodNotAllowed";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["NotAcceptable"] = 406] = "NotAcceptable";
- HTTP_STATUS_CODE[HTTP_STATUS_CODE["InternalServerError"] = 500] = "InternalServerError";
-})(HTTP_STATUS_CODE || (HTTP_STATUS_CODE = {}));
-
-
-/***/ }),
-
-/***/ "./src/enums/index.ts":
-/*!****************************!*\
- !*** ./src/enums/index.ts ***!
- \****************************/
-/*! exports provided: MIME_TYPE, HTTP_METHOD, HTTP_STATUS_CODE, ETag_Type, ERROR_TYPE */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _mime_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mime_type */ "./src/enums/mime_type.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MIME_TYPE", function() { return _mime_type__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"]; });
-
-/* harmony import */ var _http_method__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http_method */ "./src/enums/http_method.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HTTP_METHOD", function() { return _http_method__WEBPACK_IMPORTED_MODULE_1__["HTTP_METHOD"]; });
-
-/* harmony import */ var _http_status_code__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http_status_code */ "./src/enums/http_status_code.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HTTP_STATUS_CODE", function() { return _http_status_code__WEBPACK_IMPORTED_MODULE_2__["HTTP_STATUS_CODE"]; });
-
-/* harmony import */ var _etag_type__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./etag_type */ "./src/enums/etag_type.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ETag_Type", function() { return _etag_type__WEBPACK_IMPORTED_MODULE_3__["ETag_Type"]; });
-
-/* harmony import */ var _error_type__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./error_type */ "./src/enums/error_type.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ERROR_TYPE", function() { return _error_type__WEBPACK_IMPORTED_MODULE_4__["ERROR_TYPE"]; });
-
-
-
-
-
-
-
-
-/***/ }),
-
-/***/ "./src/enums/mime_type.ts":
-/*!********************************!*\
- !*** ./src/enums/mime_type.ts ***!
- \********************************/
-/*! exports provided: MIME_TYPE */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MIME_TYPE", function() { return MIME_TYPE; });
-var MIME_TYPE;
-(function (MIME_TYPE) {
- MIME_TYPE["Text"] = "text/plain";
- MIME_TYPE["Json"] = "application/json";
- MIME_TYPE["Html"] = "text/html";
- MIME_TYPE["FormUrlEncoded"] = "application/x-www-form-urlencoded";
- MIME_TYPE["Css"] = "text/css";
- MIME_TYPE["Csv"] = "text/csv";
- MIME_TYPE["Js"] = "application/javascript";
- MIME_TYPE["Bmp"] = "image/bmp";
- MIME_TYPE["Jpeg"] = "image/jpeg";
- MIME_TYPE["Gif"] = "image/gif";
- MIME_TYPE["Ico"] = "image/x-icon";
- MIME_TYPE["Png"] = "image/png";
- MIME_TYPE["Pdf"] = "application/pdf";
- MIME_TYPE["Svg"] = "image/svg+xml";
- MIME_TYPE["Rtf"] = "application/rtf";
- MIME_TYPE["Xml"] = "application/xml";
- MIME_TYPE["Xls"] = "application/vnd.ms-excel";
- MIME_TYPE["Xlsx"] = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
- MIME_TYPE["Ttf"] = "font/ttf";
- MIME_TYPE["Woff"] = "font/woff";
- MIME_TYPE["Woff2"] = "font/woff2";
- MIME_TYPE["Eot"] = "application/vnd.ms-fontobject";
- MIME_TYPE["Otf"] = "font/otf";
- MIME_TYPE["Swf"] = "application/x-shockwave-flash";
- MIME_TYPE["Avi"] = "video/avi";
- MIME_TYPE["FormMultiPart"] = "multipart/form-data";
-})(MIME_TYPE || (MIME_TYPE = {}));
-/***/ }),
-/***/ "./src/extra/index.ts":
-/*!****************************!*\
- !*** ./src/extra/index.ts ***!
- \****************************/
-/*! exports provided: MustacheViewEngine, MemorySessionProvider */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _mustache_view_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mustache_view_engine */ "./src/extra/mustache_view_engine.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MustacheViewEngine", function() { return _mustache_view_engine__WEBPACK_IMPORTED_MODULE_0__["MustacheViewEngine"]; });
+// CONCATENATED MODULE: ./src/models/error_handler.ts
-/* harmony import */ var _memory_session_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./memory_session_provider */ "./src/extra/memory_session_provider.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MemorySessionProvider", function() { return _memory_session_provider__WEBPACK_IMPORTED_MODULE_1__["MemorySessionProvider"]; });
+var error_handler_ErrorHandler = /** @class */ (function () {
+ function ErrorHandler() {
+ }
+ ErrorHandler.prototype.onServerError = function (ex) {
+ return promise(function (resolve, reject) {
+ var errMessage = "
internal server error
\n message : " + ex.message + "
";
+ if (ex.stack) {
+ errMessage += "stacktrace: " + ex.stack + "
";
+ }
+ if (ex.type) {
+ errMessage += "type: " + ex.type + "
";
+ }
+ resolve(errMessage);
+ });
+ };
+ ErrorHandler.prototype.onBadRequest = function (ex) {
+ return promise(function (resolve, reject) {
+ var errMessage = "Bad Request
";
+ if (ex.message) {
+ errMessage += " message : " + ex.message + "
";
+ }
+ if (ex.stack) {
+ errMessage += "stacktrace: " + ex.stack + "
";
+ }
+ if (ex.type) {
+ errMessage += "type: " + ex.type + "
";
+ }
+ resolve(errMessage);
+ });
+ };
+ ErrorHandler.prototype.onForbiddenRequest = function () {
+ return promise(function (resolve, reject) {
+ var errMessage = "Forbidden
";
+ resolve(errMessage);
+ });
+ };
+ ErrorHandler.prototype.onNotAcceptableRequest = function () {
+ return promise(function (resolve, reject) {
+ var errMessage = "Not Acceptable
";
+ resolve(errMessage);
+ });
+ };
+ ErrorHandler.prototype.onMethodNotAllowed = function () {
+ return promise(function (resolve, reject) {
+ var errMessage = "Method Not allowed.
";
+ resolve(errMessage);
+ });
+ };
+ ErrorHandler.prototype.onNotFound = function (url) {
+ return promise(function (resolve, reject) {
+ var errMessage = "The requested resource " + url + " was not found.
";
+ resolve(errMessage);
+ });
+ };
+ return ErrorHandler;
+}());
+// CONCATENATED MODULE: ./src/models/http_cookie.ts
+var HttpCookie = /** @class */ (function () {
+ function HttpCookie(name, value) {
+ this.name = name;
+ this.value = value;
+ }
+ return HttpCookie;
+}());
+// EXTERNAL MODULE: external "url"
+var external_url_ = __webpack_require__(5);
-/***/ }),
+// EXTERNAL MODULE: external "negotiator"
+var external_negotiator_ = __webpack_require__(2);
-/***/ "./src/extra/memory_session_provider.ts":
-/*!**********************************************!*\
- !*** ./src/extra/memory_session_provider.ts ***!
- \**********************************************/
-/*! exports provided: MemorySessionProvider */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// CONCATENATED MODULE: ./src/handlers/injector_handler.ts
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MemorySessionProvider", function() { return MemorySessionProvider; });
-/* harmony import */ var _abstracts_session_provider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../abstracts/session_provider */ "./src/abstracts/session_provider.ts");
-var __extends = (undefined && undefined.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
+// this stores information of injector values that are available per class & worker
+var injectorStoreInfos = [];
+// this stores injector values
+var injectorValues = [];
+// this stores the singletons name & their respective index in injector values
+var singletons = {};
+var injector_handler_InjectorHandler = /** @class */ (function () {
+ function InjectorHandler() {
+ }
+ InjectorHandler.addWorkerValue = function (className, methodName, paramIndex, paramValue, shouldFindIndex) {
+ var _a;
+ if (shouldFindIndex === void 0) { shouldFindIndex = true; }
+ if (shouldFindIndex === true) {
+ var paramValueIndex = injectorValues.indexOf(paramValue);
+ if (paramValueIndex < 0) {
+ paramValue = injectorValues.push(paramValue) - 1;
+ }
+ else {
+ paramValue = paramValueIndex;
+ }
+ }
+ var savedValue = injectorStoreInfos.find(function (x) { return x.className === className; });
+ var value = {
+ className: className,
+ methods: (_a = {},
+ _a[methodName] = [],
+ _a)
+ };
+ if (savedValue == null) {
+ value.methods[methodName][paramIndex] = paramValue;
+ injectorStoreInfos.push(value);
+ }
+ else {
+ // const savedMethod = savedValue.methods[methodName];
+ if (savedValue.methods[methodName] == null) {
+ savedValue.methods[methodName] = [];
+ }
+ savedValue.methods[methodName][paramIndex] = paramValue;
+ }
+ return paramValue;
};
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ InjectorHandler.getConstructorValues = function (className) {
+ return this.getMethodValues(className, __Constructor);
};
-})();
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ InjectorHandler.getMethodValues = function (className, methodName) {
+ var savedValue = injectorStoreInfos.find(function (qry) { return qry.className === className; });
+ if (savedValue != null) {
+ var methodArgs = savedValue.methods[methodName];
+ if (methodArgs != null) {
+ return methodArgs.map(function (injectorValueIndex) {
+ return injectorValues[injectorValueIndex];
+ });
+ }
+ }
+ return [];
+ };
+ InjectorHandler.addSingleton = function (className, methodName, paramIndex, paramValue) {
+ var singletonClassName = paramValue.name;
+ if (singletonClassName) {
+ if (singletons[singletonClassName] == null) {
+ singletons[singletonClassName] = InjectorHandler.addWorkerValue(className, methodName, paramIndex, new paramValue());
+ }
+ else {
+ InjectorHandler.addWorkerValue(className, methodName, paramIndex, singletons[singletonClassName], false);
+ }
+ }
+ };
+ return InjectorHandler;
+}());
+
+
+// CONCATENATED MODULE: ./src/handlers/request_handler_helper.ts
+var request_handler_helper_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
@@ -888,7 +1250,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
+var request_handler_helper_generator = (undefined && undefined.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
@@ -916,216 +1278,248 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod
}
};
-var sessionValues = [];
-var MemorySessionProvider = /** @class */ (function (_super) {
- __extends(MemorySessionProvider, _super);
- function MemorySessionProvider() {
- return _super !== null && _super.apply(this, arguments) || this;
+
+
+
+
+
+var request_handler_helper_RequestHandlerHelper = /** @class */ (function () {
+ function RequestHandlerHelper() {
+ this.wallInstances = [];
}
- MemorySessionProvider.prototype.get = function (key) {
- return __awaiter(this, void 0, void 0, function () {
- var savedSession, session;
- var _this = this;
- return __generator(this, function (_a) {
- savedSession = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
- if (savedSession != null) {
- session = savedSession.datas.find(function (qry) { return qry.key === key; });
- return [2 /*return*/, session.value];
- }
- return [2 /*return*/, null];
- });
+ RequestHandlerHelper.prototype.runWallOutgoing = function () {
+ var outgoingResults = [];
+ reverseLoop(this.wallInstances, function (value) {
+ var methodArgsValues = injector_handler_InjectorHandler.getMethodValues(value.constructor.name, 'onOutgoing');
+ outgoingResults.push(value.onOutgoing(methodArgsValues));
});
+ return Promise.all(outgoingResults);
};
- MemorySessionProvider.prototype.isExist = function (key) {
- return __awaiter(this, void 0, void 0, function () {
- var savedValue, index;
- var _this = this;
- return __generator(this, function (_a) {
- savedValue = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
- if (savedValue == null) {
- return [2 /*return*/, false];
- }
- else {
- index = savedValue.datas.findIndex(function (qry) { return qry.key === key; });
- return [2 /*return*/, index >= 0];
- }
- return [2 /*return*/];
- });
- });
+ RequestHandlerHelper.prototype.getContentTypeFromNegotiation = function (type) {
+ var negotiator = new external_negotiator_(this.request);
+ var availableTypes = this.getAvailableTypes_(type);
+ if (availableTypes == null) {
+ availableTypes = [type];
+ }
+ return negotiator.mediaType(availableTypes);
};
- MemorySessionProvider.prototype.getAll = function () {
- return __awaiter(this, void 0, void 0, function () {
- var savedValue;
- var _this = this;
- return __generator(this, function (_a) {
- savedValue = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
- return [2 /*return*/, savedValue == null ? [] : savedValue.datas];
+ RequestHandlerHelper.prototype.getContentTypeFromNegotiationHavingMultipleTypes = function (types) {
+ var negotiator = new external_negotiator_(this.request);
+ return negotiator.mediaType(types);
+ };
+ RequestHandlerHelper.prototype.getAvailableTypes_ = function (type) {
+ switch (type) {
+ case MIME_TYPE.Json:
+ case MIME_TYPE.Xml:
+ return [MIME_TYPE.Json, MIME_TYPE.Xml];
+ case MIME_TYPE.Html:
+ case MIME_TYPE.Css:
+ case MIME_TYPE.Csv:
+ case MIME_TYPE.Js:
+ case MIME_TYPE.Rtf:
+ case MIME_TYPE.Text:
+ return [MIME_TYPE.Text, MIME_TYPE.Html, MIME_TYPE.Js,
+ MIME_TYPE.Css, MIME_TYPE.Rtf, MIME_TYPE.Csv];
+ }
+ return null;
+ };
+ RequestHandlerHelper.prototype.onBadRequest = function (error) {
+ return request_handler_helper_awaiter(this, void 0, void 0, function () {
+ var _a, errMessage, ex_1;
+ return request_handler_helper_generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ _b.trys.push([0, 3, , 4]);
+ return [4 /*yield*/, this.runWallOutgoing()];
+ case 1:
+ _b.sent();
+ return [4 /*yield*/, new Global.errorHandler().onBadRequest(error)];
+ case 2:
+ errMessage = _b.sent();
+ return [3 /*break*/, 4];
+ case 3:
+ ex_1 = _b.sent();
+ return [2 /*return*/, this.onErrorOccured(ex_1)];
+ case 4:
+ this.response.writeHead(HTTP_STATUS_CODE.BadRequest, (_a = {}, _a[__ContentType] = MIME_TYPE.Html, _a));
+ this.response.end(errMessage);
+ return [2 /*return*/];
+ }
});
});
};
- MemorySessionProvider.prototype.set = function (key, val) {
- return __awaiter(this, void 0, void 0, function () {
- var savedValue, savedSessionData;
- var _this = this;
- return __generator(this, function (_a) {
- savedValue = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
- if (savedValue == null) {
- this.createSession();
- sessionValues.push({
- identifier: this.sessionId,
- datas: [{
- key: key,
- value: val
- }]
- });
+ RequestHandlerHelper.prototype.onForbiddenRequest = function () {
+ return request_handler_helper_awaiter(this, void 0, void 0, function () {
+ var _a, errMessage, ex_2;
+ return request_handler_helper_generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ _b.trys.push([0, 3, , 4]);
+ return [4 /*yield*/, this.runWallOutgoing()];
+ case 1:
+ _b.sent();
+ return [4 /*yield*/, new Global.errorHandler().onForbiddenRequest()];
+ case 2:
+ errMessage = _b.sent();
+ return [3 /*break*/, 4];
+ case 3:
+ ex_2 = _b.sent();
+ return [2 /*return*/, this.onErrorOccured(ex_2)];
+ case 4:
+ this.response.writeHead(HTTP_STATUS_CODE.Forbidden, (_a = {}, _a[__ContentType] = MIME_TYPE.Html, _a));
+ this.response.end(errMessage);
+ return [2 /*return*/];
}
- else {
- savedSessionData = savedValue.datas.find(function (q) { return q.key === key; });
- if (savedSessionData == null) {
- savedValue.datas.push({
- key: key,
- value: val
- });
- }
- else {
- savedSessionData.value = val;
- }
+ });
+ });
+ };
+ RequestHandlerHelper.prototype.onNotAcceptableRequest = function () {
+ return request_handler_helper_awaiter(this, void 0, void 0, function () {
+ var _a, errMessage, ex_3;
+ return request_handler_helper_generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ _b.trys.push([0, 3, , 4]);
+ return [4 /*yield*/, this.runWallOutgoing()];
+ case 1:
+ _b.sent();
+ return [4 /*yield*/, new Global.errorHandler().onNotAcceptableRequest()];
+ case 2:
+ errMessage = _b.sent();
+ return [3 /*break*/, 4];
+ case 3:
+ ex_3 = _b.sent();
+ return [2 /*return*/, this.onErrorOccured(ex_3)];
+ case 4:
+ this.response.writeHead(HTTP_STATUS_CODE.NotAcceptable, (_a = {}, _a[__ContentType] = MIME_TYPE.Html, _a));
+ this.response.end(errMessage);
+ return [2 /*return*/];
}
- return [2 /*return*/];
});
});
};
- MemorySessionProvider.prototype.setMany = function (values) {
- var _this = this;
- return Promise.all(values.map(function (value) { return __awaiter(_this, void 0, void 0, function () {
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, this.set(value.key, value.value)];
- case 1: return [2 /*return*/, _a.sent()];
+ RequestHandlerHelper.prototype.onNotFound = function () {
+ return request_handler_helper_awaiter(this, void 0, void 0, function () {
+ var _a, errMessage, ex_4;
+ return request_handler_helper_generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ _b.trys.push([0, 3, , 4]);
+ return [4 /*yield*/, this.runWallOutgoing()];
+ case 1:
+ _b.sent();
+ return [4 /*yield*/, new Global.errorHandler().onNotFound(this.request.url)];
+ case 2:
+ errMessage = _b.sent();
+ return [3 /*break*/, 4];
+ case 3:
+ ex_4 = _b.sent();
+ return [2 /*return*/, this.onErrorOccured(ex_4)];
+ case 4:
+ this.response.writeHead(HTTP_STATUS_CODE.NotFound, (_a = {}, _a[__ContentType] = MIME_TYPE.Html, _a));
+ this.response.end(errMessage);
+ return [2 /*return*/];
}
});
- }); }));
+ });
};
- MemorySessionProvider.prototype.remove = function (key) {
- return __awaiter(this, void 0, void 0, function () {
- var savedValue, index;
- var _this = this;
- return __generator(this, function (_a) {
- savedValue = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
- if (savedValue != null) {
- index = savedValue.datas.findIndex(function (q) { return q.key === key; });
- savedValue.datas.splice(index, 1);
+ RequestHandlerHelper.prototype.onMethodNotAllowed = function (allowedMethods) {
+ return request_handler_helper_awaiter(this, void 0, void 0, function () {
+ var _a, errMessage, ex_5;
+ return request_handler_helper_generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ _b.trys.push([0, 3, , 4]);
+ return [4 /*yield*/, this.runWallOutgoing()];
+ case 1:
+ _b.sent();
+ return [4 /*yield*/, new Global.errorHandler().onMethodNotAllowed()];
+ case 2:
+ errMessage = _b.sent();
+ return [3 /*break*/, 4];
+ case 3:
+ ex_5 = _b.sent();
+ return [2 /*return*/, this.onErrorOccured(ex_5)];
+ case 4:
+ this.response.setHeader("Allow", allowedMethods.join(","));
+ this.response.writeHead(HTTP_STATUS_CODE.MethodNotAllowed, (_a = {}, _a[__ContentType] = MIME_TYPE.Html, _a));
+ this.response.end(errMessage);
+ return [2 /*return*/];
}
- return [2 /*return*/];
});
});
};
- MemorySessionProvider.prototype.clear = function () {
- return __awaiter(this, void 0, void 0, function () {
- var index;
- var _this = this;
- return __generator(this, function (_a) {
- index = sessionValues.findIndex(function (q) { return q.identifier === _this.sessionId; });
- if (index >= 0) {
- sessionValues.splice(index, 1);
+ RequestHandlerHelper.prototype.onErrorOccured = function (error) {
+ return request_handler_helper_awaiter(this, void 0, void 0, function () {
+ var _a, _b, errMessage, ex_6;
+ return request_handler_helper_generator(this, function (_c) {
+ switch (_c.label) {
+ case 0:
+ if (typeof error === 'string') {
+ error = {
+ message: error
+ };
+ }
+ _c.label = 1;
+ case 1:
+ _c.trys.push([1, 4, , 5]);
+ return [4 /*yield*/, this.runWallOutgoing()];
+ case 2:
+ _c.sent();
+ return [4 /*yield*/, new Global.errorHandler().onServerError(error)];
+ case 3:
+ errMessage = _c.sent();
+ return [3 /*break*/, 5];
+ case 4:
+ ex_6 = _c.sent();
+ this.response.writeHead(HTTP_STATUS_CODE.InternalServerError, (_a = {}, _a[__ContentType] = MIME_TYPE.Html, _a));
+ this.response.end(JsonHelper.stringify(ex_6));
+ return [2 /*return*/];
+ case 5:
+ this.response.writeHead(HTTP_STATUS_CODE.InternalServerError, (_b = {}, _b[__ContentType] = MIME_TYPE.Html, _b));
+ this.response.end(errMessage);
+ return [2 /*return*/];
}
- // expire cookie in browser
- this.destroySession();
- return [2 /*return*/];
});
});
};
- return MemorySessionProvider;
-}(_abstracts_session_provider__WEBPACK_IMPORTED_MODULE_0__["SessionProvider"]));
-
-
-
-/***/ }),
-
-/***/ "./src/extra/mustache_view_engine.ts":
-/*!*******************************************!*\
- !*** ./src/extra/mustache_view_engine.ts ***!
- \*******************************************/
-/*! exports provided: MustacheViewEngine */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MustacheViewEngine", function() { return MustacheViewEngine; });
-/* harmony import */ var mustache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mustache */ "mustache");
-/* harmony import */ var mustache__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(mustache__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers */ "./src/helpers/index.ts");
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
-};
-
-
-var MustacheViewEngine = /** @class */ (function () {
- function MustacheViewEngine() {
- }
- MustacheViewEngine.prototype.render = function (value) {
- return __awaiter(this, void 0, void 0, function () {
- var viewData;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, Object(_helpers__WEBPACK_IMPORTED_MODULE_1__["getViewFromFile"])(value.view)];
+ RequestHandlerHelper.prototype.onRequestOptions = function (allowedMethods) {
+ return request_handler_helper_awaiter(this, void 0, void 0, function () {
+ var _a, ex_7;
+ return request_handler_helper_generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ _b.trys.push([0, 2, , 3]);
+ return [4 /*yield*/, this.runWallOutgoing()];
case 1:
- viewData = _a.sent();
- return [2 /*return*/, mustache__WEBPACK_IMPORTED_MODULE_0__["render"](viewData, value.model)];
+ _b.sent();
+ return [3 /*break*/, 3];
+ case 2:
+ ex_7 = _b.sent();
+ return [2 /*return*/, this.onErrorOccured(ex_7)];
+ case 3:
+ this.response.setHeader("Allow", allowedMethods.join(","));
+ this.response.writeHead(HTTP_STATUS_CODE.Ok, (_a = {}, _a[__ContentType] = MIME_TYPE.Html, _a));
+ this.response.end("");
+ return [2 /*return*/];
}
});
});
};
- return MustacheViewEngine;
+ return RequestHandlerHelper;
}());
+// EXTERNAL MODULE: external "fs"
+var external_fs_ = __webpack_require__(3);
-/***/ }),
+// EXTERNAL MODULE: external "etag"
+var external_etag_ = __webpack_require__(6);
-/***/ "./src/generics/generic_controller.ts":
-/*!********************************************!*\
- !*** ./src/generics/generic_controller.ts ***!
- \********************************************/
-/*! exports provided: GenericController */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// EXTERNAL MODULE: external "fresh"
+var external_fresh_ = __webpack_require__(7);
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericController", function() { return GenericController; });
-/* harmony import */ var _abstracts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../abstracts */ "./src/abstracts/index.ts");
+// CONCATENATED MODULE: ./src/handlers/file_handler.ts
var __extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
@@ -1140,82 +1534,172 @@ var __extends = (undefined && undefined.__extends) || (function () {
};
})();
-var GenericController = /** @class */ (function (_super) {
- __extends(GenericController, _super);
- function GenericController() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return _super.call(this) || this;
- }
- return GenericController;
-}(_abstracts__WEBPACK_IMPORTED_MODULE_0__["Controller"]));
-/***/ }),
-/***/ "./src/generics/generic_guard.ts":
-/*!***************************************!*\
- !*** ./src/generics/generic_guard.ts ***!
- \***************************************/
-/*! exports provided: GenericGuard */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericGuard", function() { return GenericGuard; });
-/* harmony import */ var _abstracts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../abstracts */ "./src/abstracts/index.ts");
-var __extends = (undefined && undefined.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
+
+
+
+
+var file_handler_FileHandler = /** @class */ (function (_super) {
+ __extends(FileHandler, _super);
+ function FileHandler() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ FileHandler.prototype.getFileInfoFromUrl_ = function (urlPath) {
+ var splittedValue = urlPath.split("/");
+ var fileInfo = {
+ file: ""
+ };
+ if (splittedValue.length > 2 || !isNullOrEmpty(external_path_["parse"](urlPath).ext)) {
+ fileInfo.folder = splittedValue[1];
+ fileInfo.file = splittedValue.splice(2).join("/");
+ return fileInfo;
+ }
+ fileInfo.folder = splittedValue[1];
+ return fileInfo;
};
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ FileHandler.prototype.getFileStats_ = function (filePath) {
+ return promise(function (res, rej) {
+ external_fs_["lstat"](filePath, function (err, status) {
+ if (err) {
+ if (err.code === 'ENOENT') {
+ res(null);
+ }
+ else {
+ rej(err);
+ }
+ }
+ else {
+ res(status);
+ }
+ });
+ });
};
-})();
-
-var GenericGuard = /** @class */ (function (_super) {
- __extends(GenericGuard, _super);
- function GenericGuard() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
+ FileHandler.prototype.handleFileRequestFromAbsolutePath = function (absolutePath, fileType) {
+ var _this = this;
+ this.getFileStats_(absolutePath).then(function (fileInfo) {
+ if (fileInfo != null) {
+ if (fileInfo.isDirectory() === true) {
+ _this.handleFileRequestForPath_(absolutePath);
+ }
+ else {
+ _this.sendFile_(absolutePath, fileType, fileInfo);
+ }
+ }
+ else {
+ _this.onNotFound();
+ }
+ }).catch(function (ex) {
+ _this.onErrorOccured(ex);
+ });
+ };
+ FileHandler.prototype.checkForFolderAllowAndReturnPath_ = function (urlPath) {
+ var fileInfo = this.getFileInfoFromUrl_(urlPath);
+ var getAbsPath = function () {
+ var folder = Global.folders.find(function (qry) { return qry.alias === fileInfo.folder; });
+ if (folder != null) {
+ return external_path_["join"](folder.path, fileInfo.file);
+ }
+ return null;
+ };
+ var absPath = getAbsPath();
+ if (absPath == null) {
+ fileInfo.folder = "/";
+ fileInfo.file = urlPath;
+ absPath = getAbsPath();
}
- return _super.call(this) || this;
- }
- GenericGuard.prototype.check = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
+ return absPath;
+ };
+ FileHandler.prototype.handleFileRequest = function (urlPath) {
+ var extension = external_path_["parse"](urlPath).ext;
+ var absFilePath = this.checkForFolderAllowAndReturnPath_(urlPath);
+ if (absFilePath != null) {
+ this.handleFileRequestFromAbsolutePath(absFilePath, extension);
+ }
+ else {
+ this.onNotFound();
}
- return null;
};
- return GenericGuard;
-}(_abstracts__WEBPACK_IMPORTED_MODULE_0__["Guard"]));
-
-
-
-/***/ }),
+ /**
+ * process folders handling asuuming path is folder.
+ * Please check whether the file is folder before calling this function
+ *
+ * @private
+ * @param {string} filePath
+ * @param {Fs.Stats} fileInfo
+ * @returns
+ * @memberof FileHandler
+ */
+ FileHandler.prototype.handleFileRequestForPath_ = function (absolutePath) {
+ var _this = this;
+ absolutePath = external_path_["join"](absolutePath, "index.html");
+ this.getFileStats_(absolutePath).then(function (fileInfo) {
+ if (fileInfo != null) {
+ var fileType = MIME_TYPE.Html;
+ _this.sendFile_(absolutePath, fileType, fileInfo);
+ }
+ else {
+ _this.onNotFound();
+ }
+ }).catch(function (ex) {
+ _this.onErrorOccured(ex);
+ });
+ };
+ FileHandler.prototype.isClientHasFreshFile_ = function (lastModified, etagValue) {
+ return external_fresh_(this.request.headers, {
+ 'etag': etagValue,
+ 'last-modified': lastModified
+ });
+ };
+ FileHandler.prototype.sendFile_ = function (filePath, fileType, fileInfo) {
+ var _this = this;
+ this.runWallOutgoing().then(function () {
+ var _a;
+ var mimeType;
+ if (fileType[0] === '.') { // its extension
+ mimeType = getMimeTypeFromExtension(fileType);
+ }
+ else { // mime type
+ mimeType = fileType;
+ }
+ var negotiateMimeType = _this.getContentTypeFromNegotiation(mimeType);
+ if (negotiateMimeType != null) {
+ var lastModified = fileInfo.mtime.toUTCString();
+ var eTagValue = external_etag_(fileInfo, {
+ weak: Global.eTag.type === ETag_Type.Weak
+ });
+ if (_this.isClientHasFreshFile_(lastModified, eTagValue)) { // client has fresh file
+ _this.response.statusCode = HTTP_STATUS_CODE.NotModified;
+ _this.response.end();
+ }
+ else {
+ _this.response.writeHead(HTTP_STATUS_CODE.Ok, (_a = {},
+ _a[__ContentType] = mimeType,
+ _a['Etag'] = eTagValue,
+ _a['Last-Modified'] = lastModified,
+ _a));
+ var readStream = external_fs_["createReadStream"](filePath);
+ // Handle non-existent file
+ readStream.on('error', _this.onErrorOccured.bind(_this));
+ readStream.pipe(_this.response);
+ }
+ }
+ else {
+ _this.onNotAcceptableRequest();
+ }
+ }).catch(function (ex) {
+ _this.onErrorOccured(ex);
+ });
+ };
+ return FileHandler;
+}(request_handler_helper_RequestHandlerHelper));
-/***/ "./src/generics/generic_session_provider.ts":
-/*!**************************************************!*\
- !*** ./src/generics/generic_session_provider.ts ***!
- \**************************************************/
-/*! exports provided: GenericSessionProvider */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericSessionProvider", function() { return GenericSessionProvider; });
-/* harmony import */ var _abstracts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../abstracts */ "./src/abstracts/index.ts");
-var __extends = (undefined && undefined.__extends) || (function () {
+// CONCATENATED MODULE: ./src/handlers/controller_result_handler.ts
+var controller_result_handler_extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -1228,7 +1712,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+var controller_result_handler_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
@@ -1236,7 +1720,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
+var controller_result_handler_generator = (undefined && undefined.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
@@ -1264,103 +1748,141 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod
}
};
-var GenericSessionProvider = /** @class */ (function (_super) {
- __extends(GenericSessionProvider, _super);
- function GenericSessionProvider() {
+
+
+
+
+var controller_result_handler_ControllerResultHandler = /** @class */ (function (_super) {
+ controller_result_handler_extends(ControllerResultHandler, _super);
+ function ControllerResultHandler() {
return _super !== null && _super.apply(this, arguments) || this;
}
- GenericSessionProvider.prototype.get = function () {
- return null;
+ ControllerResultHandler.prototype.getDataBasedOnMimeType_ = function (mimeType) {
+ switch (mimeType) {
+ case MIME_TYPE.Json:
+ case MIME_TYPE.Text:
+ case MIME_TYPE.Html:
+ if (typeof this.controllerResult_.responseData === 'object') {
+ return JSON.stringify(this.controllerResult_.responseData);
+ }
+ break;
+ case MIME_TYPE.Xml:
+ if (typeof this.controllerResult_.responseData === 'object') {
+ return xml_helper_XmlHelper.fromJsToXml(this.controllerResult_.responseData);
+ }
+ break;
+ }
+ return this.controllerResult_.responseData;
};
- GenericSessionProvider.prototype.getAll = function () {
- return null;
+ ControllerResultHandler.prototype.endResponse_ = function (negotiateMimeType) {
+ var _a;
+ var data;
+ try {
+ data = this.getDataBasedOnMimeType_(negotiateMimeType);
+ }
+ catch (ex) {
+ this.onErrorOccured(ex);
+ return;
+ }
+ this.response.writeHead(this.controllerResult_.statusCode || HTTP_STATUS_CODE.Ok, (_a = {}, _a[__ContentType] = negotiateMimeType, _a));
+ this.response.end(data);
};
- GenericSessionProvider.prototype.set = function (key, value) {
- return null;
+ ControllerResultHandler.prototype.handleRedirectResult_ = function () {
+ this.response.setHeader('Location', this.controllerResult_.responseData);
+ this.response.writeHead(this.controllerResult_.statusCode || HTTP_STATUS_CODE.Ok, { 'Location': this.controllerResult_.responseData });
+ this.response.end();
};
- GenericSessionProvider.prototype.isExist = function (key) {
- return null;
+ ControllerResultHandler.prototype.handleFormatResult_ = function () {
+ var negotiateMimeType = this.getContentTypeFromNegotiationHavingMultipleTypes(Object.keys(this.controllerResult_.responseFormat));
+ var key = Object.keys(this.controllerResult_.responseFormat).find(function (qry) { return qry === negotiateMimeType; });
+ if (key != null) {
+ this.controllerResult_.responseData = this.controllerResult_.responseFormat[key]();
+ this.endResponse_(negotiateMimeType);
+ }
+ else {
+ this.onNotAcceptableRequest();
+ }
};
- GenericSessionProvider.prototype.remove = function (key) {
- return null;
+ ControllerResultHandler.prototype.handleFileResult_ = function () {
+ var result = this.controllerResult_;
+ var parsedPath = external_path_["parse"](result.file.filePath);
+ if (result.file.shouldDownload === true) {
+ var fileName = result.file.alias == null ? parsedPath.name : result.file.alias;
+ this.response.setHeader("Content-Disposition", "attachment;filename=" + fileName + parsedPath.ext);
+ }
+ this.handleFileRequestFromAbsolutePath(result.file.filePath, parsedPath.ext);
};
- GenericSessionProvider.prototype.setMany = function (values) {
- return null;
+ ControllerResultHandler.prototype.onTerminationFromWall = function (result) {
+ this.handleFinalResult_(result);
};
- GenericSessionProvider.prototype.clear = function () {
- return __awaiter(this, void 0, void 0, function () {
- return __generator(this, function (_a) {
- return [2 /*return*/];
- });
+ ControllerResultHandler.prototype.handleFinalResult_ = function (result) {
+ var _this = this;
+ result = result || textResult("");
+ this.controllerResult_ = result;
+ this.cookieManager.responseCookie_.forEach(function (value) {
+ _this.response.setHeader(__SetCookie, value);
});
- };
- return GenericSessionProvider;
-}(_abstracts__WEBPACK_IMPORTED_MODULE_0__["SessionProvider"]));
-
-
-
-/***/ }),
-
-/***/ "./src/generics/generic_shield.ts":
-/*!****************************************!*\
- !*** ./src/generics/generic_shield.ts ***!
- \****************************************/
-/*! exports provided: GenericShield */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericShield", function() { return GenericShield; });
-/* harmony import */ var _abstracts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../abstracts */ "./src/abstracts/index.ts");
-var __extends = (undefined && undefined.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
-})();
-
-var GenericShield = /** @class */ (function (_super) {
- __extends(GenericShield, _super);
- function GenericShield() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
+ if (result.shouldRedirect == null || result.shouldRedirect === false) {
+ if (result.responseFormat == null) {
+ if (result.file == null) {
+ var contentType = result.contentType || MIME_TYPE.Text;
+ var negotiateMimeType = this.getContentTypeFromNegotiation(contentType);
+ if (negotiateMimeType != null) {
+ this.endResponse_(negotiateMimeType);
+ }
+ else {
+ this.onNotAcceptableRequest();
+ }
+ }
+ else {
+ this.handleFileResult_();
+ }
+ }
+ else {
+ this.handleFormatResult_();
+ }
}
- return _super.call(this) || this;
- }
- GenericShield.prototype.protect = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
+ else {
+ this.handleRedirectResult_();
}
- return null;
};
- return GenericShield;
-}(_abstracts__WEBPACK_IMPORTED_MODULE_0__["Shield"]));
+ ControllerResultHandler.prototype.onResultFromController = function (result) {
+ return controller_result_handler_awaiter(this, void 0, void 0, function () {
+ var ex_1;
+ return controller_result_handler_generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ _a.trys.push([0, 2, , 3]);
+ return [4 /*yield*/, this.runWallOutgoing()];
+ case 1:
+ _a.sent();
+ return [3 /*break*/, 3];
+ case 2:
+ ex_1 = _a.sent();
+ this.onErrorOccured(ex_1);
+ return [2 /*return*/];
+ case 3:
+ this.handleFinalResult_(result);
+ return [2 /*return*/];
+ }
+ });
+ });
+ };
+ return ControllerResultHandler;
+}(file_handler_FileHandler));
+// EXTERNAL MODULE: external "content-type"
+var external_content_type_ = __webpack_require__(8);
-/***/ }),
+// EXTERNAL MODULE: external "querystring"
+var external_querystring_ = __webpack_require__(9);
-/***/ "./src/generics/generic_wall.ts":
-/*!**************************************!*\
- !*** ./src/generics/generic_wall.ts ***!
- \**************************************/
-/*! exports provided: GenericWall */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// EXTERNAL MODULE: external "multiparty"
+var external_multiparty_ = __webpack_require__(10);
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericWall", function() { return GenericWall; });
-/* harmony import */ var _abstracts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../abstracts */ "./src/abstracts/index.ts");
-var __extends = (undefined && undefined.__extends) || (function () {
+// CONCATENATED MODULE: ./src/handlers/post_handler.ts
+var post_handler_extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -1373,41 +1895,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
-
-var GenericWall = /** @class */ (function (_super) {
- __extends(GenericWall, _super);
- function GenericWall() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return _super.call(this) || this;
- }
- GenericWall.prototype.onIncoming = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return null;
- };
- return GenericWall;
-}(_abstracts__WEBPACK_IMPORTED_MODULE_0__["Wall"]));
-
-
-
-/***/ }),
-
-/***/ "./src/generics/generic_xml_parser.ts":
-/*!********************************************!*\
- !*** ./src/generics/generic_xml_parser.ts ***!
- \********************************************/
-/*! exports provided: GenericXmlParser */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "GenericXmlParser", function() { return GenericXmlParser; });
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+var post_handler_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
@@ -1415,7 +1903,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
+var post_handler_generator = (undefined && undefined.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
@@ -1442,52 +1930,6 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
-var GenericXmlParser = /** @class */ (function () {
- function GenericXmlParser() {
- }
- GenericXmlParser.prototype.parse = function (xml) {
- return __awaiter(this, void 0, void 0, function () {
- return __generator(this, function (_a) {
- // tslint:disable-next-line
- throw {
- message: "no xml parser configured"
- };
- });
- });
- };
- return GenericXmlParser;
-}());
-
-
-
-/***/ }),
-
-/***/ "./src/generics/index.ts":
-/*!*******************************!*\
- !*** ./src/generics/index.ts ***!
- \*******************************/
-/*! exports provided: GenericGuard, GenericShield, GenericSessionProvider, GenericWall, GenericController, GenericXmlParser */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _generic_guard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./generic_guard */ "./src/generics/generic_guard.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GenericGuard", function() { return _generic_guard__WEBPACK_IMPORTED_MODULE_0__["GenericGuard"]; });
-
-/* harmony import */ var _generic_shield__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./generic_shield */ "./src/generics/generic_shield.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GenericShield", function() { return _generic_shield__WEBPACK_IMPORTED_MODULE_1__["GenericShield"]; });
-
-/* harmony import */ var _generic_session_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./generic_session_provider */ "./src/generics/generic_session_provider.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GenericSessionProvider", function() { return _generic_session_provider__WEBPACK_IMPORTED_MODULE_2__["GenericSessionProvider"]; });
-
-/* harmony import */ var _generic_wall__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./generic_wall */ "./src/generics/generic_wall.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GenericWall", function() { return _generic_wall__WEBPACK_IMPORTED_MODULE_3__["GenericWall"]; });
-
-/* harmony import */ var _generic_controller__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./generic_controller */ "./src/generics/generic_controller.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GenericController", function() { return _generic_controller__WEBPACK_IMPORTED_MODULE_4__["GenericController"]; });
-
-/* harmony import */ var _generic_xml_parser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./generic_xml_parser */ "./src/generics/generic_xml_parser.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "GenericXmlParser", function() { return _generic_xml_parser__WEBPACK_IMPORTED_MODULE_5__["GenericXmlParser"]; });
@@ -1497,46 +1939,99 @@ __webpack_require__.r(__webpack_exports__);
-/***/ }),
-
-/***/ "./src/global.ts":
-/*!***********************!*\
- !*** ./src/global.ts ***!
- \***********************/
-/*! exports provided: Global */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Global", function() { return Global; });
-var Global = /** @class */ (function () {
- function Global() {
+var post_handler_PostHandler = /** @class */ (function (_super) {
+ post_handler_extends(PostHandler, _super);
+ function PostHandler() {
+ return _super !== null && _super.apply(this, arguments) || this;
}
- Global.walls = [];
- return Global;
-}());
-
-
-
-/***/ }),
+ PostHandler.prototype.getPostRawData_ = function () {
+ var _this = this;
+ var body = [];
+ return promise(function (res, rej) {
+ _this.request.on('data', function (chunk) {
+ body.push(chunk);
+ }).on('end', function () {
+ var bodyBuffer = Buffer.concat(body);
+ res(bodyBuffer.toString());
+ }).on("error", function (err) {
+ rej(err);
+ });
+ });
+ };
+ PostHandler.prototype.parseMultiPartData_ = function () {
+ var _this = this;
+ return promise(function (res, rej) {
+ new external_multiparty_["Form"]().parse(_this.request, function (err, fields, files) {
+ if (err) {
+ rej(err);
+ }
+ else {
+ var result = {
+ field: {},
+ file: {}
+ };
+ for (var field in fields) {
+ result.field[field] = fields[field].length === 1 ? fields[field][0] : fields[field];
+ }
+ for (var file in files) {
+ result.file[file] = files[file].length === 1 ? files[file][0] : files[file];
+ }
+ res(result);
+ }
+ });
+ });
+ };
+ PostHandler.prototype.parsePostData = function () {
+ return post_handler_awaiter(this, void 0, void 0, function () {
+ var postData, contentType, result, bodyDataAsString;
+ return post_handler_generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ contentType = this.request.headers[__ContentType] || this.request.headers["content-type"];
+ if (contentType != null) {
+ contentType = external_content_type_["parse"](contentType).type;
+ }
+ if (!(contentType === MIME_TYPE.FormMultiPart)) return [3 /*break*/, 2];
+ return [4 /*yield*/, this.parseMultiPartData_()];
+ case 1:
+ result = _a.sent();
+ postData = result.field;
+ this.file = new file_manager_FileManager(result.file);
+ return [3 /*break*/, 4];
+ case 2:
+ this.file = new file_manager_FileManager({});
+ return [4 /*yield*/, this.getPostRawData_()];
+ case 3:
+ bodyDataAsString = _a.sent();
+ switch (contentType) {
+ case MIME_TYPE.Json:
+ postData = JsonHelper.parse(bodyDataAsString);
+ break;
+ case MIME_TYPE.Text:
+ case MIME_TYPE.Html:
+ postData = bodyDataAsString;
+ break;
+ case MIME_TYPE.FormUrlEncoded:
+ postData = external_querystring_["parse"](bodyDataAsString);
+ break;
+ case MIME_TYPE.Xml:
+ postData = new Global.xmlParser().parse(bodyDataAsString);
+ break;
+ default:
+ postData = {};
+ }
+ _a.label = 4;
+ case 4: return [2 /*return*/, postData];
+ }
+ });
+ });
+ };
+ return PostHandler;
+}(controller_result_handler_ControllerResultHandler));
-/***/ "./src/handlers/controller_result_handler.ts":
-/*!***************************************************!*\
- !*** ./src/handlers/controller_result_handler.ts ***!
- \***************************************************/
-/*! exports provided: ControllerResultHandler */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ControllerResultHandler", function() { return ControllerResultHandler; });
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _file_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./file_handler */ "./src/handlers/file_handler.ts");
-/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! path */ "path");
-/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers */ "./src/helpers/index.ts");
-var __extends = (undefined && undefined.__extends) || (function () {
+// CONCATENATED MODULE: ./src/handlers/request_handler.ts
+var request_handler_extends = (undefined && undefined.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -1549,7 +2044,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+var request_handler_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
@@ -1557,7 +2052,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
+var request_handler_generator = (undefined && undefined.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
@@ -1589,1011 +2084,311 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod
-var ControllerResultHandler = /** @class */ (function (_super) {
- __extends(ControllerResultHandler, _super);
- function ControllerResultHandler() {
- return _super !== null && _super.apply(this, arguments) || this;
+
+
+
+var request_handler_RequestHandler = /** @class */ (function (_super) {
+ request_handler_extends(RequestHandler, _super);
+ function RequestHandler(request, response) {
+ var _this = _super.call(this) || this;
+ _this.data_ = {};
+ _this.request = request;
+ _this.response = response;
+ _this.registerEvents_();
+ return _this;
}
- ControllerResultHandler.prototype.getDataBasedOnMimeType_ = function (mimeType) {
- switch (mimeType) {
- case _enums__WEBPACK_IMPORTED_MODULE_1__["MIME_TYPE"].Json:
- case _enums__WEBPACK_IMPORTED_MODULE_1__["MIME_TYPE"].Text:
- case _enums__WEBPACK_IMPORTED_MODULE_1__["MIME_TYPE"].Html:
- if (typeof this.controllerResult_.responseData === 'object') {
- return JSON.stringify(this.controllerResult_.responseData);
- }
- break;
- case _enums__WEBPACK_IMPORTED_MODULE_1__["MIME_TYPE"].Xml:
- if (typeof this.controllerResult_.responseData === 'object') {
- return _helpers__WEBPACK_IMPORTED_MODULE_4__["XmlHelper"].fromJsToXml(this.controllerResult_.responseData);
- }
- break;
- }
- return this.controllerResult_.responseData;
- };
- ControllerResultHandler.prototype.endResponse_ = function (negotiateMimeType) {
- var _a;
- var data;
- try {
- data = this.getDataBasedOnMimeType_(negotiateMimeType);
- }
- catch (ex) {
- this.onErrorOccured(ex);
- return;
- }
- this.response.writeHead(this.controllerResult_.statusCode || _enums__WEBPACK_IMPORTED_MODULE_1__["HTTP_STATUS_CODE"].Ok, (_a = {}, _a[_constant__WEBPACK_IMPORTED_MODULE_0__["__ContentType"]] = negotiateMimeType, _a));
- this.response.end(data);
+ RequestHandler.prototype.registerEvents_ = function () {
+ this.request.on('error', this.onBadRequest.bind(this));
+ this.response.on('error', this.onErrorOccured.bind(this));
};
- ControllerResultHandler.prototype.handleRedirectResult_ = function () {
- this.response.setHeader('Location', this.controllerResult_.responseData);
- this.response.writeHead(this.controllerResult_.statusCode || _enums__WEBPACK_IMPORTED_MODULE_1__["HTTP_STATUS_CODE"].Ok, { 'Location': this.controllerResult_.responseData });
- this.response.end();
- };
- ControllerResultHandler.prototype.handleFormatResult_ = function () {
- var negotiateMimeType = this.getContentTypeFromNegotiationHavingMultipleTypes(Object.keys(this.controllerResult_.responseFormat));
- var key = Object.keys(this.controllerResult_.responseFormat).find(function (qry) { return qry === negotiateMimeType; });
- if (key != null) {
- this.controllerResult_.responseData = this.controllerResult_.responseFormat[key]();
- this.endResponse_(negotiateMimeType);
- }
- else {
- this.onNotAcceptableRequest();
- }
- };
- ControllerResultHandler.prototype.handleFileResult_ = function () {
- var result = this.controllerResult_;
- var parsedPath = path__WEBPACK_IMPORTED_MODULE_3__["parse"](result.file.filePath);
- if (result.file.shouldDownload === true) {
- var fileName = result.file.alias == null ? parsedPath.name : result.file.alias;
- this.response.setHeader("Content-Disposition", "attachment;filename=" + fileName + parsedPath.ext);
- }
- this.handleFileRequestFromAbsolutePath(result.file.filePath, parsedPath.ext);
+ RequestHandler.prototype.executeWallIncoming_ = function () {
+ var _this = this;
+ return promise(function (res) {
+ var index = 0;
+ var wallLength = Global.walls.length;
+ var executeWallIncomingByIndex = function () { return request_handler_awaiter(_this, void 0, void 0, function () {
+ var wall, constructorArgsValues, wallObj, methodArgsValues, result, ex_1;
+ return request_handler_generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ if (!(wallLength > index)) return [3 /*break*/, 5];
+ wall = Global.walls[index++];
+ constructorArgsValues = injector_handler_InjectorHandler.getConstructorValues(wall.name);
+ wallObj = new (wall.bind.apply(wall, [void 0].concat(constructorArgsValues)))();
+ wallObj.cookie = this.cookieManager;
+ wallObj.session = this.session_;
+ wallObj.request = this.request;
+ wallObj.response = this.response;
+ wallObj.data = this.data_;
+ wallObj.query = this.query_;
+ this.wallInstances.push(wallObj);
+ methodArgsValues = injector_handler_InjectorHandler.getMethodValues(wall.name, 'onIncoming');
+ _a.label = 1;
+ case 1:
+ _a.trys.push([1, 3, , 4]);
+ return [4 /*yield*/, wallObj.onIncoming.apply(wallObj, methodArgsValues)];
+ case 2:
+ result = _a.sent();
+ if (result == null) {
+ executeWallIncomingByIndex();
+ }
+ else {
+ res(false);
+ this.onTerminationFromWall(result);
+ }
+ return [3 /*break*/, 4];
+ case 3:
+ ex_1 = _a.sent();
+ this.onErrorOccured(ex_1);
+ res(false);
+ return [3 /*break*/, 4];
+ case 4: return [3 /*break*/, 6];
+ case 5:
+ res(true);
+ _a.label = 6;
+ case 6: return [2 /*return*/];
+ }
+ });
+ }); };
+ executeWallIncomingByIndex();
+ });
};
- ControllerResultHandler.prototype.onTerminationFromWall = function (result) {
- this.handleFinalResult_(result);
+ RequestHandler.prototype.runController_ = function () {
+ var _a;
+ var constructorValues = injector_handler_InjectorHandler.getConstructorValues(this.routeMatchInfo_.controller.name);
+ var controllerObj = new ((_a = this.routeMatchInfo_.controller).bind.apply(_a, [void 0].concat(constructorValues)))();
+ controllerObj.request = this.request;
+ controllerObj.response = this.response;
+ controllerObj.query = this.query_;
+ controllerObj.body = this.body;
+ controllerObj.session = this.session_;
+ controllerObj.cookie = this.cookieManager;
+ controllerObj.param = this.routeMatchInfo_.params;
+ controllerObj.data = this.data_;
+ controllerObj.file = this.file;
+ var methodArgsValues = injector_handler_InjectorHandler.getMethodValues(this.routeMatchInfo_.controller.name, this.routeMatchInfo_.workerInfo.workerName);
+ controllerObj[this.routeMatchInfo_.workerInfo.workerName].apply(controllerObj, methodArgsValues).then(this.onResultFromController.bind(this)).catch(this.onErrorOccured.bind(this));
};
- ControllerResultHandler.prototype.handleFinalResult_ = function (result) {
+ RequestHandler.prototype.executeShieldsProtection_ = function () {
var _this = this;
- result = result || Object(_helpers__WEBPACK_IMPORTED_MODULE_4__["textResult"])("");
- this.controllerResult_ = result;
- this.cookieManager.responseCookie_.forEach(function (value) {
- _this.response.setHeader(_constant__WEBPACK_IMPORTED_MODULE_0__["__SetCookie"], value);
- });
- if (result.shouldRedirect == null || result.shouldRedirect === false) {
- if (result.responseFormat == null) {
- if (result.file == null) {
- var contentType = result.contentType || _enums__WEBPACK_IMPORTED_MODULE_1__["MIME_TYPE"].Text;
- var negotiateMimeType = this.getContentTypeFromNegotiation(contentType);
- if (negotiateMimeType != null) {
- this.endResponse_(negotiateMimeType);
+ return promise(function (res) {
+ var index = 0;
+ var shieldLength = _this.routeMatchInfo_.shields.length;
+ var executeShieldByIndex = function () { return request_handler_awaiter(_this, void 0, void 0, function () {
+ var shield, constructorArgsValues, shieldObj, methodArgsValues, result, ex_2;
+ return request_handler_generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ if (!(shieldLength > index)) return [3 /*break*/, 5];
+ shield = this.routeMatchInfo_.shields[index++];
+ constructorArgsValues = injector_handler_InjectorHandler.getConstructorValues(shield.name);
+ shieldObj = new (shield.bind.apply(shield, [void 0].concat(constructorArgsValues)))();
+ shieldObj.cookie = this.cookieManager;
+ shieldObj.query = this.query_;
+ shieldObj.session = this.session_;
+ shieldObj.request = this.request;
+ shieldObj.response = this.response;
+ shieldObj.data = this.data_;
+ shieldObj.workerName = this.routeMatchInfo_.workerInfo.workerName;
+ methodArgsValues = injector_handler_InjectorHandler.getMethodValues(shield.name, 'protect');
+ _a.label = 1;
+ case 1:
+ _a.trys.push([1, 3, , 4]);
+ return [4 /*yield*/, shieldObj.protect.apply(shieldObj, methodArgsValues)];
+ case 2:
+ result = _a.sent();
+ if (result == null) {
+ executeShieldByIndex();
+ }
+ else {
+ res(false);
+ this.onResultFromController(result);
+ }
+ return [3 /*break*/, 4];
+ case 3:
+ ex_2 = _a.sent();
+ this.onErrorOccured(ex_2);
+ res(false);
+ return [3 /*break*/, 4];
+ case 4: return [3 /*break*/, 6];
+ case 5:
+ res(true);
+ _a.label = 6;
+ case 6: return [2 /*return*/];
}
- else {
- this.onNotAcceptableRequest();
+ });
+ }); };
+ executeShieldByIndex();
+ });
+ };
+ RequestHandler.prototype.executeGuardsCheck_ = function (guards) {
+ var _this = this;
+ return promise(function (res) {
+ var index = 0;
+ var shieldLength = guards.length;
+ var executeGuardByIndex = function () { return request_handler_awaiter(_this, void 0, void 0, function () {
+ var guard, constructorArgsValues, guardObj, methodArgsValues, result, ex_3;
+ return request_handler_generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ if (!(shieldLength > index)) return [3 /*break*/, 5];
+ guard = guards[index++];
+ constructorArgsValues = injector_handler_InjectorHandler.getConstructorValues(guard.name);
+ guardObj = new (guard.bind.apply(guard, [void 0].concat(constructorArgsValues)))();
+ guardObj.body = this.body;
+ guardObj.cookie = this.cookieManager;
+ guardObj.query = this.query_;
+ guardObj.session = this.session_;
+ guardObj.request = this.request;
+ guardObj.response = this.response;
+ guardObj.data = this.data_;
+ guardObj.file = this.file;
+ guardObj.param = this.routeMatchInfo_.params;
+ methodArgsValues = injector_handler_InjectorHandler.getMethodValues(guard.name, 'check');
+ _a.label = 1;
+ case 1:
+ _a.trys.push([1, 3, , 4]);
+ return [4 /*yield*/, guardObj.check.apply(guardObj, methodArgsValues)];
+ case 2:
+ result = _a.sent();
+ if (result == null) {
+ executeGuardByIndex();
+ }
+ else {
+ res(false);
+ this.onResultFromController(result);
+ }
+ return [3 /*break*/, 4];
+ case 3:
+ ex_3 = _a.sent();
+ this.onErrorOccured(ex_3);
+ res(false);
+ return [3 /*break*/, 4];
+ case 4: return [3 /*break*/, 6];
+ case 5:
+ res(true);
+ _a.label = 6;
+ case 6: return [2 /*return*/];
}
- }
- else {
- this.handleFileResult_();
- }
+ });
+ }); };
+ executeGuardByIndex();
+ });
+ };
+ RequestHandler.prototype.parseCookieFromRequest_ = function () {
+ if (Global.shouldParseCookie === true) {
+ var rawCookie = (this.request.headers[__Cookie] || this.request.headers["cookie"]);
+ var parsedCookies = void 0;
+ try {
+ parsedCookies = parseCookie(rawCookie);
}
- else {
- this.handleFormatResult_();
+ catch (ex) {
+ this.onErrorOccured(ex);
+ return false;
}
+ this.session_ = new Global.sessionProvider();
+ this.session_.cookie = this.cookieManager = new CookieManager(parsedCookies);
+ this.session_.sessionId = parsedCookies[Global.appSessionIdentifier];
}
else {
- this.handleRedirectResult_();
+ this.cookieManager = new CookieManager({});
}
+ return true;
};
- ControllerResultHandler.prototype.onResultFromController = function (result) {
- return __awaiter(this, void 0, void 0, function () {
- var ex_1;
- return __generator(this, function (_a) {
+ RequestHandler.prototype.setPreHeader_ = function () {
+ this.response.setHeader('X-Powered-By', Global.appName);
+ this.response.setHeader('Vary', 'Accept-Encoding');
+ this.response.sendDate = true;
+ };
+ RequestHandler.prototype.onRouteMatched_ = function () {
+ return request_handler_awaiter(this, void 0, void 0, function () {
+ var actionInfo, shouldExecuteNextComponent;
+ return request_handler_generator(this, function (_a) {
switch (_a.label) {
case 0:
- _a.trys.push([0, 2, , 3]);
- return [4 /*yield*/, this.runWallOutgoing()];
- case 1:
- _a.sent();
- return [3 /*break*/, 3];
+ actionInfo = this.routeMatchInfo_.workerInfo;
+ if (!(actionInfo == null)) return [3 /*break*/, 1];
+ if (this.request.method === HTTP_METHOD.Options) {
+ this.onRequestOptions(this.routeMatchInfo_.allowedHttpMethod);
+ }
+ else {
+ this.onMethodNotAllowed(this.routeMatchInfo_.allowedHttpMethod);
+ }
+ return [3 /*break*/, 5];
+ case 1: return [4 /*yield*/, this.executeShieldsProtection_()];
case 2:
- ex_1 = _a.sent();
- this.onErrorOccured(ex_1);
- return [2 /*return*/];
+ shouldExecuteNextComponent = _a.sent();
+ if (!(shouldExecuteNextComponent === true)) return [3 /*break*/, 5];
+ return [4 /*yield*/, this.handlePostData()];
case 3:
- this.handleFinalResult_(result);
- return [2 /*return*/];
+ shouldExecuteNextComponent = _a.sent();
+ if (!(shouldExecuteNextComponent === true)) return [3 /*break*/, 5];
+ return [4 /*yield*/, this.executeGuardsCheck_(actionInfo.guards)];
+ case 4:
+ shouldExecuteNextComponent = _a.sent();
+ if (shouldExecuteNextComponent === true) {
+ this.runController_();
+ }
+ _a.label = 5;
+ case 5: return [2 /*return*/];
}
});
});
};
- return ControllerResultHandler;
-}(_file_handler__WEBPACK_IMPORTED_MODULE_2__["FileHandler"]));
-
-
-
-/***/ }),
-
-/***/ "./src/handlers/file_handler.ts":
-/*!**************************************!*\
- !*** ./src/handlers/file_handler.ts ***!
- \**************************************/
-/*! exports provided: FileHandler */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileHandler", function() { return FileHandler; });
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../global */ "./src/global.ts");
-/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! path */ "path");
-/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
-/* harmony import */ var _request_handler_helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./request_handler_helper */ "./src/handlers/request_handler_helper.ts");
-/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! fs */ "fs");
-/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../helpers */ "./src/helpers/index.ts");
-/* harmony import */ var etag__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! etag */ "etag");
-/* harmony import */ var etag__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(etag__WEBPACK_IMPORTED_MODULE_7__);
-/* harmony import */ var fresh__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! fresh */ "fresh");
-/* harmony import */ var fresh__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(fresh__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils */ "./src/utils/index.ts");
-var __extends = (undefined && undefined.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
-})();
-
-
-
-
-
-
-
-
-
-
-var FileHandler = /** @class */ (function (_super) {
- __extends(FileHandler, _super);
- function FileHandler() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- FileHandler.prototype.getFileInfoFromUrl_ = function (urlPath) {
- var splittedValue = urlPath.split("/");
- var fileInfo = {
- file: ""
- };
- if (splittedValue.length > 2 || !Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNullOrEmpty"])(path__WEBPACK_IMPORTED_MODULE_2__["parse"](urlPath).ext)) {
- fileInfo.folder = splittedValue[1];
- fileInfo.file = splittedValue.splice(2).join("/");
- return fileInfo;
- }
- fileInfo.folder = splittedValue[1];
- return fileInfo;
- };
- FileHandler.prototype.getFileStats_ = function (filePath) {
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_6__["promise"])(function (res, rej) {
- fs__WEBPACK_IMPORTED_MODULE_5__["lstat"](filePath, function (err, status) {
- if (err) {
- if (err.code === 'ENOENT') {
- res(null);
- }
- else {
- rej(err);
- }
- }
- else {
- res(status);
+ RequestHandler.prototype.execute_ = function () {
+ return request_handler_awaiter(this, void 0, void 0, function () {
+ var urlDetail, shouldExecuteNextProcess, pathUrl, requestMethod;
+ return request_handler_generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ urlDetail = external_url_["parse"](this.request.url, true);
+ this.query_ = urlDetail.query;
+ shouldExecuteNextProcess = this.parseCookieFromRequest_();
+ if (!(shouldExecuteNextProcess === true)) return [3 /*break*/, 2];
+ return [4 /*yield*/, this.executeWallIncoming_()];
+ case 1:
+ shouldExecuteNextProcess = _a.sent();
+ if (shouldExecuteNextProcess === true) {
+ pathUrl = urlDetail.pathname;
+ requestMethod = this.request.method;
+ try {
+ this.routeMatchInfo_ = parseAndMatchRoute(pathUrl.toLowerCase(), requestMethod);
+ }
+ catch (ex) {
+ this.onErrorOccured(ex);
+ return [2 /*return*/];
+ }
+ if (this.routeMatchInfo_ == null) { // no route matched
+ // it may be a file or folder then
+ this.handleFileRequest(pathUrl);
+ }
+ else {
+ this.onRouteMatched_();
+ }
+ }
+ _a.label = 2;
+ case 2: return [2 /*return*/];
}
});
});
};
- FileHandler.prototype.handleFileRequestFromAbsolutePath = function (absolutePath, fileType) {
- var _this = this;
- this.getFileStats_(absolutePath).then(function (fileInfo) {
- if (fileInfo != null) {
- if (fileInfo.isDirectory() === true) {
- _this.handleFileRequestForPath_(absolutePath);
- }
- else {
- _this.sendFile_(absolutePath, fileType, fileInfo);
- }
- }
- else {
- _this.onNotFound();
- }
- }).catch(function (ex) {
- _this.onErrorOccured(ex);
- });
- };
- FileHandler.prototype.checkForFolderAllowAndReturnPath_ = function (urlPath) {
- var fileInfo = this.getFileInfoFromUrl_(urlPath);
- var getAbsPath = function () {
- var folder = _global__WEBPACK_IMPORTED_MODULE_1__["Global"].folders.find(function (qry) { return qry.alias === fileInfo.folder; });
- if (folder != null) {
- return path__WEBPACK_IMPORTED_MODULE_2__["join"](folder.path, fileInfo.file);
- }
- return null;
- };
- var absPath = getAbsPath();
- if (absPath == null) {
- fileInfo.folder = "/";
- fileInfo.file = urlPath;
- absPath = getAbsPath();
- }
- return absPath;
- };
- FileHandler.prototype.handleFileRequest = function (urlPath) {
- var extension = path__WEBPACK_IMPORTED_MODULE_2__["parse"](urlPath).ext;
- var absFilePath = this.checkForFolderAllowAndReturnPath_(urlPath);
- if (absFilePath != null) {
- this.handleFileRequestFromAbsolutePath(absFilePath, extension);
- }
- else {
- this.onNotFound();
- }
- };
- /**
- * process folders handling asuuming path is folder.
- * Please check whether the file is folder before calling this function
- *
- * @private
- * @param {string} filePath
- * @param {Fs.Stats} fileInfo
- * @returns
- * @memberof FileHandler
- */
- FileHandler.prototype.handleFileRequestForPath_ = function (absolutePath) {
- var _this = this;
- absolutePath = path__WEBPACK_IMPORTED_MODULE_2__["join"](absolutePath, "index.html");
- this.getFileStats_(absolutePath).then(function (fileInfo) {
- if (fileInfo != null) {
- var fileType = _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html;
- _this.sendFile_(absolutePath, fileType, fileInfo);
- }
- else {
- _this.onNotFound();
- }
- }).catch(function (ex) {
- _this.onErrorOccured(ex);
- });
- };
- FileHandler.prototype.isClientHasFreshFile_ = function (lastModified, etagValue) {
- return fresh__WEBPACK_IMPORTED_MODULE_8__(this.request.headers, {
- 'etag': etagValue,
- 'last-modified': lastModified
- });
- };
- FileHandler.prototype.sendFile_ = function (filePath, fileType, fileInfo) {
- var _this = this;
- this.runWallOutgoing().then(function () {
- var _a;
- var mimeType;
- if (fileType[0] === '.') { // its extension
- mimeType = Object(_helpers__WEBPACK_IMPORTED_MODULE_6__["getMimeTypeFromExtension"])(fileType);
- }
- else { // mime type
- mimeType = fileType;
- }
- var negotiateMimeType = _this.getContentTypeFromNegotiation(mimeType);
- if (negotiateMimeType != null) {
- var lastModified = fileInfo.mtime.toUTCString();
- var eTagValue = etag__WEBPACK_IMPORTED_MODULE_7__(fileInfo, {
- weak: _global__WEBPACK_IMPORTED_MODULE_1__["Global"].eTag.type === _enums__WEBPACK_IMPORTED_MODULE_0__["ETag_Type"].Weak
- });
- if (_this.isClientHasFreshFile_(lastModified, eTagValue)) { // client has fresh file
- _this.response.statusCode = _enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].NotModified;
- _this.response.end();
- }
- else {
- _this.response.writeHead(_enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].Ok, (_a = {},
- _a[_constant__WEBPACK_IMPORTED_MODULE_3__["__ContentType"]] = mimeType,
- _a['Etag'] = eTagValue,
- _a['Last-Modified'] = lastModified,
- _a));
- var readStream = fs__WEBPACK_IMPORTED_MODULE_5__["createReadStream"](filePath);
- // Handle non-existent file
- readStream.on('error', _this.onErrorOccured.bind(_this));
- readStream.pipe(_this.response);
- }
- }
- else {
- _this.onNotAcceptableRequest();
- }
- }).catch(function (ex) {
- _this.onErrorOccured(ex);
- });
- };
- return FileHandler;
-}(_request_handler_helper__WEBPACK_IMPORTED_MODULE_4__["RequestHandlerHelper"]));
-
-
-
-/***/ }),
-
-/***/ "./src/handlers/index.ts":
-/*!*******************************!*\
- !*** ./src/handlers/index.ts ***!
- \*******************************/
-/*! exports provided: RouteHandler, RequestHandler, FileHandler, RequestHandlerHelper, ControllerResultHandler, PostHandler, InjectorHandler */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _route_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./route_handler */ "./src/handlers/route_handler.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RouteHandler", function() { return _route_handler__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"]; });
-
-/* harmony import */ var _request_handler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./request_handler */ "./src/handlers/request_handler.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RequestHandler", function() { return _request_handler__WEBPACK_IMPORTED_MODULE_1__["RequestHandler"]; });
-
-/* harmony import */ var _file_handler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./file_handler */ "./src/handlers/file_handler.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileHandler", function() { return _file_handler__WEBPACK_IMPORTED_MODULE_2__["FileHandler"]; });
-
-/* harmony import */ var _request_handler_helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./request_handler_helper */ "./src/handlers/request_handler_helper.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "RequestHandlerHelper", function() { return _request_handler_helper__WEBPACK_IMPORTED_MODULE_3__["RequestHandlerHelper"]; });
-
-/* harmony import */ var _controller_result_handler__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./controller_result_handler */ "./src/handlers/controller_result_handler.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ControllerResultHandler", function() { return _controller_result_handler__WEBPACK_IMPORTED_MODULE_4__["ControllerResultHandler"]; });
-
-/* harmony import */ var _post_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./post_handler */ "./src/handlers/post_handler.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PostHandler", function() { return _post_handler__WEBPACK_IMPORTED_MODULE_5__["PostHandler"]; });
-
-/* harmony import */ var _injector_handler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./injector_handler */ "./src/handlers/injector_handler.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "InjectorHandler", function() { return _injector_handler__WEBPACK_IMPORTED_MODULE_6__["InjectorHandler"]; });
-
-
-
-
-
-
-
-
-
-
-/***/ }),
-
-/***/ "./src/handlers/injector_handler.ts":
-/*!******************************************!*\
- !*** ./src/handlers/injector_handler.ts ***!
- \******************************************/
-/*! exports provided: InjectorHandler */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "InjectorHandler", function() { return InjectorHandler; });
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
-
-// this stores information of injector values that are available per class & worker
-var injectorStoreInfos = [];
-// this stores injector values
-var injectorValues = [];
-// this stores the singletons name & their respective index in injector values
-var singletons = {};
-var InjectorHandler = /** @class */ (function () {
- function InjectorHandler() {
- }
- InjectorHandler.addWorkerValue = function (className, methodName, paramIndex, paramValue, shouldFindIndex) {
- var _a;
- if (shouldFindIndex === void 0) { shouldFindIndex = true; }
- if (shouldFindIndex === true) {
- var paramValueIndex = injectorValues.indexOf(paramValue);
- if (paramValueIndex < 0) {
- paramValue = injectorValues.push(paramValue) - 1;
- }
- else {
- paramValue = paramValueIndex;
- }
- }
- var savedValue = injectorStoreInfos.find(function (x) { return x.className === className; });
- var value = {
- className: className,
- methods: (_a = {},
- _a[methodName] = [],
- _a)
- };
- if (savedValue == null) {
- value.methods[methodName][paramIndex] = paramValue;
- injectorStoreInfos.push(value);
- }
- else {
- // const savedMethod = savedValue.methods[methodName];
- if (savedValue.methods[methodName] == null) {
- savedValue.methods[methodName] = [];
- }
- savedValue.methods[methodName][paramIndex] = paramValue;
- }
- return paramValue;
- };
- InjectorHandler.getConstructorValues = function (className) {
- return this.getMethodValues(className, _constant__WEBPACK_IMPORTED_MODULE_0__["__Constructor"]);
- };
- InjectorHandler.getMethodValues = function (className, methodName) {
- var savedValue = injectorStoreInfos.find(function (qry) { return qry.className === className; });
- if (savedValue != null) {
- var methodArgs = savedValue.methods[methodName];
- if (methodArgs != null) {
- return methodArgs.map(function (injectorValueIndex) {
- return injectorValues[injectorValueIndex];
- });
- }
- }
- return [];
- };
- InjectorHandler.addSingleton = function (className, methodName, paramIndex, paramValue) {
- var singletonClassName = paramValue.name;
- if (singletonClassName) {
- if (singletons[singletonClassName] == null) {
- singletons[singletonClassName] = InjectorHandler.addWorkerValue(className, methodName, paramIndex, new paramValue());
- }
- else {
- InjectorHandler.addWorkerValue(className, methodName, paramIndex, singletons[singletonClassName], false);
- }
- }
- };
- return InjectorHandler;
-}());
-
-
-
-/***/ }),
-
-/***/ "./src/handlers/post_handler.ts":
-/*!**************************************!*\
- !*** ./src/handlers/post_handler.ts ***!
- \**************************************/
-/*! exports provided: PostHandler */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PostHandler", function() { return PostHandler; });
-/* harmony import */ var _controller_result_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./controller_result_handler */ "./src/handlers/controller_result_handler.ts");
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers */ "./src/helpers/index.ts");
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var content_type__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! content-type */ "content-type");
-/* harmony import */ var content_type__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(content_type__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! querystring */ "querystring");
-/* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(querystring__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var multiparty__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! multiparty */ "multiparty");
-/* harmony import */ var multiparty__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(multiparty__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../models */ "./src/models/index.ts");
-/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../global */ "./src/global.ts");
-var __extends = (undefined && undefined.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
-})();
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
-};
-
-
-
-
-
-
-
-
-
-var PostHandler = /** @class */ (function (_super) {
- __extends(PostHandler, _super);
- function PostHandler() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- PostHandler.prototype.getPostRawData_ = function () {
- var _this = this;
- var body = [];
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_1__["promise"])(function (res, rej) {
- _this.request.on('data', function (chunk) {
- body.push(chunk);
- }).on('end', function () {
- var bodyBuffer = Buffer.concat(body);
- res(bodyBuffer.toString());
- }).on("error", function (err) {
- rej(err);
- });
- });
- };
- PostHandler.prototype.parseMultiPartData_ = function () {
- var _this = this;
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_1__["promise"])(function (res, rej) {
- new multiparty__WEBPACK_IMPORTED_MODULE_6__["Form"]().parse(_this.request, function (err, fields, files) {
- if (err) {
- rej(err);
- }
- else {
- var result = {
- field: {},
- file: {}
- };
- for (var field in fields) {
- result.field[field] = fields[field].length === 1 ? fields[field][0] : fields[field];
- }
- for (var file in files) {
- result.file[file] = files[file].length === 1 ? files[file][0] : files[file];
- }
- res(result);
- }
- });
- });
- };
- PostHandler.prototype.parsePostData = function () {
- return __awaiter(this, void 0, void 0, function () {
- var postData, contentType, result, bodyDataAsString;
- return __generator(this, function (_a) {
- switch (_a.label) {
+ RequestHandler.prototype.handlePostData = function () {
+ return request_handler_awaiter(this, void 0, void 0, function () {
+ var _a, ex_4;
+ return request_handler_generator(this, function (_b) {
+ switch (_b.label) {
case 0:
- contentType = this.request.headers[_constant__WEBPACK_IMPORTED_MODULE_2__["__ContentType"]] || this.request.headers["content-type"];
- if (contentType != null) {
- contentType = content_type__WEBPACK_IMPORTED_MODULE_4__["parse"](contentType).type;
- }
- if (!(contentType === _enums__WEBPACK_IMPORTED_MODULE_3__["MIME_TYPE"].FormMultiPart)) return [3 /*break*/, 2];
- return [4 /*yield*/, this.parseMultiPartData_()];
+ if (!(this.request.method === HTTP_METHOD.Get)) return [3 /*break*/, 1];
+ this.body = {};
+ this.file = new file_manager_FileManager({});
+ return [3 /*break*/, 5];
case 1:
- result = _a.sent();
- postData = result.field;
- this.file = new _models__WEBPACK_IMPORTED_MODULE_7__["FileManager"](result.file);
- return [3 /*break*/, 4];
+ if (!(Global.shouldParsePost === true)) return [3 /*break*/, 5];
+ _b.label = 2;
case 2:
- this.file = new _models__WEBPACK_IMPORTED_MODULE_7__["FileManager"]({});
- return [4 /*yield*/, this.getPostRawData_()];
- case 3:
- bodyDataAsString = _a.sent();
- switch (contentType) {
- case _enums__WEBPACK_IMPORTED_MODULE_3__["MIME_TYPE"].Json:
- postData = _helpers__WEBPACK_IMPORTED_MODULE_1__["JsonHelper"].parse(bodyDataAsString);
- break;
- case _enums__WEBPACK_IMPORTED_MODULE_3__["MIME_TYPE"].Text:
- case _enums__WEBPACK_IMPORTED_MODULE_3__["MIME_TYPE"].Html:
- postData = bodyDataAsString;
- break;
- case _enums__WEBPACK_IMPORTED_MODULE_3__["MIME_TYPE"].FormUrlEncoded:
- postData = querystring__WEBPACK_IMPORTED_MODULE_5__["parse"](bodyDataAsString);
- break;
- case _enums__WEBPACK_IMPORTED_MODULE_3__["MIME_TYPE"].Xml:
- postData = new _global__WEBPACK_IMPORTED_MODULE_8__["Global"].xmlParser().parse(bodyDataAsString);
- break;
- default:
- postData = {};
- }
- _a.label = 4;
- case 4: return [2 /*return*/, postData];
- }
- });
- });
- };
- return PostHandler;
-}(_controller_result_handler__WEBPACK_IMPORTED_MODULE_0__["ControllerResultHandler"]));
-
-
-
-/***/ }),
-
-/***/ "./src/handlers/request_handler.ts":
-/*!*****************************************!*\
- !*** ./src/handlers/request_handler.ts ***!
- \*****************************************/
-/*! exports provided: RequestHandler */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequestHandler", function() { return RequestHandler; });
-/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! url */ "url");
-/* harmony import */ var url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(url__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
-/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global */ "./src/global.ts");
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../helpers */ "./src/helpers/index.ts");
-/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../models */ "./src/models/index.ts");
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _post_handler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./post_handler */ "./src/handlers/post_handler.ts");
-/* harmony import */ var _injector_handler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./injector_handler */ "./src/handlers/injector_handler.ts");
-var __extends = (undefined && undefined.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
-})();
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
-};
-
-
-
-
-
-
-
-
-var RequestHandler = /** @class */ (function (_super) {
- __extends(RequestHandler, _super);
- function RequestHandler(request, response) {
- var _this = _super.call(this) || this;
- _this.data_ = {};
- _this.request = request;
- _this.response = response;
- _this.registerEvents_();
- return _this;
- }
- RequestHandler.prototype.registerEvents_ = function () {
- this.request.on('error', this.onBadRequest.bind(this));
- this.response.on('error', this.onErrorOccured.bind(this));
- };
- RequestHandler.prototype.executeWallIncoming_ = function () {
- var _this = this;
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_3__["promise"])(function (res) {
- var index = 0;
- var wallLength = _global__WEBPACK_IMPORTED_MODULE_2__["Global"].walls.length;
- var executeWallIncomingByIndex = function () { return __awaiter(_this, void 0, void 0, function () {
- var wall, constructorArgsValues, wallObj, methodArgsValues, result, ex_1;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (!(wallLength > index)) return [3 /*break*/, 5];
- wall = _global__WEBPACK_IMPORTED_MODULE_2__["Global"].walls[index++];
- constructorArgsValues = _injector_handler__WEBPACK_IMPORTED_MODULE_7__["InjectorHandler"].getConstructorValues(wall.name);
- wallObj = new (wall.bind.apply(wall, [void 0].concat(constructorArgsValues)))();
- wallObj.cookie = this.cookieManager;
- wallObj.session = this.session_;
- wallObj.request = this.request;
- wallObj.response = this.response;
- wallObj.data = this.data_;
- wallObj.query = this.query_;
- this.wallInstances.push(wallObj);
- methodArgsValues = _injector_handler__WEBPACK_IMPORTED_MODULE_7__["InjectorHandler"].getMethodValues(wall.name, 'onIncoming');
- _a.label = 1;
- case 1:
- _a.trys.push([1, 3, , 4]);
- return [4 /*yield*/, wallObj.onIncoming.apply(wallObj, methodArgsValues)];
- case 2:
- result = _a.sent();
- if (result == null) {
- executeWallIncomingByIndex();
- }
- else {
- res(false);
- this.onTerminationFromWall(result);
- }
- return [3 /*break*/, 4];
- case 3:
- ex_1 = _a.sent();
- this.onErrorOccured(ex_1);
- res(false);
- return [3 /*break*/, 4];
- case 4: return [3 /*break*/, 6];
- case 5:
- res(true);
- _a.label = 6;
- case 6: return [2 /*return*/];
- }
- });
- }); };
- executeWallIncomingByIndex();
- });
- };
- RequestHandler.prototype.runController_ = function () {
- var _a;
- var constructorValues = _injector_handler__WEBPACK_IMPORTED_MODULE_7__["InjectorHandler"].getConstructorValues(this.routeMatchInfo_.controller.name);
- var controllerObj = new ((_a = this.routeMatchInfo_.controller).bind.apply(_a, [void 0].concat(constructorValues)))();
- controllerObj.request = this.request;
- controllerObj.response = this.response;
- controllerObj.query = this.query_;
- controllerObj.body = this.body;
- controllerObj.session = this.session_;
- controllerObj.cookie = this.cookieManager;
- controllerObj.param = this.routeMatchInfo_.params;
- controllerObj.data = this.data_;
- controllerObj.file = this.file;
- var methodArgsValues = _injector_handler__WEBPACK_IMPORTED_MODULE_7__["InjectorHandler"].getMethodValues(this.routeMatchInfo_.controller.name, this.routeMatchInfo_.workerInfo.workerName);
- controllerObj[this.routeMatchInfo_.workerInfo.workerName].apply(controllerObj, methodArgsValues).then(this.onResultFromController.bind(this)).catch(this.onErrorOccured.bind(this));
- };
- RequestHandler.prototype.executeShieldsProtection_ = function () {
- var _this = this;
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_3__["promise"])(function (res) {
- var index = 0;
- var shieldLength = _this.routeMatchInfo_.shields.length;
- var executeShieldByIndex = function () { return __awaiter(_this, void 0, void 0, function () {
- var shield, constructorArgsValues, shieldObj, methodArgsValues, result, ex_2;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (!(shieldLength > index)) return [3 /*break*/, 5];
- shield = this.routeMatchInfo_.shields[index++];
- constructorArgsValues = _injector_handler__WEBPACK_IMPORTED_MODULE_7__["InjectorHandler"].getConstructorValues(shield.name);
- shieldObj = new (shield.bind.apply(shield, [void 0].concat(constructorArgsValues)))();
- shieldObj.cookie = this.cookieManager;
- shieldObj.query = this.query_;
- shieldObj.session = this.session_;
- shieldObj.request = this.request;
- shieldObj.response = this.response;
- shieldObj.data = this.data_;
- shieldObj.workerName = this.routeMatchInfo_.workerInfo.workerName;
- methodArgsValues = _injector_handler__WEBPACK_IMPORTED_MODULE_7__["InjectorHandler"].getMethodValues(shield.name, 'protect');
- _a.label = 1;
- case 1:
- _a.trys.push([1, 3, , 4]);
- return [4 /*yield*/, shieldObj.protect.apply(shieldObj, methodArgsValues)];
- case 2:
- result = _a.sent();
- if (result == null) {
- executeShieldByIndex();
- }
- else {
- res(false);
- this.onResultFromController(result);
- }
- return [3 /*break*/, 4];
- case 3:
- ex_2 = _a.sent();
- this.onErrorOccured(ex_2);
- res(false);
- return [3 /*break*/, 4];
- case 4: return [3 /*break*/, 6];
- case 5:
- res(true);
- _a.label = 6;
- case 6: return [2 /*return*/];
- }
- });
- }); };
- executeShieldByIndex();
- });
- };
- RequestHandler.prototype.executeGuardsCheck_ = function (guards) {
- var _this = this;
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_3__["promise"])(function (res) {
- var index = 0;
- var shieldLength = guards.length;
- var executeGuardByIndex = function () { return __awaiter(_this, void 0, void 0, function () {
- var guard, constructorArgsValues, guardObj, methodArgsValues, result, ex_3;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- if (!(shieldLength > index)) return [3 /*break*/, 5];
- guard = guards[index++];
- constructorArgsValues = _injector_handler__WEBPACK_IMPORTED_MODULE_7__["InjectorHandler"].getConstructorValues(guard.name);
- guardObj = new (guard.bind.apply(guard, [void 0].concat(constructorArgsValues)))();
- guardObj.body = this.body;
- guardObj.cookie = this.cookieManager;
- guardObj.query = this.query_;
- guardObj.session = this.session_;
- guardObj.request = this.request;
- guardObj.response = this.response;
- guardObj.data = this.data_;
- guardObj.file = this.file;
- guardObj.param = this.routeMatchInfo_.params;
- methodArgsValues = _injector_handler__WEBPACK_IMPORTED_MODULE_7__["InjectorHandler"].getMethodValues(guard.name, 'check');
- _a.label = 1;
- case 1:
- _a.trys.push([1, 3, , 4]);
- return [4 /*yield*/, guardObj.check.apply(guardObj, methodArgsValues)];
- case 2:
- result = _a.sent();
- if (result == null) {
- executeGuardByIndex();
- }
- else {
- res(false);
- this.onResultFromController(result);
- }
- return [3 /*break*/, 4];
- case 3:
- ex_3 = _a.sent();
- this.onErrorOccured(ex_3);
- res(false);
- return [3 /*break*/, 4];
- case 4: return [3 /*break*/, 6];
- case 5:
- res(true);
- _a.label = 6;
- case 6: return [2 /*return*/];
- }
- });
- }); };
- executeGuardByIndex();
- });
- };
- RequestHandler.prototype.parseCookieFromRequest_ = function () {
- if (_global__WEBPACK_IMPORTED_MODULE_2__["Global"].shouldParseCookie === true) {
- var rawCookie = (this.request.headers[_constant__WEBPACK_IMPORTED_MODULE_1__["__Cookie"]] || this.request.headers["cookie"]);
- var parsedCookies = void 0;
- try {
- parsedCookies = Object(_helpers__WEBPACK_IMPORTED_MODULE_3__["parseCookie"])(rawCookie);
- }
- catch (ex) {
- this.onErrorOccured(ex);
- return false;
- }
- this.session_ = new _global__WEBPACK_IMPORTED_MODULE_2__["Global"].sessionProvider();
- this.session_.cookie = this.cookieManager = new _models__WEBPACK_IMPORTED_MODULE_4__["CookieManager"](parsedCookies);
- this.session_.sessionId = parsedCookies[_global__WEBPACK_IMPORTED_MODULE_2__["Global"].appSessionIdentifier];
- }
- else {
- this.cookieManager = new _models__WEBPACK_IMPORTED_MODULE_4__["CookieManager"]({});
- }
- return true;
- };
- RequestHandler.prototype.setPreHeader_ = function () {
- this.response.setHeader('X-Powered-By', _global__WEBPACK_IMPORTED_MODULE_2__["Global"].appName);
- this.response.setHeader('Vary', 'Accept-Encoding');
- this.response.sendDate = true;
- };
- RequestHandler.prototype.onRouteMatched_ = function () {
- return __awaiter(this, void 0, void 0, function () {
- var actionInfo, shouldExecuteNextComponent;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- actionInfo = this.routeMatchInfo_.workerInfo;
- if (!(actionInfo == null)) return [3 /*break*/, 1];
- if (this.request.method === _enums__WEBPACK_IMPORTED_MODULE_5__["HTTP_METHOD"].Options) {
- this.onRequestOptions(this.routeMatchInfo_.allowedHttpMethod);
- }
- else {
- this.onMethodNotAllowed(this.routeMatchInfo_.allowedHttpMethod);
- }
- return [3 /*break*/, 5];
- case 1: return [4 /*yield*/, this.executeShieldsProtection_()];
- case 2:
- shouldExecuteNextComponent = _a.sent();
- if (!(shouldExecuteNextComponent === true)) return [3 /*break*/, 5];
- return [4 /*yield*/, this.handlePostData()];
- case 3:
- shouldExecuteNextComponent = _a.sent();
- if (!(shouldExecuteNextComponent === true)) return [3 /*break*/, 5];
- return [4 /*yield*/, this.executeGuardsCheck_(actionInfo.guards)];
- case 4:
- shouldExecuteNextComponent = _a.sent();
- if (shouldExecuteNextComponent === true) {
- this.runController_();
- }
- _a.label = 5;
- case 5: return [2 /*return*/];
- }
- });
- });
- };
- RequestHandler.prototype.execute_ = function () {
- return __awaiter(this, void 0, void 0, function () {
- var urlDetail, shouldExecuteNextProcess, pathUrl, requestMethod;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0:
- urlDetail = url__WEBPACK_IMPORTED_MODULE_0__["parse"](this.request.url, true);
- this.query_ = urlDetail.query;
- shouldExecuteNextProcess = this.parseCookieFromRequest_();
- if (!(shouldExecuteNextProcess === true)) return [3 /*break*/, 2];
- return [4 /*yield*/, this.executeWallIncoming_()];
- case 1:
- shouldExecuteNextProcess = _a.sent();
- if (shouldExecuteNextProcess === true) {
- pathUrl = urlDetail.pathname;
- requestMethod = this.request.method;
- try {
- this.routeMatchInfo_ = Object(_helpers__WEBPACK_IMPORTED_MODULE_3__["parseAndMatchRoute"])(pathUrl.toLowerCase(), requestMethod);
- }
- catch (ex) {
- this.onErrorOccured(ex);
- return [2 /*return*/];
- }
- if (this.routeMatchInfo_ == null) { // no route matched
- // it may be a file or folder then
- this.handleFileRequest(pathUrl);
- }
- else {
- this.onRouteMatched_();
- }
- }
- _a.label = 2;
- case 2: return [2 /*return*/];
- }
- });
- });
- };
- RequestHandler.prototype.handlePostData = function () {
- return __awaiter(this, void 0, void 0, function () {
- var _a, ex_4;
- return __generator(this, function (_b) {
- switch (_b.label) {
- case 0:
- if (!(this.request.method === _enums__WEBPACK_IMPORTED_MODULE_5__["HTTP_METHOD"].Get)) return [3 /*break*/, 1];
- this.body = {};
- this.file = new _models__WEBPACK_IMPORTED_MODULE_4__["FileManager"]({});
- return [3 /*break*/, 5];
- case 1:
- if (!(_global__WEBPACK_IMPORTED_MODULE_2__["Global"].shouldParsePost === true)) return [3 /*break*/, 5];
- _b.label = 2;
- case 2:
- _b.trys.push([2, 4, , 5]);
- _a = this;
- return [4 /*yield*/, this.parsePostData()];
+ _b.trys.push([2, 4, , 5]);
+ _a = this;
+ return [4 /*yield*/, this.parsePostData()];
case 3:
_a.body = _b.sent();
return [3 /*break*/, 5];
@@ -2602,1348 +2397,448 @@ var RequestHandler = /** @class */ (function (_super) {
this.onBadRequest(ex_4);
return [2 /*return*/, false];
case 5: return [2 /*return*/, true];
- }
- });
- });
- };
- RequestHandler.prototype.handle = function () {
- return __awaiter(this, void 0, void 0, function () {
- return __generator(this, function (_a) {
- this.setPreHeader_();
- this.execute_();
- return [2 /*return*/];
- });
- });
- };
- return RequestHandler;
-}(_post_handler__WEBPACK_IMPORTED_MODULE_6__["PostHandler"]));
-
-
-
-/***/ }),
-
-/***/ "./src/handlers/request_handler_helper.ts":
-/*!************************************************!*\
- !*** ./src/handlers/request_handler_helper.ts ***!
- \************************************************/
-/*! exports provided: RequestHandlerHelper */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RequestHandlerHelper", function() { return RequestHandlerHelper; });
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
-/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global */ "./src/global.ts");
-/* harmony import */ var negotiator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! negotiator */ "negotiator");
-/* harmony import */ var negotiator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(negotiator__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../helpers */ "./src/helpers/index.ts");
-/* harmony import */ var _injector_handler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./injector_handler */ "./src/handlers/injector_handler.ts");
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
-};
-
-
-
-
-
-
-var RequestHandlerHelper = /** @class */ (function () {
- function RequestHandlerHelper() {
- this.wallInstances = [];
- }
- RequestHandlerHelper.prototype.runWallOutgoing = function () {
- var outgoingResults = [];
- Object(_helpers__WEBPACK_IMPORTED_MODULE_4__["reverseLoop"])(this.wallInstances, function (value) {
- var methodArgsValues = _injector_handler__WEBPACK_IMPORTED_MODULE_5__["InjectorHandler"].getMethodValues(value.constructor.name, 'onOutgoing');
- outgoingResults.push(value.onOutgoing(methodArgsValues));
- });
- return Promise.all(outgoingResults);
- };
- RequestHandlerHelper.prototype.getContentTypeFromNegotiation = function (type) {
- var negotiator = new negotiator__WEBPACK_IMPORTED_MODULE_3__(this.request);
- var availableTypes = this.getAvailableTypes_(type);
- if (availableTypes == null) {
- availableTypes = [type];
- }
- return negotiator.mediaType(availableTypes);
- };
- RequestHandlerHelper.prototype.getContentTypeFromNegotiationHavingMultipleTypes = function (types) {
- var negotiator = new negotiator__WEBPACK_IMPORTED_MODULE_3__(this.request);
- return negotiator.mediaType(types);
- };
- RequestHandlerHelper.prototype.getAvailableTypes_ = function (type) {
- switch (type) {
- case _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Json:
- case _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Xml:
- return [_enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Json, _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Xml];
- case _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html:
- case _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Css:
- case _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Csv:
- case _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Js:
- case _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Rtf:
- case _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Text:
- return [_enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Text, _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html, _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Js,
- _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Css, _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Rtf, _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Csv];
- }
- return null;
- };
- RequestHandlerHelper.prototype.onBadRequest = function (error) {
- return __awaiter(this, void 0, void 0, function () {
- var _a, errMessage, ex_1;
- return __generator(this, function (_b) {
- switch (_b.label) {
- case 0:
- _b.trys.push([0, 3, , 4]);
- return [4 /*yield*/, this.runWallOutgoing()];
- case 1:
- _b.sent();
- return [4 /*yield*/, new _global__WEBPACK_IMPORTED_MODULE_2__["Global"].errorHandler().onBadRequest(error)];
- case 2:
- errMessage = _b.sent();
- return [3 /*break*/, 4];
- case 3:
- ex_1 = _b.sent();
- return [2 /*return*/, this.onErrorOccured(ex_1)];
- case 4:
- this.response.writeHead(_enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].BadRequest, (_a = {}, _a[_constant__WEBPACK_IMPORTED_MODULE_1__["__ContentType"]] = _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html, _a));
- this.response.end(errMessage);
- return [2 /*return*/];
- }
- });
- });
- };
- RequestHandlerHelper.prototype.onForbiddenRequest = function () {
- return __awaiter(this, void 0, void 0, function () {
- var _a, errMessage, ex_2;
- return __generator(this, function (_b) {
- switch (_b.label) {
- case 0:
- _b.trys.push([0, 3, , 4]);
- return [4 /*yield*/, this.runWallOutgoing()];
- case 1:
- _b.sent();
- return [4 /*yield*/, new _global__WEBPACK_IMPORTED_MODULE_2__["Global"].errorHandler().onForbiddenRequest()];
- case 2:
- errMessage = _b.sent();
- return [3 /*break*/, 4];
- case 3:
- ex_2 = _b.sent();
- return [2 /*return*/, this.onErrorOccured(ex_2)];
- case 4:
- this.response.writeHead(_enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].Forbidden, (_a = {}, _a[_constant__WEBPACK_IMPORTED_MODULE_1__["__ContentType"]] = _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html, _a));
- this.response.end(errMessage);
- return [2 /*return*/];
- }
- });
- });
- };
- RequestHandlerHelper.prototype.onNotAcceptableRequest = function () {
- return __awaiter(this, void 0, void 0, function () {
- var _a, errMessage, ex_3;
- return __generator(this, function (_b) {
- switch (_b.label) {
- case 0:
- _b.trys.push([0, 3, , 4]);
- return [4 /*yield*/, this.runWallOutgoing()];
- case 1:
- _b.sent();
- return [4 /*yield*/, new _global__WEBPACK_IMPORTED_MODULE_2__["Global"].errorHandler().onNotAcceptableRequest()];
- case 2:
- errMessage = _b.sent();
- return [3 /*break*/, 4];
- case 3:
- ex_3 = _b.sent();
- return [2 /*return*/, this.onErrorOccured(ex_3)];
- case 4:
- this.response.writeHead(_enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].NotAcceptable, (_a = {}, _a[_constant__WEBPACK_IMPORTED_MODULE_1__["__ContentType"]] = _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html, _a));
- this.response.end(errMessage);
- return [2 /*return*/];
- }
- });
- });
- };
- RequestHandlerHelper.prototype.onNotFound = function () {
- return __awaiter(this, void 0, void 0, function () {
- var _a, errMessage, ex_4;
- return __generator(this, function (_b) {
- switch (_b.label) {
- case 0:
- _b.trys.push([0, 3, , 4]);
- return [4 /*yield*/, this.runWallOutgoing()];
- case 1:
- _b.sent();
- return [4 /*yield*/, new _global__WEBPACK_IMPORTED_MODULE_2__["Global"].errorHandler().onNotFound(this.request.url)];
- case 2:
- errMessage = _b.sent();
- return [3 /*break*/, 4];
- case 3:
- ex_4 = _b.sent();
- return [2 /*return*/, this.onErrorOccured(ex_4)];
- case 4:
- this.response.writeHead(_enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].NotFound, (_a = {}, _a[_constant__WEBPACK_IMPORTED_MODULE_1__["__ContentType"]] = _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html, _a));
- this.response.end(errMessage);
- return [2 /*return*/];
- }
- });
- });
- };
- RequestHandlerHelper.prototype.onMethodNotAllowed = function (allowedMethods) {
- return __awaiter(this, void 0, void 0, function () {
- var _a, errMessage, ex_5;
- return __generator(this, function (_b) {
- switch (_b.label) {
- case 0:
- _b.trys.push([0, 3, , 4]);
- return [4 /*yield*/, this.runWallOutgoing()];
- case 1:
- _b.sent();
- return [4 /*yield*/, new _global__WEBPACK_IMPORTED_MODULE_2__["Global"].errorHandler().onMethodNotAllowed()];
- case 2:
- errMessage = _b.sent();
- return [3 /*break*/, 4];
- case 3:
- ex_5 = _b.sent();
- return [2 /*return*/, this.onErrorOccured(ex_5)];
- case 4:
- this.response.setHeader("Allow", allowedMethods.join(","));
- this.response.writeHead(_enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].MethodNotAllowed, (_a = {}, _a[_constant__WEBPACK_IMPORTED_MODULE_1__["__ContentType"]] = _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html, _a));
- this.response.end(errMessage);
- return [2 /*return*/];
- }
- });
- });
- };
- RequestHandlerHelper.prototype.onErrorOccured = function (error) {
- return __awaiter(this, void 0, void 0, function () {
- var _a, _b, errMessage, ex_6;
- return __generator(this, function (_c) {
- switch (_c.label) {
- case 0:
- if (typeof error === 'string') {
- error = {
- message: error
- };
- }
- _c.label = 1;
- case 1:
- _c.trys.push([1, 4, , 5]);
- return [4 /*yield*/, this.runWallOutgoing()];
- case 2:
- _c.sent();
- return [4 /*yield*/, new _global__WEBPACK_IMPORTED_MODULE_2__["Global"].errorHandler().onServerError(error)];
- case 3:
- errMessage = _c.sent();
- return [3 /*break*/, 5];
- case 4:
- ex_6 = _c.sent();
- this.response.writeHead(_enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].InternalServerError, (_a = {}, _a[_constant__WEBPACK_IMPORTED_MODULE_1__["__ContentType"]] = _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html, _a));
- this.response.end(_helpers__WEBPACK_IMPORTED_MODULE_4__["JsonHelper"].stringify(ex_6));
- return [2 /*return*/];
- case 5:
- this.response.writeHead(_enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].InternalServerError, (_b = {}, _b[_constant__WEBPACK_IMPORTED_MODULE_1__["__ContentType"]] = _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html, _b));
- this.response.end(errMessage);
- return [2 /*return*/];
- }
- });
- });
- };
- RequestHandlerHelper.prototype.onRequestOptions = function (allowedMethods) {
- return __awaiter(this, void 0, void 0, function () {
- var _a, ex_7;
- return __generator(this, function (_b) {
- switch (_b.label) {
- case 0:
- _b.trys.push([0, 2, , 3]);
- return [4 /*yield*/, this.runWallOutgoing()];
- case 1:
- _b.sent();
- return [3 /*break*/, 3];
- case 2:
- ex_7 = _b.sent();
- return [2 /*return*/, this.onErrorOccured(ex_7)];
- case 3:
- this.response.setHeader("Allow", allowedMethods.join(","));
- this.response.writeHead(_enums__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].Ok, (_a = {}, _a[_constant__WEBPACK_IMPORTED_MODULE_1__["__ContentType"]] = _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html, _a));
- this.response.end("");
- return [2 /*return*/];
- }
- });
- });
- };
- return RequestHandlerHelper;
-}());
-
-
-
-/***/ }),
-
-/***/ "./src/handlers/route_handler.ts":
-/*!***************************************!*\
- !*** ./src/handlers/route_handler.ts ***!
- \***************************************/
-/*! exports provided: RouteHandler */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RouteHandler", function() { return RouteHandler; });
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils/index.ts");
-
-var routerCollection = [];
-var getActionPattern = function (parentRoute, pattern) {
- return (Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isNull"])(parentRoute.path) || parentRoute.path === "*") ? pattern : "/" + parentRoute.path + pattern;
-};
-var RouteHandler = /** @class */ (function () {
- function RouteHandler() {
- }
- Object.defineProperty(RouteHandler, "routerCollection", {
- get: function () {
- return routerCollection;
- },
- enumerable: true,
- configurable: true
- });
- RouteHandler.addToRouterCollection = function (value) {
- var route = routerCollection.find(function (x) { return x.controllerName === value.controller.name; });
- if (route == null) {
- routerCollection.push({
- workers: [],
- controller: value.controller,
- controllerName: value.controller.name,
- path: value.path,
- shields: [],
- values: []
- });
- }
- else {
- route.controller = value.controller;
- route.path = value.path;
- // change pattern value since we have controller name now.
- route.workers.forEach(function (actionInfo) {
- actionInfo.pattern = getActionPattern(value, actionInfo.pattern);
- });
- }
- };
- RouteHandler.addShields = function (shields, className) {
- var index = routerCollection.findIndex(function (x) { return x.controllerName === className; });
- if (index < 0) {
- routerCollection.push({
- workers: [],
- controller: null,
- controllerName: className,
- shields: shields,
- path: null,
- values: []
- });
- }
- else {
- routerCollection[index].shields = shields;
- }
- };
- RouteHandler.addWorker = function (newAction, className) {
- var router = routerCollection.find(function (x) { return x.controllerName === className; });
- if (router == null) {
- routerCollection.push({
- workers: [newAction],
- controller: null,
- controllerName: className,
- shields: [],
- path: null,
- values: []
- });
- }
- else {
- var savedAction = router.workers.find(function (val) { return val.workerName === newAction.workerName; });
- if (savedAction == null) {
- newAction.pattern = getActionPattern(router, newAction.pattern);
- router.workers.push(newAction);
- }
- else {
- savedAction.methodsAllowed = newAction.methodsAllowed;
- savedAction.pattern = router.path == null ? savedAction.pattern : "/" + router.path + savedAction.pattern;
- }
- }
- };
- RouteHandler.addGuards = function (guards, className, actionName) {
- var index = routerCollection.findIndex(function (x) { return x.controllerName === className; });
- var pattern = actionName.toLowerCase();
- if (index < 0) {
- routerCollection.push({
- workers: [{
- workerName: actionName,
- guards: guards,
- methodsAllowed: null,
- pattern: pattern,
- values: []
- }],
- controller: null,
- controllerName: className,
- shields: [],
- path: null,
- values: []
- });
- }
- else {
- var savedAction = routerCollection[index].workers.find(function (val) { return val.workerName === actionName; });
- if (savedAction == null) {
- routerCollection[index].workers.push({
- workerName: actionName,
- guards: guards,
- methodsAllowed: null,
- pattern: pattern,
- values: []
- });
- }
- else {
- savedAction.guards = guards;
- }
- }
- };
- RouteHandler.addPattern = function (pattern, className, actionName) {
- var router = routerCollection.find(function (x) { return x.controllerName === className; });
- if (router == null) {
- routerCollection.push({
- workers: [{
- workerName: actionName,
- guards: [],
- methodsAllowed: null,
- pattern: pattern,
- values: []
- }],
- controller: null,
- controllerName: className,
- shields: [],
- path: null,
- values: []
- });
- }
- else {
- var savedAction = router.workers.find(function (val) { return val.workerName === actionName; });
- pattern = getActionPattern(router, pattern);
- if (savedAction == null) {
- router.workers.push({
- workerName: actionName,
- guards: [],
- methodsAllowed: null,
- pattern: pattern,
- values: []
- });
- }
- else {
- savedAction.pattern = pattern;
- }
- }
- };
- return RouteHandler;
-}());
-
-
-
-/***/ }),
-
-/***/ "./src/helpers/download_result.ts":
-/*!****************************************!*\
- !*** ./src/helpers/download_result.ts ***!
- \****************************************/
-/*! exports provided: downloadResult */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "downloadResult", function() { return downloadResult; });
-/* harmony import */ var _enums_http_status_code__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/http_status_code */ "./src/enums/http_status_code.ts");
-
-var downloadResult = function (filePath, downloadFileName) {
- return {
- statusCode: _enums_http_status_code__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].Ok,
- file: {
- filePath: filePath,
- shouldDownload: true,
- alias: downloadFileName
- }
- };
-};
-
-
-/***/ }),
-
-/***/ "./src/helpers/file_result.ts":
-/*!************************************!*\
- !*** ./src/helpers/file_result.ts ***!
- \************************************/
-/*! exports provided: fileResult */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fileResult", function() { return fileResult; });
-/* harmony import */ var _enums_http_status_code__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/http_status_code */ "./src/enums/http_status_code.ts");
-
-var fileResult = function (filePath) {
- return {
- statusCode: _enums_http_status_code__WEBPACK_IMPORTED_MODULE_0__["HTTP_STATUS_CODE"].Ok,
- file: {
- filePath: filePath
- }
- };
-};
-
-
-/***/ }),
-
-/***/ "./src/helpers/get_data_type.ts":
-/*!**************************************!*\
- !*** ./src/helpers/get_data_type.ts ***!
- \**************************************/
-/*! exports provided: getDataType */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDataType", function() { return getDataType; });
-/* harmony import */ var _enums_data_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/data_type */ "./src/enums/data_type.ts");
-
-var getDataType = function (value) {
- var type = typeof value;
- switch (type) {
- case 'object':
- if (Array.isArray(value)) {
- return _enums_data_type__WEBPACK_IMPORTED_MODULE_0__["DATA_TYPE"].Array;
- }
- default:
- return type;
- }
-};
-
-
-/***/ }),
-
-/***/ "./src/helpers/get_mime_type_from_extension.ts":
-/*!*****************************************************!*\
- !*** ./src/helpers/get_mime_type_from_extension.ts ***!
- \*****************************************************/
-/*! exports provided: getMimeTypeFromExtension */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMimeTypeFromExtension", function() { return getMimeTypeFromExtension; });
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-
-var getMimeTypeFromExtension = function (ext) {
- switch (ext) {
- case ".htm":
- case ".html":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html;
- case ".css":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Css;
- case ".js":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Js;
- case ".png":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Png;
- case ".woff":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Woff;
- case ".woff2":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Woff2;
- case ".json":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Json;
- case ".txt":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Text;
- case ".jpg":
- case ".jpeg":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Jpeg;
- case ".rtf":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Rtf;
- case ".ttf":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Ttf;
- case ".eot":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Eot;
- case '.otf':
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Otf;
- case ".swf":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Swf;
- case ".avi":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Avi;
- case ".Svg":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Svg;
- case ".pdf":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Pdf;
- case ".xml":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Xml;
- case ".csv":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Csv;
- case ".xls":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Xls;
- case ".xlsx":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Xlsx;
- case ".bmp":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Bmp;
- case ".gif":
- return _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Gif;
- default:
- return "application/octet-stream";
- }
-};
-
-
-/***/ }),
-
-/***/ "./src/helpers/get_view_from_file.ts":
-/*!*******************************************!*\
- !*** ./src/helpers/get_view_from_file.ts ***!
- \*******************************************/
-/*! exports provided: getViewFromFile */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getViewFromFile", function() { return getViewFromFile; });
-/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs-extra */ "fs-extra");
-/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _is_env_production__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is_env_production */ "./src/helpers/is_env_production.ts");
-/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! path */ "path");
-/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ "./src/global.ts");
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
-};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
-};
-
-
-
-
-
-var viewCache = {};
-var getViewFromFile = function (fileLocation) {
- return __awaiter(this, void 0, void 0, function () {
- var readView, _a, _b;
- return __generator(this, function (_c) {
- switch (_c.label) {
- case 0:
- readView = function () {
- var pathOfView = path__WEBPACK_IMPORTED_MODULE_2__["join"](_constant__WEBPACK_IMPORTED_MODULE_4__["__CurrentPath"], _global__WEBPACK_IMPORTED_MODULE_3__["Global"].viewPath + "/" + fileLocation);
- return Object(fs_extra__WEBPACK_IMPORTED_MODULE_0__["readFile"])(pathOfView, {
- encoding: 'utf8'
- });
- };
- if (!Object(_is_env_production__WEBPACK_IMPORTED_MODULE_1__["isEnvProduction"])()) return [3 /*break*/, 3];
- if (!(viewCache[fileLocation] == null)) return [3 /*break*/, 2];
- _a = viewCache;
- _b = fileLocation;
- return [4 /*yield*/, readView()];
- case 1:
- _a[_b] = _c.sent();
- _c.label = 2;
- case 2: return [2 /*return*/, viewCache[fileLocation]];
- case 3: return [4 /*yield*/, readView()];
- case 4: return [2 /*return*/, _c.sent()];
- }
- });
- });
-};
-
-
-/***/ }),
-
-/***/ "./src/helpers/html_result.ts":
-/*!************************************!*\
- !*** ./src/helpers/html_result.ts ***!
- \************************************/
-/*! exports provided: htmlResult */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlResult", function() { return htmlResult; });
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _enums_http_status_code__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/http_status_code */ "./src/enums/http_status_code.ts");
-
-
-var htmlResult = function (html, statusCode) {
- return {
- contentType: _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Html,
- responseData: html,
- statusCode: statusCode || _enums_http_status_code__WEBPACK_IMPORTED_MODULE_1__["HTTP_STATUS_CODE"].Ok
- };
-};
-
-
-/***/ }),
-
-/***/ "./src/helpers/index.ts":
-/*!******************************!*\
- !*** ./src/helpers/index.ts ***!
- \******************************/
-/*! exports provided: jsonResult, textResult, htmlResult, renderView, downloadResult, fileResult, redirectResult, viewResult, getViewFromFile, promise, LogHelper, XmlHelper, getMimeTypeFromExtension, parseAndMatchRoute, parseCookie, JsonHelper, removeLastSlash, removeFirstSlash, reverseLoop */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _json_result__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./json_result */ "./src/helpers/json_result.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jsonResult", function() { return _json_result__WEBPACK_IMPORTED_MODULE_0__["jsonResult"]; });
-
-/* harmony import */ var _text_result__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text_result */ "./src/helpers/text_result.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "textResult", function() { return _text_result__WEBPACK_IMPORTED_MODULE_1__["textResult"]; });
-
-/* harmony import */ var _html_result__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./html_result */ "./src/helpers/html_result.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "htmlResult", function() { return _html_result__WEBPACK_IMPORTED_MODULE_2__["htmlResult"]; });
-
-/* harmony import */ var _render_view__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./render_view */ "./src/helpers/render_view.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "renderView", function() { return _render_view__WEBPACK_IMPORTED_MODULE_3__["renderView"]; });
-
-/* harmony import */ var _download_result__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./download_result */ "./src/helpers/download_result.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "downloadResult", function() { return _download_result__WEBPACK_IMPORTED_MODULE_4__["downloadResult"]; });
-
-/* harmony import */ var _file_result__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./file_result */ "./src/helpers/file_result.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fileResult", function() { return _file_result__WEBPACK_IMPORTED_MODULE_5__["fileResult"]; });
-
-/* harmony import */ var _redirect_result__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./redirect_result */ "./src/helpers/redirect_result.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "redirectResult", function() { return _redirect_result__WEBPACK_IMPORTED_MODULE_6__["redirectResult"]; });
-
-/* harmony import */ var _view_result__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./view_result */ "./src/helpers/view_result.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "viewResult", function() { return _view_result__WEBPACK_IMPORTED_MODULE_7__["viewResult"]; });
-
-/* harmony import */ var _get_view_from_file__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./get_view_from_file */ "./src/helpers/get_view_from_file.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getViewFromFile", function() { return _get_view_from_file__WEBPACK_IMPORTED_MODULE_8__["getViewFromFile"]; });
-
-/* harmony import */ var _promise__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./promise */ "./src/helpers/promise.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "promise", function() { return _promise__WEBPACK_IMPORTED_MODULE_9__["promise"]; });
-
-/* harmony import */ var _log_helper__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./log_helper */ "./src/helpers/log_helper.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LogHelper", function() { return _log_helper__WEBPACK_IMPORTED_MODULE_10__["LogHelper"]; });
-
-/* harmony import */ var _xml_helper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./xml_helper */ "./src/helpers/xml_helper.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XmlHelper", function() { return _xml_helper__WEBPACK_IMPORTED_MODULE_11__["XmlHelper"]; });
-
-/* harmony import */ var _get_mime_type_from_extension__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./get_mime_type_from_extension */ "./src/helpers/get_mime_type_from_extension.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMimeTypeFromExtension", function() { return _get_mime_type_from_extension__WEBPACK_IMPORTED_MODULE_12__["getMimeTypeFromExtension"]; });
-
-/* harmony import */ var _parse_match_route__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./parse_match_route */ "./src/helpers/parse_match_route.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseAndMatchRoute", function() { return _parse_match_route__WEBPACK_IMPORTED_MODULE_13__["parseAndMatchRoute"]; });
-
-/* harmony import */ var _parse_cookie__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./parse_cookie */ "./src/helpers/parse_cookie.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseCookie", function() { return _parse_cookie__WEBPACK_IMPORTED_MODULE_14__["parseCookie"]; });
-
-/* harmony import */ var _json_helper__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./json_helper */ "./src/helpers/json_helper.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "JsonHelper", function() { return _json_helper__WEBPACK_IMPORTED_MODULE_15__["JsonHelper"]; });
-
-/* harmony import */ var _remove_last_slash__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./remove_last_slash */ "./src/helpers/remove_last_slash.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeLastSlash", function() { return _remove_last_slash__WEBPACK_IMPORTED_MODULE_16__["removeLastSlash"]; });
-
-/* harmony import */ var _remove_first_slash__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./remove_first_slash */ "./src/helpers/remove_first_slash.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFirstSlash", function() { return _remove_first_slash__WEBPACK_IMPORTED_MODULE_17__["removeFirstSlash"]; });
-
-/* harmony import */ var _reverse_loop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./reverse_loop */ "./src/helpers/reverse_loop.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverseLoop", function() { return _reverse_loop__WEBPACK_IMPORTED_MODULE_18__["reverseLoop"]; });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/***/ }),
-
-/***/ "./src/helpers/is_env_dev.ts":
-/*!***********************************!*\
- !*** ./src/helpers/is_env_dev.ts ***!
- \***********************************/
-/*! exports provided: isEnvDev */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEnvDev", function() { return isEnvDev; });
-var isEnvDev = function () {
- return process.env.NODE_ENV === 'development';
-};
-
-
-/***/ }),
-
-/***/ "./src/helpers/is_env_production.ts":
-/*!******************************************!*\
- !*** ./src/helpers/is_env_production.ts ***!
- \******************************************/
-/*! exports provided: isEnvProduction */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isEnvProduction", function() { return isEnvProduction; });
-var isEnvProduction = function () {
- return process.env.NODE_ENV === "production";
-};
-
-
-/***/ }),
-
-/***/ "./src/helpers/json_helper.ts":
-/*!************************************!*\
- !*** ./src/helpers/json_helper.ts ***!
- \************************************/
-/*! exports provided: JsonHelper */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonHelper", function() { return JsonHelper; });
-var JsonHelper = /** @class */ (function () {
- function JsonHelper() {
- }
- JsonHelper.parse = function (value) {
- try {
- return JSON.parse(value);
- }
- catch (ex) {
- // tslint:disable-next-line
- throw {
- message: "Post data is invalid"
- };
- }
+ }
+ });
+ });
};
- JsonHelper.stringify = function (value) {
- return JSON.stringify(value);
+ RequestHandler.prototype.handle = function () {
+ return request_handler_awaiter(this, void 0, void 0, function () {
+ return request_handler_generator(this, function (_a) {
+ this.setPreHeader_();
+ this.execute_();
+ return [2 /*return*/];
+ });
+ });
};
- return JsonHelper;
-}());
+ return RequestHandler;
+}(post_handler_PostHandler));
+// CONCATENATED MODULE: ./src/handlers/index.ts
-/***/ }),
-/***/ "./src/helpers/json_result.ts":
-/*!************************************!*\
- !*** ./src/helpers/json_result.ts ***!
- \************************************/
-/*! exports provided: jsonResult */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "jsonResult", function() { return jsonResult; });
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _enums_http_status_code__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/http_status_code */ "./src/enums/http_status_code.ts");
-var jsonResult = function (value, statusCode) {
- return {
- contentType: _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Json,
- responseData: value,
- statusCode: statusCode || _enums_http_status_code__WEBPACK_IMPORTED_MODULE_1__["HTTP_STATUS_CODE"].Ok
- };
-};
-/***/ }),
-/***/ "./src/helpers/log_helper.ts":
-/*!***********************************!*\
- !*** ./src/helpers/log_helper.ts ***!
- \***********************************/
-/*! exports provided: LogHelper */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// EXTERNAL MODULE: external "mustache"
+var external_mustache_ = __webpack_require__(11);
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogHelper", function() { return LogHelper; });
-/* harmony import */ var _enums_error_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/error_type */ "./src/enums/error_type.ts");
+// CONCATENATED MODULE: ./src/extra/mustache_view_engine.ts
+var mustache_view_engine_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var mustache_view_engine_generator = (undefined && undefined.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
-var LogHelper = /** @class */ (function () {
- function LogHelper(type, info) {
- this.type = type;
- this.info_ = info;
- this.message = this.getMsg_();
+
+var mustache_view_engine_MustacheViewEngine = /** @class */ (function () {
+ function MustacheViewEngine() {
}
- LogHelper.prototype.throw = function () {
- var errMsg = this.get();
- throw JSON.stringify(errMsg);
- };
- LogHelper.log = function (msg) {
- console.log(msg);
- };
- LogHelper.prototype.logError = function () {
- console.error(this.get());
- };
- LogHelper.prototype.logWarning = function () {
- console.warn(this.get());
- };
- LogHelper.prototype.get = function () {
- return {
- message: this.message,
- type: this.type
- };
- };
- LogHelper.prototype.getMsg_ = function () {
- var errMsg;
- switch (this.type) {
- case _enums_error_type__WEBPACK_IMPORTED_MODULE_0__["ERROR_TYPE"].InvalidControllerName:
- errMsg = "Invalid controller name - '" + this.info_ + "'. Controller name must contain 'controller'.";
- break;
- case _enums_error_type__WEBPACK_IMPORTED_MODULE_0__["ERROR_TYPE"].InvalidContentType:
- errMsg = "Content type - '" + this.info_ + "' is not valid. Please create an issue if you think this is valid type.";
- break;
- case _enums_error_type__WEBPACK_IMPORTED_MODULE_0__["ERROR_TYPE"].PortInUse:
- errMsg = "Port " + this.info_ + " is being used by another process.";
- break;
- case _enums_error_type__WEBPACK_IMPORTED_MODULE_0__["ERROR_TYPE"].UndefinedViewEngine:
- errMsg = "View engine is not initiated.Initiate the view engine where fort is created.";
- break;
- default:
- errMsg = this.message;
- break;
- }
- return errMsg;
+ MustacheViewEngine.prototype.render = function (value) {
+ return mustache_view_engine_awaiter(this, void 0, void 0, function () {
+ var viewData;
+ return mustache_view_engine_generator(this, function (_a) {
+ switch (_a.label) {
+ case 0: return [4 /*yield*/, getViewFromFile(value.view)];
+ case 1:
+ viewData = _a.sent();
+ return [2 /*return*/, external_mustache_["render"](viewData, value.model)];
+ }
+ });
+ });
};
- return LogHelper;
+ return MustacheViewEngine;
}());
+// EXTERNAL MODULE: external "uniqid"
+var external_uniqid_ = __webpack_require__(12);
-/***/ }),
-
-/***/ "./src/helpers/parse_cookie.ts":
-/*!*************************************!*\
- !*** ./src/helpers/parse_cookie.ts ***!
- \*************************************/
-/*! exports provided: parseCookie */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// CONCATENATED MODULE: ./src/abstracts/session_provider.ts
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseCookie", function() { return parseCookie; });
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./src/utils/index.ts");
-var parseCookie = function (cookie) {
- var value = {};
- if (!Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isNullOrEmpty"])(cookie)) {
- cookie.split(';').forEach(function (val) {
- var parts = val.split('=');
- value[parts.shift().trim()] = decodeURI(parts.join('='));
- });
+var session_provider_SessionProvider = /** @class */ (function () {
+ function SessionProvider() {
}
- return value;
-};
-
-
-/***/ }),
-
-/***/ "./src/helpers/parse_match_route.ts":
-/*!******************************************!*\
- !*** ./src/helpers/parse_match_route.ts ***!
- \******************************************/
-/*! exports provided: parseAndMatchRoute */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ SessionProvider.prototype.createSession = function () {
+ var now = new Date();
+ this.sessionId = external_uniqid_();
+ this.cookie.addCookie({
+ name: Global.appSessionIdentifier,
+ value: this.sessionId,
+ httpOnly: true,
+ path: "/",
+ expires: new Date(now.setMinutes(now.getMinutes() + Global.sessionTimeOut)),
+ maxAge: Global.sessionTimeOut * 60
+ });
+ };
+ SessionProvider.prototype.destroySession = function () {
+ var cookie = this.cookie.getCookie(Global.appSessionIdentifier);
+ cookie.httpOnly = true;
+ cookie.path = "/";
+ this.cookie.removeCookie(cookie);
+ };
+ return SessionProvider;
+}());
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseAndMatchRoute", function() { return parseAndMatchRoute; });
-/* harmony import */ var _handlers_route_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../handlers/route_handler */ "./src/handlers/route_handler.ts");
-/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! . */ "./src/helpers/index.ts");
+// CONCATENATED MODULE: ./src/extra/memory_session_provider.ts
+var memory_session_provider_extends = (undefined && undefined.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+var memory_session_provider_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var memory_session_provider_generator = (undefined && undefined.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
-var checkRouteInWorkerForDefaultRoute = function (route, httpMethod, urlParts) {
- var matchedRoute = {
- allowedHttpMethod: []
+var sessionValues = [];
+var MemorySessionProvider = /** @class */ (function (_super) {
+ memory_session_provider_extends(MemorySessionProvider, _super);
+ function MemorySessionProvider() {
+ return _super !== null && _super.apply(this, arguments) || this;
+ }
+ MemorySessionProvider.prototype.get = function (key) {
+ return memory_session_provider_awaiter(this, void 0, void 0, function () {
+ var savedSession, session;
+ var _this = this;
+ return memory_session_provider_generator(this, function (_a) {
+ savedSession = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
+ if (savedSession != null) {
+ session = savedSession.datas.find(function (qry) { return qry.key === key; });
+ return [2 /*return*/, session.value];
+ }
+ return [2 /*return*/, null];
+ });
+ });
};
- matchedRoute.controller = route.controller;
- var urlPartLength = urlParts.length;
- var regex1 = /{(.*)}(?!.)/;
- var regex2 = /{(.*)}\.(\w+)(?!.)/;
- route.workers.every(function (routeActionInfo) {
- var patternSplit = routeActionInfo.pattern.split("/");
- if (urlPartLength === patternSplit.length) {
- var isMatched_1 = true;
- var params_1 = {};
- urlParts.every(function (urlPart, i) {
- var regMatch1 = patternSplit[i].match(regex1);
- var regMatch2 = patternSplit[i].match(regex2);
- if (regMatch1 != null) {
- params_1[regMatch1[1]] = urlPart;
+ MemorySessionProvider.prototype.isExist = function (key) {
+ return memory_session_provider_awaiter(this, void 0, void 0, function () {
+ var savedValue, index;
+ var _this = this;
+ return memory_session_provider_generator(this, function (_a) {
+ savedValue = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
+ if (savedValue == null) {
+ return [2 /*return*/, false];
+ }
+ else {
+ index = savedValue.datas.findIndex(function (qry) { return qry.key === key; });
+ return [2 /*return*/, index >= 0];
+ }
+ return [2 /*return*/];
+ });
+ });
+ };
+ MemorySessionProvider.prototype.getAll = function () {
+ return memory_session_provider_awaiter(this, void 0, void 0, function () {
+ var savedValue;
+ var _this = this;
+ return memory_session_provider_generator(this, function (_a) {
+ savedValue = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
+ return [2 /*return*/, savedValue == null ? [] : savedValue.datas];
+ });
+ });
+ };
+ MemorySessionProvider.prototype.set = function (key, val) {
+ return memory_session_provider_awaiter(this, void 0, void 0, function () {
+ var savedValue, savedSessionData;
+ var _this = this;
+ return memory_session_provider_generator(this, function (_a) {
+ savedValue = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
+ if (savedValue == null) {
+ this.createSession();
+ sessionValues.push({
+ identifier: this.sessionId,
+ datas: [{
+ key: key,
+ value: val
+ }]
+ });
}
- else if (regMatch2 != null) {
- var splitByDot = urlPart.split(".");
- if (splitByDot[1] === regMatch2[2]) {
- params_1[regMatch2[1]] = splitByDot[0];
+ else {
+ savedSessionData = savedValue.datas.find(function (q) { return q.key === key; });
+ if (savedSessionData == null) {
+ savedValue.datas.push({
+ key: key,
+ value: val
+ });
}
else {
- isMatched_1 = false;
- return false;
+ savedSessionData.value = val;
}
}
- else if (urlPart !== patternSplit[i]) {
- isMatched_1 = false;
- return false;
- }
- return true;
+ return [2 /*return*/];
});
- if (isMatched_1 === true) {
- if (routeActionInfo.methodsAllowed.indexOf(httpMethod) >= 0) {
- matchedRoute.workerInfo = routeActionInfo;
- matchedRoute.params = params_1;
- matchedRoute.shields = route.shields;
- return false;
- }
- else {
- matchedRoute.allowedHttpMethod = matchedRoute.allowedHttpMethod.concat(routeActionInfo.methodsAllowed);
- }
- }
- }
- return true;
- });
- if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {
- return null;
- }
- return matchedRoute;
-};
-var checkRouteInWorker = function (route, httpMethod, urlParts) {
- var matchedRoute = {
- allowedHttpMethod: []
+ });
};
- matchedRoute.controller = route.controller;
- var urlPartLength = urlParts.length;
- if (urlPartLength === 2) { // url does not have action path
- var pattern_1 = "/" + route.path + "/";
- route.workers.every(function (action) {
- if (action.pattern === pattern_1) {
- if (action.methodsAllowed.indexOf(httpMethod) >= 0) {
- matchedRoute.workerInfo = action;
- matchedRoute.params = {};
- matchedRoute.shields = route.shields;
- return false;
+ MemorySessionProvider.prototype.setMany = function (values) {
+ var _this = this;
+ return Promise.all(values.map(function (value) { return memory_session_provider_awaiter(_this, void 0, void 0, function () {
+ return memory_session_provider_generator(this, function (_a) {
+ switch (_a.label) {
+ case 0: return [4 /*yield*/, this.set(value.key, value.value)];
+ case 1: return [2 /*return*/, _a.sent()];
}
- else {
- matchedRoute.allowedHttpMethod = matchedRoute.allowedHttpMethod.concat(action.methodsAllowed);
+ });
+ }); }));
+ };
+ MemorySessionProvider.prototype.remove = function (key) {
+ return memory_session_provider_awaiter(this, void 0, void 0, function () {
+ var savedValue, index;
+ var _this = this;
+ return memory_session_provider_generator(this, function (_a) {
+ savedValue = sessionValues.find(function (q) { return q.identifier === _this.sessionId; });
+ if (savedValue != null) {
+ index = savedValue.datas.findIndex(function (q) { return q.key === key; });
+ savedValue.datas.splice(index, 1);
}
- }
- return true;
+ return [2 /*return*/];
+ });
});
- }
- else {
- var regex1_1 = /{(.*)}(?!.)/;
- var regex2_1 = /{(.*)}\.(\w+)(?!.)/;
- route.workers.every(function (routeActionInfo) {
- var patternSplit = routeActionInfo.pattern.split("/");
- if (urlPartLength === patternSplit.length) {
- var isMatched_2 = true;
- var params_2 = {};
- urlParts.every(function (urlPart, i) {
- var regMatch1 = patternSplit[i].match(regex1_1);
- var regMatch2 = patternSplit[i].match(regex2_1);
- if (regMatch1 != null) {
- params_2[regMatch1[1]] = urlPart;
- }
- else if (regMatch2 != null) {
- var splitByDot = urlPart.split(".");
- if (splitByDot[1] === regMatch2[2]) {
- params_2[regMatch2[1]] = splitByDot[0];
- }
- else {
- isMatched_2 = false;
- return false;
- }
- }
- else if (urlPart !== patternSplit[i]) {
- isMatched_2 = false;
- return false;
- }
- return true;
- });
- if (isMatched_2 === true) {
- if (routeActionInfo.methodsAllowed.indexOf(httpMethod) >= 0) {
- matchedRoute.workerInfo = routeActionInfo;
- matchedRoute.params = params_2;
- matchedRoute.shields = route.shields;
- return false;
- }
- else {
- matchedRoute.allowedHttpMethod = matchedRoute.allowedHttpMethod.concat(routeActionInfo.methodsAllowed);
- }
+ };
+ MemorySessionProvider.prototype.clear = function () {
+ return memory_session_provider_awaiter(this, void 0, void 0, function () {
+ var index;
+ var _this = this;
+ return memory_session_provider_generator(this, function (_a) {
+ index = sessionValues.findIndex(function (q) { return q.identifier === _this.sessionId; });
+ if (index >= 0) {
+ sessionValues.splice(index, 1);
}
- }
- return true;
+ // expire cookie in browser
+ this.destroySession();
+ return [2 /*return*/];
+ });
});
- }
- if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {
- return null;
- }
- return matchedRoute;
-};
-var parseAndMatchRoute = function (url, httpMethod) {
- if (url !== "/") {
- url = Object(___WEBPACK_IMPORTED_MODULE_1__["removeLastSlash"])(url);
- }
- var urlParts = url.split("/");
- var firstPart = urlParts[1];
- var route = _handlers_route_handler__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"].routerCollection.find(function (qry) { return qry.path === firstPart; });
- if (route == null) {
- route = _handlers_route_handler__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"].routerCollection.find(function (qry) { return qry.path === "*"; });
- return checkRouteInWorkerForDefaultRoute(route, httpMethod, urlParts);
- }
- else {
- return checkRouteInWorker(route, httpMethod, urlParts);
- }
-};
+ };
+ return MemorySessionProvider;
+}(session_provider_SessionProvider));
-/***/ }),
+// CONCATENATED MODULE: ./src/extra/index.ts
-/***/ "./src/helpers/promise.ts":
-/*!********************************!*\
- !*** ./src/helpers/promise.ts ***!
- \********************************/
-/*! exports provided: promise */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "promise", function() { return promise; });
-var promise = function (callBack) {
- return new Promise(callBack);
-};
+// EXTERNAL MODULE: external "http"
+var external_http_ = __webpack_require__(13);
-/***/ }),
+// CONCATENATED MODULE: ./src/test_helpers/http_response_stub.ts
+var HttpResponseStub = /** @class */ (function () {
+ function HttpResponseStub(headers) {
+ this.headers_ = headers;
+ }
+ HttpResponseStub.prototype.getHeader = function (name) {
+ return this.headers_[name];
+ };
+ HttpResponseStub.prototype.hasHeader = function (name) {
+ return this.headers_[name] != null;
+ };
+ HttpResponseStub.prototype.setHeader = function (name, value) {
+ this.headers_[name] = value;
+ };
+ HttpResponseStub.prototype.getHeaders = function () {
+ return this.headers_;
+ };
+ HttpResponseStub.prototype.getHeaderNames = function () {
+ return Object.keys[this.headers_];
+ };
+ HttpResponseStub.prototype.removeHeader = function (name) {
+ delete this.headers_[name];
+ };
+ return HttpResponseStub;
+}());
-/***/ "./src/helpers/redirect_result.ts":
-/*!****************************************!*\
- !*** ./src/helpers/redirect_result.ts ***!
- \****************************************/
-/*! exports provided: redirectResult */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "redirectResult", function() { return redirectResult; });
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _enums_http_status_code__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/http_status_code */ "./src/enums/http_status_code.ts");
+// CONCATENATED MODULE: ./src/test_helpers/http_request_stub.ts
+var HttpRequestStub = /** @class */ (function () {
+ function HttpRequestStub(headers) {
+ this.headers = headers;
+ }
+ return HttpRequestStub;
+}());
-var redirectResult = function (url) {
- return {
- contentType: _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Text,
- responseData: url,
- statusCode: _enums_http_status_code__WEBPACK_IMPORTED_MODULE_1__["HTTP_STATUS_CODE"].Redirect,
- shouldRedirect: true
- };
-};
+// CONCATENATED MODULE: ./src/test_helpers/init_controller.ts
-/***/ }),
-/***/ "./src/helpers/remove_first_slash.ts":
-/*!*******************************************!*\
- !*** ./src/helpers/remove_first_slash.ts ***!
- \*******************************************/
-/*! exports provided: removeFirstSlash */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFirstSlash", function() { return removeFirstSlash; });
-var removeFirstSlash = function (value) {
- // remove / from string at 0th index
- if (value[0] === "/") {
- return value.substr(1);
- }
- return value;
+var initController = function (controllerInstance, data) {
+ data = data || {};
+ var parsedCookies = data.cookieValue || {};
+ var headers = (data.request && data.request.headers) || {};
+ controllerInstance.request = new HttpRequestStub(headers);
+ controllerInstance.response = new HttpResponseStub(headers);
+ controllerInstance.query = data.query || {};
+ controllerInstance.body = data.body || {};
+ controllerInstance.cookie = new CookieManager(parsedCookies);
+ var session = new Global.sessionProvider();
+ session.cookie = controllerInstance.cookie;
+ session.sessionId = parsedCookies[Global.appSessionIdentifier];
+ controllerInstance.session = session;
+ controllerInstance.param = data.param || {};
+ controllerInstance.data = data.data || {};
+ controllerInstance.file = new file_manager_FileManager(data.file || {});
+ return controllerInstance;
};
+// CONCATENATED MODULE: ./src/test_helpers/init_guard.ts
-/***/ }),
-
-/***/ "./src/helpers/remove_last_slash.ts":
-/*!******************************************!*\
- !*** ./src/helpers/remove_last_slash.ts ***!
- \******************************************/
-/*! exports provided: removeLastSlash */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeLastSlash", function() { return removeLastSlash; });
-var removeLastSlash = function (url) {
- var urlLength = url.length;
- // removing / from url;
- if (url[urlLength - 1] === "/") {
- return url.substr(0, urlLength - 1);
- }
- return url;
+var initGuard = function (guardInstance, data) {
+ return initController(guardInstance, data);
};
+// CONCATENATED MODULE: ./src/test_helpers/init_shield.ts
-/***/ }),
-
-/***/ "./src/helpers/render_view.ts":
-/*!************************************!*\
- !*** ./src/helpers/render_view.ts ***!
- \************************************/
-/*! exports provided: renderView */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var initShield = function (shieldInstance, data) {
+ var value = initController(shieldInstance, data);
+ value.workerName = data && data.workerName;
+ return value;
+};
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "renderView", function() { return renderView; });
-/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../global */ "./src/global.ts");
-/* harmony import */ var _is_env_dev__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is_env_dev */ "./src/helpers/is_env_dev.ts");
-/* harmony import */ var _log_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./log_helper */ "./src/helpers/log_helper.ts");
-/* harmony import */ var _enums_error_type__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums/error_type */ "./src/enums/error_type.ts");
+// CONCATENATED MODULE: ./src/test_helpers/init_wall.ts
+var initWall = function (wallInstance, data) {
+ return initController(wallInstance, data);
+};
+// CONCATENATED MODULE: ./src/test_helpers/index.ts
-var renderView = function (viewName, model) {
- if (Object(_is_env_dev__WEBPACK_IMPORTED_MODULE_1__["isEnvDev"])()) {
- if (_global__WEBPACK_IMPORTED_MODULE_0__["Global"].viewEngine == null) {
- new _log_helper__WEBPACK_IMPORTED_MODULE_2__["LogHelper"](_enums_error_type__WEBPACK_IMPORTED_MODULE_3__["ERROR_TYPE"].UndefinedViewEngine).throw();
- }
- }
- return _global__WEBPACK_IMPORTED_MODULE_0__["Global"].viewEngine.render({
- view: viewName,
- model: model
- });
-};
-/***/ }),
-/***/ "./src/helpers/reverse_loop.ts":
-/*!*************************************!*\
- !*** ./src/helpers/reverse_loop.ts ***!
- \*************************************/
-/*! exports provided: reverseLoop */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+// CONCATENATED MODULE: ./src/abstracts/controller.ts
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverseLoop", function() { return reverseLoop; });
-var reverseLoop = function (values, cb) {
- for (var length_1 = values.length, i = length_1 - 1; i >= 0; i--) {
- cb(values[i], i);
+var controller_Controller = /** @class */ (function () {
+ function Controller() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
}
-};
+ Controller.prototype.initialize = function (data) {
+ initController(this, data);
+ };
+ return Controller;
+}());
-/***/ }),
+// CONCATENATED MODULE: ./src/abstracts/shield.ts
-/***/ "./src/helpers/text_result.ts":
-/*!************************************!*\
- !*** ./src/helpers/text_result.ts ***!
- \************************************/
-/*! exports provided: textResult */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+var shield_Shield = /** @class */ (function () {
+ function Shield() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ }
+ Shield.prototype.initialize = function (data) {
+ return initShield(this, data);
+ };
+ return Shield;
+}());
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "textResult", function() { return textResult; });
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _enums_http_status_code__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/http_status_code */ "./src/enums/http_status_code.ts");
+// CONCATENATED MODULE: ./src/abstracts/guard.ts
-var textResult = function (text, statusCode) {
- return {
- contentType: _enums__WEBPACK_IMPORTED_MODULE_0__["MIME_TYPE"].Text,
- responseData: text,
- statusCode: statusCode || _enums_http_status_code__WEBPACK_IMPORTED_MODULE_1__["HTTP_STATUS_CODE"].Ok
+var guard_Guard = /** @class */ (function () {
+ function Guard() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ }
+ Guard.prototype.initialize = function (data) {
+ return initGuard(this, data);
};
-};
+ return Guard;
+}());
-/***/ }),
+// CONCATENATED MODULE: ./src/abstracts/view_engine.ts
+var ViewEngine = /** @class */ (function () {
+ function ViewEngine() {
+ }
+ return ViewEngine;
+}());
-/***/ "./src/helpers/view_result.ts":
-/*!************************************!*\
- !*** ./src/helpers/view_result.ts ***!
- \************************************/
-/*! exports provided: viewResult */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "viewResult", function() { return viewResult; });
-/* harmony import */ var _render_view__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./render_view */ "./src/helpers/render_view.ts");
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+// CONCATENATED MODULE: ./src/abstracts/wall.ts
+var wall_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
@@ -3951,7 +2846,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
-var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
+var wall_generator = (undefined && undefined.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
@@ -3978,477 +2873,328 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
-var _this = undefined;
-
-var viewResult = function (viewName, model) { return __awaiter(_this, void 0, void 0, function () {
- var viewData;
- return __generator(this, function (_a) {
- switch (_a.label) {
- case 0: return [4 /*yield*/, Object(_render_view__WEBPACK_IMPORTED_MODULE_0__["renderView"])(viewName, model)];
- case 1:
- viewData = _a.sent();
- return [2 /*return*/, {
- contentType: _enums__WEBPACK_IMPORTED_MODULE_1__["MIME_TYPE"].Html,
- responseData: viewData,
- statusCode: _enums__WEBPACK_IMPORTED_MODULE_1__["HTTP_STATUS_CODE"].Ok
- }];
+var wall_Wall = /** @class */ (function () {
+ function Wall() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
}
- });
-}); };
-
-
-/***/ }),
-
-/***/ "./src/helpers/xml_helper.ts":
-/*!***********************************!*\
- !*** ./src/helpers/xml_helper.ts ***!
- \***********************************/
-/*! exports provided: XmlHelper */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XmlHelper", function() { return XmlHelper; });
-/* harmony import */ var _get_data_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get_data_type */ "./src/helpers/get_data_type.ts");
-/* harmony import */ var _enums_data_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/data_type */ "./src/enums/data_type.ts");
-/* harmony import */ var jsontoxml__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jsontoxml */ "jsontoxml");
-/* harmony import */ var jsontoxml__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jsontoxml__WEBPACK_IMPORTED_MODULE_2__);
-
-
-
-var XmlHelper = /** @class */ (function () {
- function XmlHelper() {
}
- XmlHelper.fromJsToXml = function (value) {
- var addKeyToObjectIfNeeded = function (key, obj) {
- var _a;
- var type = Object(_get_data_type__WEBPACK_IMPORTED_MODULE_0__["getDataType"])(obj);
- if (type === _enums_data_type__WEBPACK_IMPORTED_MODULE_1__["DATA_TYPE"].Object) {
- var keys = Object.keys(obj);
- if (keys.length !== 1) {
- obj = (_a = {},
- _a[key] = obj,
- _a);
- }
- }
- return obj;
- };
- var dataType = Object(_get_data_type__WEBPACK_IMPORTED_MODULE_0__["getDataType"])(value);
- switch (dataType) {
- case _enums_data_type__WEBPACK_IMPORTED_MODULE_1__["DATA_TYPE"].Array:
- value.forEach(function (val, index) {
- value[index] = addKeyToObjectIfNeeded("item", val);
- });
- value = {
- root: value
- };
- break;
- case _enums_data_type__WEBPACK_IMPORTED_MODULE_1__["DATA_TYPE"].Object:
- value = addKeyToObjectIfNeeded("root", value);
+ Wall.prototype.onOutgoing = function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
}
- return jsontoxml__WEBPACK_IMPORTED_MODULE_2__(value, {
- xmlHeader: true
+ return wall_awaiter(this, void 0, void 0, function () {
+ return wall_generator(this, function (_a) {
+ return [2 /*return*/, null];
+ });
});
};
- return XmlHelper;
+ Wall.prototype.initialize = function (data) {
+ return initWall(this, data);
+ };
+ return Wall;
}());
-
-/***/ }),
-
-/***/ "./src/index.ts":
-/*!**********************!*\
- !*** ./src/index.ts ***!
- \**********************/
-/*! exports provided: ErrorHandler, HttpCookie, Fort, Router, CookieManager, FileManager, HttpFile, Controller, Shield, SessionProvider, Guard, ViewEngine, Wall, XmlParser, Worker, Shields, Guards, Route, DefaultWorker, Assign, Singleton, MIME_TYPE, HTTP_METHOD, HTTP_STATUS_CODE, ETag_Type, ERROR_TYPE, jsonResult, textResult, htmlResult, renderView, downloadResult, fileResult, redirectResult, viewResult, getViewFromFile, promise, LogHelper, XmlHelper, getMimeTypeFromExtension, parseAndMatchRoute, parseCookie, JsonHelper, removeLastSlash, removeFirstSlash, reverseLoop, MustacheViewEngine, MemorySessionProvider */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./models */ "./src/models/index.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return _models__WEBPACK_IMPORTED_MODULE_0__["ErrorHandler"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpCookie", function() { return _models__WEBPACK_IMPORTED_MODULE_0__["HttpCookie"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fort", function() { return _models__WEBPACK_IMPORTED_MODULE_0__["Fort"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return _models__WEBPACK_IMPORTED_MODULE_0__["Router"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CookieManager", function() { return _models__WEBPACK_IMPORTED_MODULE_0__["CookieManager"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileManager", function() { return _models__WEBPACK_IMPORTED_MODULE_0__["FileManager"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpFile", function() { return _models__WEBPACK_IMPORTED_MODULE_0__["HttpFile"]; });
-
-/* harmony import */ var _abstracts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./abstracts */ "./src/abstracts/index.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Controller", function() { return _abstracts__WEBPACK_IMPORTED_MODULE_1__["Controller"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Shield", function() { return _abstracts__WEBPACK_IMPORTED_MODULE_1__["Shield"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "SessionProvider", function() { return _abstracts__WEBPACK_IMPORTED_MODULE_1__["SessionProvider"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Guard", function() { return _abstracts__WEBPACK_IMPORTED_MODULE_1__["Guard"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ViewEngine", function() { return _abstracts__WEBPACK_IMPORTED_MODULE_1__["ViewEngine"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Wall", function() { return _abstracts__WEBPACK_IMPORTED_MODULE_1__["Wall"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XmlParser", function() { return _abstracts__WEBPACK_IMPORTED_MODULE_1__["XmlParser"]; });
-
-/* harmony import */ var _decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./decorators */ "./src/decorators/index.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Worker", function() { return _decorators__WEBPACK_IMPORTED_MODULE_2__["Worker"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Shields", function() { return _decorators__WEBPACK_IMPORTED_MODULE_2__["Shields"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Guards", function() { return _decorators__WEBPACK_IMPORTED_MODULE_2__["Guards"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return _decorators__WEBPACK_IMPORTED_MODULE_2__["Route"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DefaultWorker", function() { return _decorators__WEBPACK_IMPORTED_MODULE_2__["DefaultWorker"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Assign", function() { return _decorators__WEBPACK_IMPORTED_MODULE_2__["Assign"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Singleton", function() { return _decorators__WEBPACK_IMPORTED_MODULE_2__["Singleton"]; });
-
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./enums */ "./src/enums/index.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MIME_TYPE", function() { return _enums__WEBPACK_IMPORTED_MODULE_3__["MIME_TYPE"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HTTP_METHOD", function() { return _enums__WEBPACK_IMPORTED_MODULE_3__["HTTP_METHOD"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HTTP_STATUS_CODE", function() { return _enums__WEBPACK_IMPORTED_MODULE_3__["HTTP_STATUS_CODE"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ETag_Type", function() { return _enums__WEBPACK_IMPORTED_MODULE_3__["ETag_Type"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ERROR_TYPE", function() { return _enums__WEBPACK_IMPORTED_MODULE_3__["ERROR_TYPE"]; });
-
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ "./src/helpers/index.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "jsonResult", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["jsonResult"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "textResult", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["textResult"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "htmlResult", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["htmlResult"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "renderView", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["renderView"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "downloadResult", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["downloadResult"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "fileResult", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["fileResult"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "redirectResult", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["redirectResult"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "viewResult", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["viewResult"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getViewFromFile", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["getViewFromFile"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "promise", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["promise"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LogHelper", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["LogHelper"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "XmlHelper", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["XmlHelper"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getMimeTypeFromExtension", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["getMimeTypeFromExtension"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseAndMatchRoute", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["parseAndMatchRoute"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseCookie", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["parseCookie"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "JsonHelper", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["JsonHelper"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeLastSlash", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["removeLastSlash"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "removeFirstSlash", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["removeFirstSlash"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "reverseLoop", function() { return _helpers__WEBPACK_IMPORTED_MODULE_4__["reverseLoop"]; });
-
-/* harmony import */ var _extra__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./extra */ "./src/extra/index.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MustacheViewEngine", function() { return _extra__WEBPACK_IMPORTED_MODULE_5__["MustacheViewEngine"]; });
-
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MemorySessionProvider", function() { return _extra__WEBPACK_IMPORTED_MODULE_5__["MemorySessionProvider"]; });
-
+// CONCATENATED MODULE: ./src/abstracts/xml_parser.ts
+var XmlParser = /** @class */ (function () {
+ function XmlParser() {
+ }
+ return XmlParser;
+}());
+// CONCATENATED MODULE: ./src/abstracts/index.ts
-/***/ }),
-/***/ "./src/models/cookie_manager.ts":
-/*!**************************************!*\
- !*** ./src/models/cookie_manager.ts ***!
- \**************************************/
-/*! exports provided: CookieManager */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CookieManager", function() { return CookieManager; });
-var CookieManager = /** @class */ (function () {
- function CookieManager(parsedValue) {
- this.responseCookie_ = [];
- this.cookieCollection_ = parsedValue;
- }
- /**
- * return cookie by name
- *
- * @param {string} name
- * @returns
- * @memberof CookieManager
- */
- CookieManager.prototype.getCookie = function (name) {
- return {
- name: name,
- value: this.cookieCollection_[name]
- };
- };
- /**
- * add cookie
- *
- * @param {HttpCookie} cookie
- * @memberof CookieManager
- */
- CookieManager.prototype.addCookie = function (cookie) {
- this.cookieCollection_[cookie.name] = cookie.value;
- this.responseCookie_.push(this.getCookieStringFromCookie_(cookie));
- };
- /**
- * remove cookie
- *
- * @param {HttpCookie} cookie
- * @memberof CookieManager
- */
- CookieManager.prototype.removeCookie = function (cookie) {
- this.cookieCollection_[cookie.name] = null;
- cookie.expires = new Date('Thu, 01 Jan 1970 00:00:00 GMT');
- cookie.maxAge = -1;
- this.responseCookie_.push(this.getCookieStringFromCookie_(cookie));
- };
- Object.defineProperty(CookieManager.prototype, "cookieCollection", {
- /**
- * collection of http cookie
- *
- * @readonly
- * @memberof CookieManager
- */
- get: function () {
- return this.cookieCollection_;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * determine whether value exist or not
- *
- * @param {string} name
- * @returns
- * @memberof CookieManager
- */
- CookieManager.prototype.isExist = function (name) {
- return this.cookieCollection_[name] != null;
+// CONCATENATED MODULE: ./src/generics/generic_guard.ts
+var generic_guard_extends = (undefined && undefined.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
};
- CookieManager.prototype.getCookieStringFromCookie_ = function (cookie) {
- var cookies = [];
- cookies.push(cookie.name + "=" + cookie.value);
- if (cookie.expires) {
- cookies.push("Expires=" + cookie.expires.toUTCString());
- }
- if (cookie.httpOnly === true) {
- cookies.push("HttpOnly");
- }
- if (cookie.maxAge != null) {
- cookies.push("Max-Age=" + cookie.maxAge);
- }
- if (cookie.path) {
- cookies.push("Path=" + cookie.path);
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+
+var GenericGuard = /** @class */ (function (_super) {
+ generic_guard_extends(GenericGuard, _super);
+ function GenericGuard() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
}
- if (cookie.domain) {
- cookies.push("Domain=" + cookie.domain);
+ return _super.call(this) || this;
+ }
+ GenericGuard.prototype.check = function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
}
- return cookies.join('; ');
+ return null;
};
- return CookieManager;
-}());
+ return GenericGuard;
+}(guard_Guard));
+// CONCATENATED MODULE: ./src/generics/generic_shield.ts
+var generic_shield_extends = (undefined && undefined.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
-/***/ }),
+var GenericShield = /** @class */ (function (_super) {
+ generic_shield_extends(GenericShield, _super);
+ function GenericShield() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return _super.call(this) || this;
+ }
+ GenericShield.prototype.protect = function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return null;
+ };
+ return GenericShield;
+}(shield_Shield));
-/***/ "./src/models/error_handler.ts":
-/*!*************************************!*\
- !*** ./src/models/error_handler.ts ***!
- \*************************************/
-/*! exports provided: ErrorHandler */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return ErrorHandler; });
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers */ "./src/helpers/index.ts");
+// CONCATENATED MODULE: ./src/generics/generic_session_provider.ts
+var generic_session_provider_extends = (undefined && undefined.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+var generic_session_provider_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var generic_session_provider_generator = (undefined && undefined.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
-var ErrorHandler = /** @class */ (function () {
- function ErrorHandler() {
+var GenericSessionProvider = /** @class */ (function (_super) {
+ generic_session_provider_extends(GenericSessionProvider, _super);
+ function GenericSessionProvider() {
+ return _super !== null && _super.apply(this, arguments) || this;
}
- ErrorHandler.prototype.onServerError = function (ex) {
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_0__["promise"])(function (resolve, reject) {
- var errMessage = "internal server error
\n message : " + ex.message + "
";
- if (ex.stack) {
- errMessage += "stacktrace: " + ex.stack + "
";
- }
- if (ex.type) {
- errMessage += "type: " + ex.type + "
";
- }
- resolve(errMessage);
- });
+ GenericSessionProvider.prototype.get = function () {
+ return null;
};
- ErrorHandler.prototype.onBadRequest = function (ex) {
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_0__["promise"])(function (resolve, reject) {
- var errMessage = "Bad Request
";
- if (ex.message) {
- errMessage += " message : " + ex.message + "
";
- }
- if (ex.stack) {
- errMessage += "stacktrace: " + ex.stack + "
";
- }
- if (ex.type) {
- errMessage += "type: " + ex.type + "
";
- }
- resolve(errMessage);
- });
+ GenericSessionProvider.prototype.getAll = function () {
+ return null;
};
- ErrorHandler.prototype.onForbiddenRequest = function () {
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_0__["promise"])(function (resolve, reject) {
- var errMessage = "Forbidden
";
- resolve(errMessage);
- });
+ GenericSessionProvider.prototype.set = function (key, value) {
+ return null;
};
- ErrorHandler.prototype.onNotAcceptableRequest = function () {
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_0__["promise"])(function (resolve, reject) {
- var errMessage = "Not Acceptable
";
- resolve(errMessage);
- });
+ GenericSessionProvider.prototype.isExist = function (key) {
+ return null;
};
- ErrorHandler.prototype.onMethodNotAllowed = function () {
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_0__["promise"])(function (resolve, reject) {
- var errMessage = "Method Not allowed.
";
- resolve(errMessage);
- });
+ GenericSessionProvider.prototype.remove = function (key) {
+ return null;
};
- ErrorHandler.prototype.onNotFound = function (url) {
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_0__["promise"])(function (resolve, reject) {
- var errMessage = "The requested resource " + url + " was not found.
";
- resolve(errMessage);
+ GenericSessionProvider.prototype.setMany = function (values) {
+ return null;
+ };
+ GenericSessionProvider.prototype.clear = function () {
+ return generic_session_provider_awaiter(this, void 0, void 0, function () {
+ return generic_session_provider_generator(this, function (_a) {
+ return [2 /*return*/];
+ });
});
};
- return ErrorHandler;
-}());
+ return GenericSessionProvider;
+}(session_provider_SessionProvider));
+// CONCATENATED MODULE: ./src/generics/generic_wall.ts
+var generic_wall_extends = (undefined && undefined.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
-/***/ }),
+var GenericWall = /** @class */ (function (_super) {
+ generic_wall_extends(GenericWall, _super);
+ function GenericWall() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return _super.call(this) || this;
+ }
+ GenericWall.prototype.onIncoming = function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return null;
+ };
+ return GenericWall;
+}(wall_Wall));
-/***/ "./src/models/file_manager.ts":
-/*!************************************!*\
- !*** ./src/models/file_manager.ts ***!
- \************************************/
-/*! exports provided: FileManager */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileManager", function() { return FileManager; });
-/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fs-extra */ "fs-extra");
-/* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_0__);
+// CONCATENATED MODULE: ./src/generics/generic_controller.ts
+var generic_controller_extends = (undefined && undefined.__extends) || (function () {
+ var extendStatics = function (d, b) {
+ extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return extendStatics(d, b);
+ };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
-var FileManager = /** @class */ (function () {
- function FileManager(value) {
- this.files_ = value;
+var GenericController = /** @class */ (function (_super) {
+ generic_controller_extends(GenericController, _super);
+ function GenericController() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return _super.call(this) || this;
}
- Object.defineProperty(FileManager.prototype, "count", {
- /**
- * get total no of files
- *
- * @returns - number
- * @memberof FileManager
- */
- get: function () {
- return Object.keys(this.files_).length;
- },
- enumerable: true,
- configurable: true
+ return GenericController;
+}(controller_Controller));
+
+
+// CONCATENATED MODULE: ./src/generics/generic_xml_parser.ts
+var generic_xml_parser_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
});
- Object.defineProperty(FileManager.prototype, "files", {
- get: function () {
- var _this = this;
- return Object.keys(this.files_).map(function (fileId) {
- return _this.files_[fileId];
+};
+var generic_xml_parser_generator = (undefined && undefined.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+var GenericXmlParser = /** @class */ (function () {
+ function GenericXmlParser() {
+ }
+ GenericXmlParser.prototype.parse = function (xml) {
+ return generic_xml_parser_awaiter(this, void 0, void 0, function () {
+ return generic_xml_parser_generator(this, function (_a) {
+ // tslint:disable-next-line
+ throw {
+ message: "no xml parser configured"
+ };
});
- },
- enumerable: true,
- configurable: true
- });
- /**
- * check for existance of file
- *
- * @param {string} fieldName
- * @returns
- * @memberof FileManager
- */
- FileManager.prototype.isExist = function (fieldName) {
- return this.files_[fieldName] != null;
- };
- /**
- * return the file
- *
- * @param {string} fieldName
- * @returns
- * @memberof FileManager
- */
- FileManager.prototype.getFile = function (fieldName) {
- return this.files_[fieldName];
- };
- /**
- * saves file to supplied path
- *
- * @param {string} fieldName
- * @param {string} pathToSave
- * @returns
- * @memberof FileManager
- */
- FileManager.prototype.saveTo = function (fieldName, pathToSave) {
- return fs_extra__WEBPACK_IMPORTED_MODULE_0__["copy"](this.files_[fieldName].path, pathToSave);
+ });
};
- return FileManager;
+ return GenericXmlParser;
}());
+// CONCATENATED MODULE: ./src/generics/index.ts
-/***/ }),
-/***/ "./src/models/fort.ts":
-/*!****************************!*\
- !*** ./src/models/fort.ts ***!
- \****************************/
-/*! exports provided: Fort */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Fort", function() { return Fort; });
-/* harmony import */ var _handlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../handlers */ "./src/handlers/index.ts");
-/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../global */ "./src/global.ts");
-/* harmony import */ var _extra__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../extra */ "./src/extra/index.ts");
-/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! . */ "./src/models/index.ts");
-/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constant */ "./src/constant.ts");
-/* harmony import */ var http__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! http */ "http");
-/* harmony import */ var http__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(http__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../enums */ "./src/enums/index.ts");
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../helpers */ "./src/helpers/index.ts");
-/* harmony import */ var _generics__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../generics */ "./src/generics/index.ts");
-/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils */ "./src/utils/index.ts");
+
+
+
+
+// CONCATENATED MODULE: ./src/models/fort.ts
@@ -4459,33 +3205,33 @@ __webpack_require__.r(__webpack_exports__);
-var Fort = /** @class */ (function () {
+var fort_Fort = /** @class */ (function () {
function Fort() {
this.routes = [];
this.walls = [];
}
Fort.prototype.saveAppOption_ = function (option) {
var defaultEtagConfig = {
- type: _enums__WEBPACK_IMPORTED_MODULE_6__["ETag_Type"].Weak
+ type: ETag_Type.Weak
};
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].port = option.port == null ? 4000 : option.port;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].shouldParseCookie = option.shouldParseCookie == null ? true : option.shouldParseCookie;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].shouldParsePost = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNull"])(option.shouldParsePost) ? true : option.shouldParsePost;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].sessionTimeOut = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNull"])(option.sessionTimeOut) ? 60 : option.sessionTimeOut;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].folders = option.folders == null ? [] : option.folders;
- if (Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isArray"])(_global__WEBPACK_IMPORTED_MODULE_1__["Global"].folders) === false) {
+ Global.port = option.port == null ? 4000 : option.port;
+ Global.shouldParseCookie = option.shouldParseCookie == null ? true : option.shouldParseCookie;
+ Global.shouldParsePost = isNull(option.shouldParsePost) ? true : option.shouldParsePost;
+ Global.sessionTimeOut = isNull(option.sessionTimeOut) ? 60 : option.sessionTimeOut;
+ Global.folders = option.folders == null ? [] : option.folders;
+ if (isArray(Global.folders) === false) {
throw new Error("Option folders should be an array");
}
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].appName = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNullOrEmpty"])(option.appName) === true ? _constant__WEBPACK_IMPORTED_MODULE_4__["__AppName"] : option.appName;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].appSessionIdentifier = _global__WEBPACK_IMPORTED_MODULE_1__["Global"].appName + "_session_id";
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].eTag = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNull"])(option.eTag) ? defaultEtagConfig : option.eTag;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].walls = this.walls;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].viewEngine = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNull"])(this.viewEngine) ? new _extra__WEBPACK_IMPORTED_MODULE_2__["MustacheViewEngine"]() : new this.viewEngine();
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].sessionProvider = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNull"])(this.sessionProvider) ? _extra__WEBPACK_IMPORTED_MODULE_2__["MemorySessionProvider"] :
+ Global.appName = isNullOrEmpty(option.appName) === true ? __AppName : option.appName;
+ Global.appSessionIdentifier = Global.appName + "_session_id";
+ Global.eTag = isNull(option.eTag) ? defaultEtagConfig : option.eTag;
+ Global.walls = this.walls;
+ Global.viewEngine = isNull(this.viewEngine) ? new mustache_view_engine_MustacheViewEngine() : new this.viewEngine();
+ Global.sessionProvider = isNull(this.sessionProvider) ? MemorySessionProvider :
this.sessionProvider;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].errorHandler = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNull"])(this.errorHandler) ? ___WEBPACK_IMPORTED_MODULE_3__["ErrorHandler"] : this.errorHandler;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].xmlParser = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNull"])(this.xmlParser) ? _generics__WEBPACK_IMPORTED_MODULE_8__["GenericXmlParser"] : this.xmlParser;
- _global__WEBPACK_IMPORTED_MODULE_1__["Global"].viewPath = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isNull"])(option.viewPath) ? "views" : option.viewPath;
+ Global.errorHandler = isNull(this.errorHandler) ? error_handler_ErrorHandler : this.errorHandler;
+ Global.xmlParser = isNull(this.xmlParser) ? GenericXmlParser : this.xmlParser;
+ Global.viewPath = isNull(option.viewPath) ? "views" : option.viewPath;
};
Fort.prototype.create = function (option) {
var _this = this;
@@ -4498,16 +3244,16 @@ var Fort = /** @class */ (function () {
var isDefaultRouteExist = false;
// removing / from routes
this.routes.forEach(function (route) {
- route.path = Object(_helpers__WEBPACK_IMPORTED_MODULE_7__["removeFirstSlash"])(route.path);
- route.path = Object(_helpers__WEBPACK_IMPORTED_MODULE_7__["removeLastSlash"])(route.path);
+ route.path = removeFirstSlash(route.path);
+ route.path = removeLastSlash(route.path);
if (route.path === "*") {
isDefaultRouteExist = true;
}
- _handlers__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"].addToRouterCollection(route);
+ RouteHandler.addToRouterCollection(route);
});
if (isDefaultRouteExist === false) {
- _handlers__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"].addToRouterCollection({
- controller: _generics__WEBPACK_IMPORTED_MODULE_8__["GenericController"],
+ RouteHandler.addToRouterCollection({
+ controller: GenericController,
path: "*"
});
}
@@ -4516,18 +3262,18 @@ var Fort = /** @class */ (function () {
option.folders.forEach(function (folder) {
var length = folder.alias.length;
if (length > 1) {
- folder.alias = Object(_helpers__WEBPACK_IMPORTED_MODULE_7__["removeFirstSlash"])(folder.alias);
- folder.alias = Object(_helpers__WEBPACK_IMPORTED_MODULE_7__["removeLastSlash"])(folder.alias);
+ folder.alias = removeFirstSlash(folder.alias);
+ folder.alias = removeLastSlash(folder.alias);
}
});
}
this.saveAppOption_(option);
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_7__["promise"])(function (res, rej) {
- _this.httpServer = http__WEBPACK_IMPORTED_MODULE_5__["createServer"](function (request, response) {
- new _handlers__WEBPACK_IMPORTED_MODULE_0__["RequestHandler"](request, response).handle();
+ return promise(function (res, rej) {
+ _this.httpServer = external_http_["createServer"](function (request, response) {
+ new request_handler_RequestHandler(request, response).handle();
}).once("error", function (err) {
if (err.code === 'EADDRINUSE') {
- var error = new _helpers__WEBPACK_IMPORTED_MODULE_7__["LogHelper"](_enums__WEBPACK_IMPORTED_MODULE_6__["ERROR_TYPE"].PortInUse, _global__WEBPACK_IMPORTED_MODULE_1__["Global"].port).get();
+ var error = new log_helper_LogHelper(ERROR_TYPE.PortInUse, Global.port).get();
rej(error);
}
else {
@@ -4535,12 +3281,12 @@ var Fort = /** @class */ (function () {
}
}).once('listening', function () {
res();
- }).listen(_global__WEBPACK_IMPORTED_MODULE_1__["Global"].port);
+ }).listen(Global.port);
});
};
Fort.prototype.destroy = function () {
var _this = this;
- return Object(_helpers__WEBPACK_IMPORTED_MODULE_7__["promise"])(function (res, rej) {
+ return promise(function (res, rej) {
_this.httpServer.close(res);
});
};
@@ -4548,532 +3294,351 @@ var Fort = /** @class */ (function () {
}());
+// CONCATENATED MODULE: ./src/models/router.ts
-/***/ }),
-
-/***/ "./src/models/http_cookie.ts":
-/*!***********************************!*\
- !*** ./src/models/http_cookie.ts ***!
- \***********************************/
-/*! exports provided: HttpCookie */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpCookie", function() { return HttpCookie; });
-var HttpCookie = /** @class */ (function () {
- function HttpCookie(name, value) {
- this.name = name;
- this.value = value;
- }
- return HttpCookie;
-}());
-
-
-
-/***/ }),
-
-/***/ "./src/models/http_file.ts":
-/*!*********************************!*\
- !*** ./src/models/http_file.ts ***!
- \*********************************/
-/*! exports provided: HttpFile */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpFile", function() { return HttpFile; });
-var HttpFile = /** @class */ (function () {
- function HttpFile() {
- }
- return HttpFile;
-}());
-
-
-
-/***/ }),
-
-/***/ "./src/models/index.ts":
-/*!*****************************!*\
- !*** ./src/models/index.ts ***!
- \*****************************/
-/*! exports provided: ErrorHandler, HttpCookie, Fort, Router, CookieManager, FileManager, HttpFile */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _error_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./error_handler */ "./src/models/error_handler.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return _error_handler__WEBPACK_IMPORTED_MODULE_0__["ErrorHandler"]; });
-
-/* harmony import */ var _http_cookie__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./http_cookie */ "./src/models/http_cookie.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpCookie", function() { return _http_cookie__WEBPACK_IMPORTED_MODULE_1__["HttpCookie"]; });
-
-/* harmony import */ var _fort__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fort */ "./src/models/fort.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Fort", function() { return _fort__WEBPACK_IMPORTED_MODULE_2__["Fort"]; });
-
-/* harmony import */ var _router__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./router */ "./src/models/router.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return _router__WEBPACK_IMPORTED_MODULE_3__["Router"]; });
-
-/* harmony import */ var _cookie_manager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cookie_manager */ "./src/models/cookie_manager.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "CookieManager", function() { return _cookie_manager__WEBPACK_IMPORTED_MODULE_4__["CookieManager"]; });
-
-/* harmony import */ var _file_manager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./file_manager */ "./src/models/file_manager.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FileManager", function() { return _file_manager__WEBPACK_IMPORTED_MODULE_5__["FileManager"]; });
-
-/* harmony import */ var _http_file__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./http_file */ "./src/models/http_file.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpFile", function() { return _http_file__WEBPACK_IMPORTED_MODULE_6__["HttpFile"]; });
-
-
-
-
-
-
-
-
-
-
-/***/ }),
-
-/***/ "./src/models/router.ts":
-/*!******************************!*\
- !*** ./src/models/router.ts ***!
- \******************************/
-/*! exports provided: Router */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return Router; });
-/* harmony import */ var _handlers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../handlers */ "./src/handlers/index.ts");
-
-var Router = /** @class */ (function () {
+var router_Router = /** @class */ (function () {
function Router() {
- this.routes = _handlers__WEBPACK_IMPORTED_MODULE_0__["RouteHandler"].routerCollection;
+ this.routes = RouteHandler.routerCollection;
}
return Router;
}());
-
-/***/ }),
-
-/***/ "./src/test_helpers/http_request_stub.ts":
-/*!***********************************************!*\
- !*** ./src/test_helpers/http_request_stub.ts ***!
- \***********************************************/
-/*! exports provided: HttpRequestStub */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpRequestStub", function() { return HttpRequestStub; });
-var HttpRequestStub = /** @class */ (function () {
- function HttpRequestStub(headers) {
- this.headers = headers;
+// CONCATENATED MODULE: ./src/models/cookie_manager.ts
+var CookieManager = /** @class */ (function () {
+ function CookieManager(parsedValue) {
+ this.responseCookie_ = [];
+ this.cookieCollection_ = parsedValue;
}
- return HttpRequestStub;
+ /**
+ * return cookie by name
+ *
+ * @param {string} name
+ * @returns
+ * @memberof CookieManager
+ */
+ CookieManager.prototype.getCookie = function (name) {
+ return {
+ name: name,
+ value: this.cookieCollection_[name]
+ };
+ };
+ /**
+ * add cookie
+ *
+ * @param {HttpCookie} cookie
+ * @memberof CookieManager
+ */
+ CookieManager.prototype.addCookie = function (cookie) {
+ this.cookieCollection_[cookie.name] = cookie.value;
+ this.responseCookie_.push(this.getCookieStringFromCookie_(cookie));
+ };
+ /**
+ * remove cookie
+ *
+ * @param {HttpCookie} cookie
+ * @memberof CookieManager
+ */
+ CookieManager.prototype.removeCookie = function (cookie) {
+ this.cookieCollection_[cookie.name] = null;
+ cookie.expires = new Date('Thu, 01 Jan 1970 00:00:00 GMT');
+ cookie.maxAge = -1;
+ this.responseCookie_.push(this.getCookieStringFromCookie_(cookie));
+ };
+ Object.defineProperty(CookieManager.prototype, "cookieCollection", {
+ /**
+ * collection of http cookie
+ *
+ * @readonly
+ * @memberof CookieManager
+ */
+ get: function () {
+ return this.cookieCollection_;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ /**
+ * determine whether value exist or not
+ *
+ * @param {string} name
+ * @returns
+ * @memberof CookieManager
+ */
+ CookieManager.prototype.isExist = function (name) {
+ return this.cookieCollection_[name] != null;
+ };
+ CookieManager.prototype.getCookieStringFromCookie_ = function (cookie) {
+ var cookies = [];
+ cookies.push(cookie.name + "=" + cookie.value);
+ if (cookie.expires) {
+ cookies.push("Expires=" + cookie.expires.toUTCString());
+ }
+ if (cookie.httpOnly === true) {
+ cookies.push("HttpOnly");
+ }
+ if (cookie.maxAge != null) {
+ cookies.push("Max-Age=" + cookie.maxAge);
+ }
+ if (cookie.path) {
+ cookies.push("Path=" + cookie.path);
+ }
+ if (cookie.domain) {
+ cookies.push("Domain=" + cookie.domain);
+ }
+ return cookies.join('; ');
+ };
+ return CookieManager;
}());
+// CONCATENATED MODULE: ./src/models/file_manager.ts
-/***/ }),
-
-/***/ "./src/test_helpers/http_response_stub.ts":
-/*!************************************************!*\
- !*** ./src/test_helpers/http_response_stub.ts ***!
- \************************************************/
-/*! exports provided: HttpResponseStub */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpResponseStub", function() { return HttpResponseStub; });
-var HttpResponseStub = /** @class */ (function () {
- function HttpResponseStub(headers) {
- this.headers_ = headers;
+var file_manager_FileManager = /** @class */ (function () {
+ function FileManager(value) {
+ this.files_ = value;
}
- HttpResponseStub.prototype.getHeader = function (name) {
- return this.headers_[name];
- };
- HttpResponseStub.prototype.hasHeader = function (name) {
- return this.headers_[name] != null;
- };
- HttpResponseStub.prototype.setHeader = function (name, value) {
- this.headers_[name] = value;
- };
- HttpResponseStub.prototype.getHeaders = function () {
- return this.headers_;
+ Object.defineProperty(FileManager.prototype, "count", {
+ /**
+ * get total no of files
+ *
+ * @returns - number
+ * @memberof FileManager
+ */
+ get: function () {
+ return Object.keys(this.files_).length;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ Object.defineProperty(FileManager.prototype, "files", {
+ get: function () {
+ var _this = this;
+ return Object.keys(this.files_).map(function (fileId) {
+ return _this.files_[fileId];
+ });
+ },
+ enumerable: true,
+ configurable: true
+ });
+ /**
+ * check for existance of file
+ *
+ * @param {string} fieldName
+ * @returns
+ * @memberof FileManager
+ */
+ FileManager.prototype.isExist = function (fieldName) {
+ return this.files_[fieldName] != null;
};
- HttpResponseStub.prototype.getHeaderNames = function () {
- return Object.keys[this.headers_];
+ /**
+ * return the file
+ *
+ * @param {string} fieldName
+ * @returns
+ * @memberof FileManager
+ */
+ FileManager.prototype.getFile = function (fieldName) {
+ return this.files_[fieldName];
};
- HttpResponseStub.prototype.removeHeader = function (name) {
- delete this.headers_[name];
+ /**
+ * saves file to supplied path
+ *
+ * @param {string} fieldName
+ * @param {string} pathToSave
+ * @returns
+ * @memberof FileManager
+ */
+ FileManager.prototype.saveTo = function (fieldName, pathToSave) {
+ return external_fs_extra_["copy"](this.files_[fieldName].path, pathToSave);
};
- return HttpResponseStub;
+ return FileManager;
}());
-
-/***/ }),
-
-/***/ "./src/test_helpers/index.ts":
-/*!***********************************!*\
- !*** ./src/test_helpers/index.ts ***!
- \***********************************/
-/*! exports provided: initController, initGuard, initShield, initWall */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _init_controller__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./init_controller */ "./src/test_helpers/init_controller.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initController", function() { return _init_controller__WEBPACK_IMPORTED_MODULE_0__["initController"]; });
-
-/* harmony import */ var _init_guard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./init_guard */ "./src/test_helpers/init_guard.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initGuard", function() { return _init_guard__WEBPACK_IMPORTED_MODULE_1__["initGuard"]; });
-
-/* harmony import */ var _init_shield__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./init_shield */ "./src/test_helpers/init_shield.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initShield", function() { return _init_shield__WEBPACK_IMPORTED_MODULE_2__["initShield"]; });
-
-/* harmony import */ var _init_wall__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./init_wall */ "./src/test_helpers/init_wall.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "initWall", function() { return _init_wall__WEBPACK_IMPORTED_MODULE_3__["initWall"]; });
-
+// CONCATENATED MODULE: ./src/models/http_file.ts
+var HttpFile = /** @class */ (function () {
+ function HttpFile() {
+ }
+ return HttpFile;
+}());
+// CONCATENATED MODULE: ./src/models/index.ts
-/***/ }),
-/***/ "./src/test_helpers/init_controller.ts":
-/*!*********************************************!*\
- !*** ./src/test_helpers/init_controller.ts ***!
- \*********************************************/
-/*! exports provided: initController */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initController", function() { return initController; });
-/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../models */ "./src/models/index.ts");
-/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../global */ "./src/global.ts");
-/* harmony import */ var _http_response_stub__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./http_response_stub */ "./src/test_helpers/http_response_stub.ts");
-/* harmony import */ var _http_request_stub__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./http_request_stub */ "./src/test_helpers/http_request_stub.ts");
+// CONCATENATED MODULE: ./src/decorators/worker.ts
-var initController = function (controllerInstance, data) {
- data = data || {};
- var parsedCookies = data.cookieValue || {};
- var headers = (data.request && data.request.headers) || {};
- controllerInstance.request = new _http_request_stub__WEBPACK_IMPORTED_MODULE_3__["HttpRequestStub"](headers);
- controllerInstance.response = new _http_response_stub__WEBPACK_IMPORTED_MODULE_2__["HttpResponseStub"](headers);
- controllerInstance.query = data.query || {};
- controllerInstance.body = data.body || {};
- controllerInstance.cookie = new _models__WEBPACK_IMPORTED_MODULE_0__["CookieManager"](parsedCookies);
- var session = new _global__WEBPACK_IMPORTED_MODULE_1__["Global"].sessionProvider();
- session.cookie = controllerInstance.cookie;
- session.sessionId = parsedCookies[_global__WEBPACK_IMPORTED_MODULE_1__["Global"].appSessionIdentifier];
- controllerInstance.session = session;
- controllerInstance.param = data.param || {};
- controllerInstance.data = data.data || {};
- controllerInstance.file = new _models__WEBPACK_IMPORTED_MODULE_0__["FileManager"](data.file || {});
- return controllerInstance;
+// tslint:disable-next-line
+var Worker = function (allowedMethods) {
+ return function (target, methodName, descriptor) {
+ var className = target.constructor.name;
+ var actionInfo = {
+ workerName: methodName,
+ methodsAllowed: allowedMethods == null ? [
+ HTTP_METHOD.Delete, HTTP_METHOD.Get, HTTP_METHOD.Post, HTTP_METHOD.Patch, HTTP_METHOD.Put
+ ] : allowedMethods,
+ guards: [],
+ pattern: "/" + methodName.toLowerCase(),
+ values: []
+ };
+ RouteHandler.addWorker(actionInfo, className);
+ };
};
+// CONCATENATED MODULE: ./src/decorators/shields.ts
-/***/ }),
-
-/***/ "./src/test_helpers/init_guard.ts":
-/*!****************************************!*\
- !*** ./src/test_helpers/init_guard.ts ***!
- \****************************************/
-/*! exports provided: initGuard */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initGuard", function() { return initGuard; });
-/* harmony import */ var _init_controller__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./init_controller */ "./src/test_helpers/init_controller.ts");
-
-var initGuard = function (guardInstance, data) {
- return Object(_init_controller__WEBPACK_IMPORTED_MODULE_0__["initController"])(guardInstance, data);
+// tslint:disable-next-line
+var Shields = function (shieldsValue) {
+ return function (target) {
+ var className = target.name;
+ RouteHandler.addShields(shieldsValue, className);
+ };
};
+// CONCATENATED MODULE: ./src/decorators/guards.ts
-/***/ }),
-
-/***/ "./src/test_helpers/init_shield.ts":
-/*!*****************************************!*\
- !*** ./src/test_helpers/init_shield.ts ***!
- \*****************************************/
-/*! exports provided: initShield */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initShield", function() { return initShield; });
-/* harmony import */ var _init_controller__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./init_controller */ "./src/test_helpers/init_controller.ts");
-
-var initShield = function (shieldInstance, data) {
- var value = Object(_init_controller__WEBPACK_IMPORTED_MODULE_0__["initController"])(shieldInstance, data);
- value.workerName = data && data.workerName;
- return value;
+// tslint:disable-next-line
+var Guards = function (value) {
+ return (function (target, methodName, descriptor) {
+ var className = target.constructor.name;
+ RouteHandler.addGuards(value, className, methodName);
+ });
};
+// CONCATENATED MODULE: ./src/decorators/route.ts
-/***/ }),
-
-/***/ "./src/test_helpers/init_wall.ts":
-/*!***************************************!*\
- !*** ./src/test_helpers/init_wall.ts ***!
- \***************************************/
-/*! exports provided: initWall */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initWall", function() { return initWall; });
-/* harmony import */ var _init_controller__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./init_controller */ "./src/test_helpers/init_controller.ts");
-var initWall = function (wallInstance, data) {
- return Object(_init_controller__WEBPACK_IMPORTED_MODULE_0__["initController"])(wallInstance, data);
+// tslint:disable-next-line
+var Route = function (format) {
+ return (function (target, methodName, descriptor) {
+ var className = target.constructor.name;
+ // remove / from route
+ if (format != null && format !== '/') {
+ format = removeLastSlash(format);
+ }
+ RouteHandler.addPattern(format, className, methodName);
+ });
};
-
-/***/ }),
-
-/***/ "./src/utils/index.ts":
-/*!****************************!*\
- !*** ./src/utils/index.ts ***!
- \****************************/
-/*! exports provided: isNullOrEmpty, isNull, isArray */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _is_null_or_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is_null_or_empty */ "./src/utils/is_null_or_empty.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNullOrEmpty", function() { return _is_null_or_empty__WEBPACK_IMPORTED_MODULE_0__["isNullOrEmpty"]; });
-
-/* harmony import */ var _is_null__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is_null */ "./src/utils/is_null.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return _is_null__WEBPACK_IMPORTED_MODULE_1__["isNull"]; });
-
-/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is_array */ "./src/utils/is_array.ts");
-/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return _is_array__WEBPACK_IMPORTED_MODULE_2__["isArray"]; });
-
+// CONCATENATED MODULE: ./src/decorators/default_worker.ts
-
-
-
-/***/ }),
-
-/***/ "./src/utils/is_array.ts":
-/*!*******************************!*\
- !*** ./src/utils/is_array.ts ***!
- \*******************************/
-/*! exports provided: isArray */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArray", function() { return isArray; });
-var isArray = function (value) {
- return Array.isArray(value);
+// tslint:disable-next-line
+var DefaultWorker = function (allowedMethods) {
+ return function (target, methodName, descriptor) {
+ var className = target.constructor.name;
+ var actionInfo = {
+ workerName: methodName,
+ methodsAllowed: allowedMethods == null ? [HTTP_METHOD.Get] : allowedMethods,
+ guards: [],
+ pattern: "/",
+ values: []
+ };
+ RouteHandler.addWorker(actionInfo, className);
+ };
};
+// CONCATENATED MODULE: ./src/decorators/assign.ts
-/***/ }),
-
-/***/ "./src/utils/is_null.ts":
-/*!******************************!*\
- !*** ./src/utils/is_null.ts ***!
- \******************************/
-/*! exports provided: isNull */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNull", function() { return isNull; });
-var isNull = function (value) {
- return value == null;
+// tslint:disable-next-line
+var Assign = function (value) {
+ return function (target, methodName, paramIndex) {
+ var className = target.name || target.constructor.name;
+ if (methodName == null) {
+ methodName = __Constructor;
+ }
+ injector_handler_InjectorHandler.addWorkerValue(className, methodName, paramIndex, value);
+ };
};
+// CONCATENATED MODULE: ./src/decorators/singleton.ts
-/***/ }),
-
-/***/ "./src/utils/is_null_or_empty.ts":
-/*!***************************************!*\
- !*** ./src/utils/is_null_or_empty.ts ***!
- \***************************************/
-/*! exports provided: isNullOrEmpty */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNullOrEmpty", function() { return isNullOrEmpty; });
-var isNullOrEmpty = function (value) {
- return value == null || value.length === 0;
+// tslint:disable-next-line
+var Singleton = function (value) {
+ return function (target, methodName, paramIndex) {
+ var className = target.name || target.constructor.name;
+ if (methodName == null || methodName === 'constructor') {
+ methodName = __Constructor;
+ }
+ injector_handler_InjectorHandler.addSingleton(className, methodName, paramIndex, value);
+ };
};
+// CONCATENATED MODULE: ./src/decorators/index.ts
-/***/ }),
-
-/***/ "content-type":
-/*!*******************************!*\
- !*** external "content-type" ***!
- \*******************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-module.exports = require("content-type");
-
-/***/ }),
-
-/***/ "etag":
-/*!***********************!*\
- !*** external "etag" ***!
- \***********************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-module.exports = require("etag");
-
-/***/ }),
-
-/***/ "fresh":
-/*!************************!*\
- !*** external "fresh" ***!
- \************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-module.exports = require("fresh");
-
-/***/ }),
-
-/***/ "fs":
-/*!*********************!*\
- !*** external "fs" ***!
- \*********************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-module.exports = require("fs");
-
-/***/ }),
-
-/***/ "fs-extra":
-/*!***************************!*\
- !*** external "fs-extra" ***!
- \***************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-module.exports = require("fs-extra");
-
-/***/ }),
-
-/***/ "http":
-/*!***********************!*\
- !*** external "http" ***!
- \***********************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-module.exports = require("http");
-
-/***/ }),
-
-/***/ "jsontoxml":
-/*!****************************!*\
- !*** external "jsontoxml" ***!
- \****************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-module.exports = require("jsontoxml");
-
-/***/ }),
-
-/***/ "multiparty":
-/*!*****************************!*\
- !*** external "multiparty" ***!
- \*****************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-module.exports = require("multiparty");
-
-/***/ }),
-
-/***/ "mustache":
-/*!***************************!*\
- !*** external "mustache" ***!
- \***************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-module.exports = require("mustache");
-
-/***/ }),
-/***/ "negotiator":
-/*!*****************************!*\
- !*** external "negotiator" ***!
- \*****************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-module.exports = require("negotiator");
-/***/ }),
-/***/ "path":
-/*!***********************!*\
- !*** external "path" ***!
- \***********************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-module.exports = require("path");
-/***/ }),
-/***/ "querystring":
-/*!******************************!*\
- !*** external "querystring" ***!
- \******************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
+// CONCATENATED MODULE: ./src/index.ts
+/* concated harmony reexport ErrorHandler */__webpack_require__.d(__webpack_exports__, "ErrorHandler", function() { return error_handler_ErrorHandler; });
+/* concated harmony reexport HttpCookie */__webpack_require__.d(__webpack_exports__, "HttpCookie", function() { return HttpCookie; });
+/* concated harmony reexport Fort */__webpack_require__.d(__webpack_exports__, "Fort", function() { return fort_Fort; });
+/* concated harmony reexport Router */__webpack_require__.d(__webpack_exports__, "Router", function() { return router_Router; });
+/* concated harmony reexport CookieManager */__webpack_require__.d(__webpack_exports__, "CookieManager", function() { return CookieManager; });
+/* concated harmony reexport FileManager */__webpack_require__.d(__webpack_exports__, "FileManager", function() { return file_manager_FileManager; });
+/* concated harmony reexport HttpFile */__webpack_require__.d(__webpack_exports__, "HttpFile", function() { return HttpFile; });
+/* concated harmony reexport Controller */__webpack_require__.d(__webpack_exports__, "Controller", function() { return controller_Controller; });
+/* concated harmony reexport Shield */__webpack_require__.d(__webpack_exports__, "Shield", function() { return shield_Shield; });
+/* concated harmony reexport SessionProvider */__webpack_require__.d(__webpack_exports__, "SessionProvider", function() { return session_provider_SessionProvider; });
+/* concated harmony reexport Guard */__webpack_require__.d(__webpack_exports__, "Guard", function() { return guard_Guard; });
+/* concated harmony reexport ViewEngine */__webpack_require__.d(__webpack_exports__, "ViewEngine", function() { return ViewEngine; });
+/* concated harmony reexport Wall */__webpack_require__.d(__webpack_exports__, "Wall", function() { return wall_Wall; });
+/* concated harmony reexport XmlParser */__webpack_require__.d(__webpack_exports__, "XmlParser", function() { return XmlParser; });
+/* concated harmony reexport Worker */__webpack_require__.d(__webpack_exports__, "Worker", function() { return Worker; });
+/* concated harmony reexport Shields */__webpack_require__.d(__webpack_exports__, "Shields", function() { return Shields; });
+/* concated harmony reexport Guards */__webpack_require__.d(__webpack_exports__, "Guards", function() { return Guards; });
+/* concated harmony reexport Route */__webpack_require__.d(__webpack_exports__, "Route", function() { return Route; });
+/* concated harmony reexport DefaultWorker */__webpack_require__.d(__webpack_exports__, "DefaultWorker", function() { return DefaultWorker; });
+/* concated harmony reexport Assign */__webpack_require__.d(__webpack_exports__, "Assign", function() { return Assign; });
+/* concated harmony reexport Singleton */__webpack_require__.d(__webpack_exports__, "Singleton", function() { return Singleton; });
+/* concated harmony reexport MIME_TYPE */__webpack_require__.d(__webpack_exports__, "MIME_TYPE", function() { return MIME_TYPE; });
+/* concated harmony reexport HTTP_METHOD */__webpack_require__.d(__webpack_exports__, "HTTP_METHOD", function() { return HTTP_METHOD; });
+/* concated harmony reexport HTTP_STATUS_CODE */__webpack_require__.d(__webpack_exports__, "HTTP_STATUS_CODE", function() { return HTTP_STATUS_CODE; });
+/* concated harmony reexport ETag_Type */__webpack_require__.d(__webpack_exports__, "ETag_Type", function() { return ETag_Type; });
+/* concated harmony reexport ERROR_TYPE */__webpack_require__.d(__webpack_exports__, "ERROR_TYPE", function() { return ERROR_TYPE; });
+/* concated harmony reexport jsonResult */__webpack_require__.d(__webpack_exports__, "jsonResult", function() { return jsonResult; });
+/* concated harmony reexport textResult */__webpack_require__.d(__webpack_exports__, "textResult", function() { return textResult; });
+/* concated harmony reexport htmlResult */__webpack_require__.d(__webpack_exports__, "htmlResult", function() { return htmlResult; });
+/* concated harmony reexport renderView */__webpack_require__.d(__webpack_exports__, "renderView", function() { return renderView; });
+/* concated harmony reexport downloadResult */__webpack_require__.d(__webpack_exports__, "downloadResult", function() { return downloadResult; });
+/* concated harmony reexport fileResult */__webpack_require__.d(__webpack_exports__, "fileResult", function() { return fileResult; });
+/* concated harmony reexport redirectResult */__webpack_require__.d(__webpack_exports__, "redirectResult", function() { return redirectResult; });
+/* concated harmony reexport viewResult */__webpack_require__.d(__webpack_exports__, "viewResult", function() { return viewResult; });
+/* concated harmony reexport getViewFromFile */__webpack_require__.d(__webpack_exports__, "getViewFromFile", function() { return getViewFromFile; });
+/* concated harmony reexport promise */__webpack_require__.d(__webpack_exports__, "promise", function() { return promise; });
+/* concated harmony reexport LogHelper */__webpack_require__.d(__webpack_exports__, "LogHelper", function() { return log_helper_LogHelper; });
+/* concated harmony reexport XmlHelper */__webpack_require__.d(__webpack_exports__, "XmlHelper", function() { return xml_helper_XmlHelper; });
+/* concated harmony reexport getMimeTypeFromExtension */__webpack_require__.d(__webpack_exports__, "getMimeTypeFromExtension", function() { return getMimeTypeFromExtension; });
+/* concated harmony reexport parseAndMatchRoute */__webpack_require__.d(__webpack_exports__, "parseAndMatchRoute", function() { return parseAndMatchRoute; });
+/* concated harmony reexport parseCookie */__webpack_require__.d(__webpack_exports__, "parseCookie", function() { return parseCookie; });
+/* concated harmony reexport JsonHelper */__webpack_require__.d(__webpack_exports__, "JsonHelper", function() { return JsonHelper; });
+/* concated harmony reexport removeLastSlash */__webpack_require__.d(__webpack_exports__, "removeLastSlash", function() { return removeLastSlash; });
+/* concated harmony reexport removeFirstSlash */__webpack_require__.d(__webpack_exports__, "removeFirstSlash", function() { return removeFirstSlash; });
+/* concated harmony reexport reverseLoop */__webpack_require__.d(__webpack_exports__, "reverseLoop", function() { return reverseLoop; });
+/* concated harmony reexport MustacheViewEngine */__webpack_require__.d(__webpack_exports__, "MustacheViewEngine", function() { return mustache_view_engine_MustacheViewEngine; });
+/* concated harmony reexport MemorySessionProvider */__webpack_require__.d(__webpack_exports__, "MemorySessionProvider", function() { return MemorySessionProvider; });
-module.exports = require("querystring");
-/***/ }),
-/***/ "uniqid":
-/*!*************************!*\
- !*** external "uniqid" ***!
- \*************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-module.exports = require("uniqid");
-/***/ }),
-/***/ "url":
-/*!**********************!*\
- !*** external "url" ***!
- \**********************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-module.exports = require("url");
/***/ })
-
-/******/ });
+/******/ ]);
//# sourceMappingURL=fort.js.map
\ No newline at end of file
diff --git a/dist/fort.js.map b/dist/fort.js.map
index 06558def..d63c99c5 100644
--- a/dist/fort.js.map
+++ b/dist/fort.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack://FortJs/webpack/bootstrap","webpack://FortJs/./src/abstracts/controller.ts","webpack://FortJs/./src/abstracts/guard.ts","webpack://FortJs/./src/abstracts/index.ts","webpack://FortJs/./src/abstracts/session_provider.ts","webpack://FortJs/./src/abstracts/shield.ts","webpack://FortJs/./src/abstracts/view_engine.ts","webpack://FortJs/./src/abstracts/wall.ts","webpack://FortJs/./src/abstracts/xml_parser.ts","webpack://FortJs/./src/constant.ts","webpack://FortJs/./src/decorators/assign.ts","webpack://FortJs/./src/decorators/default_worker.ts","webpack://FortJs/./src/decorators/guards.ts","webpack://FortJs/./src/decorators/index.ts","webpack://FortJs/./src/decorators/route.ts","webpack://FortJs/./src/decorators/shields.ts","webpack://FortJs/./src/decorators/singleton.ts","webpack://FortJs/./src/decorators/worker.ts","webpack://FortJs/./src/enums/data_type.ts","webpack://FortJs/./src/enums/error_type.ts","webpack://FortJs/./src/enums/etag_type.ts","webpack://FortJs/./src/enums/http_method.ts","webpack://FortJs/./src/enums/http_status_code.ts","webpack://FortJs/./src/enums/index.ts","webpack://FortJs/./src/enums/mime_type.ts","webpack://FortJs/./src/extra/index.ts","webpack://FortJs/./src/extra/memory_session_provider.ts","webpack://FortJs/./src/extra/mustache_view_engine.ts","webpack://FortJs/./src/generics/generic_controller.ts","webpack://FortJs/./src/generics/generic_guard.ts","webpack://FortJs/./src/generics/generic_session_provider.ts","webpack://FortJs/./src/generics/generic_shield.ts","webpack://FortJs/./src/generics/generic_wall.ts","webpack://FortJs/./src/generics/generic_xml_parser.ts","webpack://FortJs/./src/generics/index.ts","webpack://FortJs/./src/global.ts","webpack://FortJs/./src/handlers/controller_result_handler.ts","webpack://FortJs/./src/handlers/file_handler.ts","webpack://FortJs/./src/handlers/index.ts","webpack://FortJs/./src/handlers/injector_handler.ts","webpack://FortJs/./src/handlers/post_handler.ts","webpack://FortJs/./src/handlers/request_handler.ts","webpack://FortJs/./src/handlers/request_handler_helper.ts","webpack://FortJs/./src/handlers/route_handler.ts","webpack://FortJs/./src/helpers/download_result.ts","webpack://FortJs/./src/helpers/file_result.ts","webpack://FortJs/./src/helpers/get_data_type.ts","webpack://FortJs/./src/helpers/get_mime_type_from_extension.ts","webpack://FortJs/./src/helpers/get_view_from_file.ts","webpack://FortJs/./src/helpers/html_result.ts","webpack://FortJs/./src/helpers/index.ts","webpack://FortJs/./src/helpers/is_env_dev.ts","webpack://FortJs/./src/helpers/is_env_production.ts","webpack://FortJs/./src/helpers/json_helper.ts","webpack://FortJs/./src/helpers/json_result.ts","webpack://FortJs/./src/helpers/log_helper.ts","webpack://FortJs/./src/helpers/parse_cookie.ts","webpack://FortJs/./src/helpers/parse_match_route.ts","webpack://FortJs/./src/helpers/promise.ts","webpack://FortJs/./src/helpers/redirect_result.ts","webpack://FortJs/./src/helpers/remove_first_slash.ts","webpack://FortJs/./src/helpers/remove_last_slash.ts","webpack://FortJs/./src/helpers/render_view.ts","webpack://FortJs/./src/helpers/reverse_loop.ts","webpack://FortJs/./src/helpers/text_result.ts","webpack://FortJs/./src/helpers/view_result.ts","webpack://FortJs/./src/helpers/xml_helper.ts","webpack://FortJs/./src/index.ts","webpack://FortJs/./src/models/cookie_manager.ts","webpack://FortJs/./src/models/error_handler.ts","webpack://FortJs/./src/models/file_manager.ts","webpack://FortJs/./src/models/fort.ts","webpack://FortJs/./src/models/http_cookie.ts","webpack://FortJs/./src/models/http_file.ts","webpack://FortJs/./src/models/index.ts","webpack://FortJs/./src/models/router.ts","webpack://FortJs/./src/test_helpers/http_request_stub.ts","webpack://FortJs/./src/test_helpers/http_response_stub.ts","webpack://FortJs/./src/test_helpers/index.ts","webpack://FortJs/./src/test_helpers/init_controller.ts","webpack://FortJs/./src/test_helpers/init_guard.ts","webpack://FortJs/./src/test_helpers/init_shield.ts","webpack://FortJs/./src/test_helpers/init_wall.ts","webpack://FortJs/./src/utils/index.ts","webpack://FortJs/./src/utils/is_array.ts","webpack://FortJs/./src/utils/is_null.ts","webpack://FortJs/./src/utils/is_null_or_empty.ts","webpack://FortJs/external \"content-type\"","webpack://FortJs/external \"etag\"","webpack://FortJs/external \"fresh\"","webpack://FortJs/external \"fs\"","webpack://FortJs/external \"fs-extra\"","webpack://FortJs/external \"http\"","webpack://FortJs/external \"jsontoxml\"","webpack://FortJs/external \"multiparty\"","webpack://FortJs/external \"mustache\"","webpack://FortJs/external \"negotiator\"","webpack://FortJs/external \"path\"","webpack://FortJs/external \"querystring\"","webpack://FortJs/external \"uniqid\"","webpack://FortJs/external \"url\""],"names":[],"mappings":";;;;;;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AC/EA;AAAA;AAAA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CAAC,KAAK,CAAC,CAAC;AAChC,CAAC,CAAC;;;;;;;;;;;;;ACFF;AAAA;AAAO,IAAM,MAAM,GAAG,UAAC,KAAK;IACxB,OAAO,KAAK,IAAI,IAAI,CAAC;AACzB,CAAC,CAAC;;;;;;;;;;;;;ACFF;AAAA;AAAO,IAAM,aAAa,GAAG,UAAC,KAAa;IACvC,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;AAC/C,CAAC,CAAC;;;;;;;;;;;;ACFF,yC;;;;;;;;;;;ACAA,iC;;;;;;;;;;;ACAA,kC;;;;;;;;;;;ACAA,+B;;;;;;;;;;;ACAA,qC;;;;;;;;;;;ACAA,iC;;;;;;;;;;;ACAA,sC;;;;;;;;;;;ACAA,uC;;;;;;;;;;;ACAA,qC;;;;;;;;;;;ACAA,uC;;;;;;;;;;;ACAA,iC;;;;;;;;;;;ACAA,wC;;;;;;;;;;;ACAA,mC;;;;;;;;;;;ACAA,gC","file":"fort.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.ts\");\n","import { HttpRequest, HttpResponse, ControllerTestData } from \"../types\";\nimport { CookieManager, FileManager } from \"../models\";\nimport { SessionProvider } from \".\";\nimport { initController } from \"../test_helpers\";\n\n\nexport abstract class Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: string };\n body?: { [key: string]: any };\n session: SessionProvider;\n cookie: CookieManager;\n param?: { [key: string]: string };\n data: { [key: string]: any };\n\n file?: FileManager;\n\n constructor(...args) {\n\n }\n\n initialize(data?: ControllerTestData) {\n initController(this, data);\n }\n}","import { HttpRequest, HttpResponse, HttpResult } from \"../types\";\nimport { CookieManager, FileManager } from \"../models\";\nimport { Controller } from \"./controller\";\nimport { SessionProvider } from \"./session_provider\";\nimport { GuardTestData, initGuard } from \"../test_helpers\";\n\n\nexport abstract class Guard implements Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: string };\n body: { [key: string]: any };\n session: SessionProvider;\n cookie: CookieManager;\n param?: { [key: string]: string };\n data: { [key: string]: any };\n file: FileManager;\n abstract check(...args): Promise;\n\n constructor(...args) {\n\n }\n\n initialize(data?: GuardTestData) {\n return initGuard(this, data);\n }\n}","export * from './controller';\nexport * from './shield';\nexport * from './session_provider';\nexport * from './guard';\nexport * from './view_engine';\nexport * from './wall';\nexport * from \"./xml_parser\";","import { CookieManager } from \"../models\";\nimport * as getUniqId from \"uniqid\";\nimport { Global } from \"../global\";\nimport { SessionValue } from \"../types\";\n\nexport abstract class SessionProvider {\n\n sessionId: string;\n protected cookie: CookieManager;\n\n abstract get(key: string): Promise;\n abstract isExist(key: string): Promise;\n abstract getAll(): Promise;\n abstract set(key: string, val: any): Promise;\n abstract setMany(values: SessionValue[]): Promise;\n abstract remove(key: string): Promise;\n\n abstract clear(): Promise;\n\n protected createSession() {\n const now = new Date();\n this.sessionId = getUniqId();\n this.cookie.addCookie({\n name: Global.appSessionIdentifier,\n value: this.sessionId,\n httpOnly: true,\n path: \"/\",\n expires: new Date(now.setMinutes(now.getMinutes() + Global.sessionTimeOut)),\n maxAge: Global.sessionTimeOut * 60\n });\n }\n\n protected destroySession() {\n const cookie = this.cookie.getCookie(Global.appSessionIdentifier);\n cookie.httpOnly = true;\n cookie.path = \"/\";\n this.cookie.removeCookie(cookie);\n }\n}\n\n","import { HttpRequest, HttpResponse, HttpResult } from \"../types\";\nimport { CookieManager } from \"../models\";\nimport { SessionProvider, Controller } from \".\";\nimport { ShieldTestData, initShield } from \"../test_helpers\";\n\n\nexport abstract class Shield implements Controller {\n workerName: string;\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: string };\n\n session: SessionProvider;\n cookie: CookieManager;\n\n data: { [key: string]: any };\n\n abstract protect(...args): Promise;\n\n constructor(...args) {\n\n }\n\n initialize(data?: ShieldTestData) {\n return initShield(this, data);\n }\n}\n\n","import { ViewEngineData } from \"../types\";\n\nexport abstract class ViewEngine {\n abstract render(value: ViewEngineData): Promise;\n}","import { HttpRequest, HttpResponse, HttpResult } from \"../types\";\nimport { CookieManager } from \"../models\";\nimport { Controller } from \"./controller\";\nimport { SessionProvider } from \"./session_provider\";\nimport { WallTestData, initWall } from \"../test_helpers\";\n\n\nexport abstract class Wall implements Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: string };\n session: SessionProvider;\n cookie: CookieManager;\n\n data: { [key: string]: any };\n\n abstract onIncoming(...args): Promise;\n async onOutgoing(...args) {\n return null;\n }\n\n constructor(...args) {\n\n }\n\n initialize(data?: WallTestData) {\n return initWall(this, data);\n }\n}","export abstract class XmlParser {\n abstract async parse(xml: string): Promise;\n}","import { Global } from \"./global\";\n/* tslint:disable */\nexport const __ContentType = \"Content-Type\";\nexport const __AppName = \"fort\";\nexport const __Cookie = \"Cookie\";\nexport const __SetCookie = 'Set-Cookie';\nexport const __CurrentPath = process.cwd();\nexport const __ContentLength = \"Content-Length\";\nexport const __Constructor = \"const_constructor\";","import { InjectorHandler } from \"../handlers\";\nimport { __Constructor } from \"../constant\";\n\n// tslint:disable-next-line\nexport const Assign = (value): ParameterDecorator => {\n return (target: any, methodName: string, paramIndex: number) => {\n const className: string = target.name || target.constructor.name;\n if (methodName == null) {\n methodName = __Constructor;\n }\n InjectorHandler.addWorkerValue(className, methodName, paramIndex, value);\n };\n};","import { RouteHandler } from \"../handlers\";\nimport { HTTP_METHOD } from \"../enums\";\nimport { WorkerInfo } from \"../types\";\n\n// tslint:disable-next-line\nexport const DefaultWorker = (allowedMethods?: HTTP_METHOD[]): MethodDecorator => {\n return (target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className = (target.constructor.name as string);\n const actionInfo: WorkerInfo = {\n workerName: methodName,\n methodsAllowed: allowedMethods == null ? [HTTP_METHOD.Get] : allowedMethods,\n guards: [],\n pattern: \"/\",\n values: []\n };\n RouteHandler.addWorker(actionInfo, className);\n };\n};\n","import { RouteHandler } from \"../handlers\";\nimport { GenericGuard } from \"../generics\";\nimport { Guard } from \"../abstracts/guard\";\n\n// tslint:disable-next-line\nexport const Guards = (value: Array): MethodDecorator => {\n return ((target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className = (target.constructor.name as string);\n RouteHandler.addGuards(value as Array, className, methodName);\n });\n};","export * from './worker';\nexport * from './shields';\nexport * from './guards';\nexport * from './route';\nexport * from './default_worker';\nexport * from './assign';\nexport * from './singleton';","import { RouteHandler } from \"../handlers\";\nimport { removeLastSlash } from \"../helpers\";\n\n// tslint:disable-next-line\nexport const Route = (format: string): MethodDecorator => {\n return ((target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className = (target.constructor.name as string);\n // remove / from route\n if (format != null && format !== '/') {\n format = removeLastSlash(format);\n }\n RouteHandler.addPattern(format, className, methodName);\n });\n};","import { Shield } from \"../abstracts\";\nimport { RouteHandler } from \"../handlers\";\nimport { GenericShield } from \"../generics\";\n \n// tslint:disable-next-line\nexport const Shields = (shieldsValue: Array): ClassDecorator => {\n return (target: any) => {\n const className = target.name;\n RouteHandler.addShields(shieldsValue as Array, className);\n };\n};","import { InjectorHandler } from \"../handlers\";\nimport { __Constructor } from \"../constant\";\n\n// tslint:disable-next-line\nexport const Singleton = (value): ParameterDecorator => {\n return (target: any, methodName: string, paramIndex: number) => {\n const className: string = target.name || target.constructor.name;\n if (methodName == null || methodName === 'constructor') {\n methodName = __Constructor;\n }\n InjectorHandler.addSingleton(className, methodName, paramIndex, value);\n };\n};","import { HTTP_METHOD } from \"../enums\";\nimport { RouteHandler } from \"../handlers\";\nimport { WorkerInfo } from \"../types\";\n\n// tslint:disable-next-line\nexport const Worker = (allowedMethods?: HTTP_METHOD[]): MethodDecorator => {\n return (target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className = (target.constructor.name as string);\n const actionInfo: WorkerInfo = {\n workerName: methodName,\n methodsAllowed: allowedMethods == null ? [\n HTTP_METHOD.Delete, HTTP_METHOD.Get, HTTP_METHOD.Post, HTTP_METHOD.Patch, HTTP_METHOD.Put\n ] : allowedMethods,\n guards: [],\n pattern: `/${methodName.toLowerCase()}`,\n values: []\n };\n RouteHandler.addWorker(actionInfo, className);\n };\n};\n","export enum DATA_TYPE {\n String = \"string\",\n Number = \"number\",\n Array = \"array\",\n Object = \"object\",\n Function = \"function\"\n}","export enum ERROR_TYPE {\n InvalidControllerName = \"invalid_controller_name\",\n InvalidContentType = \"invalid_content_type\",\n PortInUse = \"port_in_use\",\n UndefinedViewEngine = \"undefined_view_engine\"\n}","export enum ETag_Type {\n Strong = \"strong\",\n Weak = \"weak\"\n}","export enum HTTP_METHOD {\n Get = \"GET\",\n Post = \"POST\",\n Put = \"PUT\",\n Patch = \"PATCH\",\n Delete = \"DELETE\",\n Options = \"OPTIONS\",\n Head = \"HEAD\"\n}","export enum HTTP_STATUS_CODE {\n BadRequest = 400,\n Unauthorized = 401,\n Forbidden = 403,\n NotFound = 404,\n Ok = 200,\n Created = 201,\n NoContent = 204,\n Redirect = 302,\n NotModified = 304,\n MethodNotAllowed = 405,\n NotAcceptable = 406,\n InternalServerError = 500,\n}","export * from './mime_type';\nexport * from './http_method';\nexport * from './http_status_code';\nexport * from \"./etag_type\";\nexport * from \"./error_type\";","export enum MIME_TYPE {\n Text = \"text/plain\",\n Json = \"application/json\",\n Html = \"text/html\",\n FormUrlEncoded = \"application/x-www-form-urlencoded\",\n Css = \"text/css\",\n Csv = \"text/csv\",\n Js = \"application/javascript\",\n Bmp = \"image/bmp\",\n Jpeg = \"image/jpeg\",\n Gif = \"image/gif\",\n Ico = \"image/x-icon\",\n Png = \"image/png\",\n Pdf = \"application/pdf\",\n Svg = \"image/svg+xml\",\n Rtf = \"application/rtf\",\n Xml = \"application/xml\",\n Xls = \"application/vnd.ms-excel\",\n Xlsx = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n Ttf = \"font/ttf\",\n Woff = \"font/woff\",\n Woff2 = \"font/woff2\",\n Eot = \"application/vnd.ms-fontobject\",\n Otf = \"font/otf\",\n Swf = \"application/x-shockwave-flash\",\n Avi = \"video/avi\",\n FormMultiPart = \"multipart/form-data\"\n\n}","export * from './mustache_view_engine';\nexport * from \"./memory_session_provider\";","\nimport { SessionProvider } from \"../abstracts/session_provider\";\nimport { SessionValue } from \"../types/session_value\";\n\n\ninterface ISessionValueFormat {\n identifier: string;\n datas: SessionValue[];\n}\n\nconst sessionValues: ISessionValueFormat[] = [];\n\nexport class MemorySessionProvider extends SessionProvider {\n\n async get(key: string) {\n const savedSession = sessionValues.find(q => q.identifier === this.sessionId);\n if (savedSession != null) {\n const session = savedSession.datas.find(qry => qry.key === key);\n return session.value;\n }\n return null;\n }\n\n async isExist(key: string) {\n const savedValue = sessionValues.find(q => q.identifier === this.sessionId);\n if (savedValue == null) {\n return false;\n }\n else {\n const index = savedValue.datas.findIndex(qry => qry.key === key);\n return index >= 0;\n }\n }\n\n async getAll() {\n const savedValue = sessionValues.find(q => q.identifier === this.sessionId);\n return savedValue == null ? [] : savedValue.datas;\n }\n\n async set(key: string, val: any) {\n const savedValue = sessionValues.find(q => q.identifier === this.sessionId);\n if (savedValue == null) {\n this.createSession();\n sessionValues.push({\n identifier: this.sessionId,\n datas: [{\n key: key,\n value: val\n }]\n });\n }\n else {\n const savedSessionData = savedValue.datas.find(q => q.key === key);\n if (savedSessionData == null) {\n savedValue.datas.push({\n key: key,\n value: val\n });\n }\n else {\n savedSessionData.value = val;\n }\n }\n }\n\n setMany(values: SessionValue[]) {\n return Promise.all(\n values.map(async (value) => {\n return await this.set(value.key, value.value);\n })\n );\n }\n\n async remove(key: string) {\n const savedValue = sessionValues.find(q => q.identifier === this.sessionId);\n if (savedValue != null) {\n const index = savedValue.datas.findIndex(q => q.key === key);\n savedValue.datas.splice(index, 1);\n }\n }\n\n async clear() {\n // remove session values\n const index = sessionValues.findIndex(q => q.identifier === this.sessionId);\n if (index >= 0) {\n sessionValues.splice(index, 1);\n }\n // expire cookie in browser\n this.destroySession();\n }\n}","import * as Mustache from \"mustache\";\nimport { ViewEngineData } from \"../types\";\nimport { getViewFromFile } from \"../helpers\";\nimport { ViewEngine } from \"../abstracts\";\n\nexport class MustacheViewEngine implements ViewEngine {\n\n async render(value: ViewEngineData) {\n const viewData = await getViewFromFile(value.view);\n return Mustache.render(viewData, value.model);\n }\n}","import { Controller } from \"../abstracts\";\n\nexport class GenericController extends Controller {\n constructor(...args) {\n super();\n }\n}","import { Guard } from \"../abstracts\";\nimport { HttpResult } from \"../types\";\n\nexport class GenericGuard extends Guard {\n\n constructor(...args) {\n super();\n }\n\n check(...args): Promise {\n return null;\n }\n}","import { SessionProvider } from \"../abstracts\";\nimport { SessionValue } from \"../types\";\nimport { CookieManager } from \"../models\";\n\n\nexport class GenericSessionProvider extends SessionProvider {\n sessionId: string;\n\n cookie: CookieManager;\n get() {\n return null;\n }\n\n getAll() {\n return null;\n }\n\n set(key, value) {\n return null;\n }\n\n isExist(key) {\n return null;\n }\n\n remove(key) {\n return null;\n }\n\n setMany(values: SessionValue[]): Promise {\n return null;\n }\n\n async clear() {\n\n }\n}","import { Shield } from \"../abstracts\";\nimport { HttpResult } from \"../types\";\n\nexport class GenericShield extends Shield {\n constructor(...args) {\n super();\n }\n \n protect(...args): Promise {\n return null;\n }\n}","import { Wall } from \"../abstracts\";\nimport { HttpResult } from \"../types\";\n\nexport class GenericWall extends Wall {\n constructor(...args) {\n super();\n }\n onIncoming(...args): Promise {\n return null;\n }\n}","import { XmlParser } from \"../abstracts\";\nimport { IException } from \"../interfaces\";\n\nexport class GenericXmlParser implements XmlParser {\n async parse(xml: string): Promise {\n // tslint:disable-next-line\n throw {\n message: \"no xml parser configured\"\n } as IException;\n }\n}","export * from './generic_guard';\nexport * from './generic_shield';\nexport * from './generic_session_provider';\nexport * from \"./generic_wall\";\nexport * from \"./generic_controller\";\nexport * from './generic_xml_parser';","import * as http from \"http\";\nimport { ErrorHandler } from \"./models\";\nimport { ViewEngine, XmlParser } from \"./abstracts\";\nimport { EtagOption, FolderMap } from \"./types\";\nimport { GenericSessionProvider, GenericWall } from \"./generics\";\n\nexport class Global {\n static request: http.IncomingMessage;\n static response: http.ServerResponse;\n static port: number;\n static viewPath: string;\n static shouldParseCookie: boolean;\n static shouldParsePost: boolean;\n static sessionProvider: typeof GenericSessionProvider;\n static sessionTimeOut?: number;\n static viewEngine: ViewEngine;\n static walls: Array = [];\n static errorHandler: typeof ErrorHandler;\n static connectonKeepAliveTimeout?: number;\n\n static appName?: string;\n\n static eTag?: EtagOption;\n\n static folders?: FolderMap[];\n static appSessionIdentifier: string;\n static xmlParser: typeof XmlParser;\n}","\nimport { HttpResult, HttpFormatResult } from \"../types\";\nimport { __SetCookie, __ContentType } from \"../constant\";\nimport { MIME_TYPE, HTTP_STATUS_CODE } from \"../enums\";\nimport { FileHandler } from \"./file_handler\";\nimport * as path from 'path';\nimport { XmlHelper, textResult } from \"../helpers\";\n\nexport class ControllerResultHandler extends FileHandler {\n private controllerResult_: HttpResult;\n\n private getDataBasedOnMimeType_(mimeType: MIME_TYPE) {\n switch (mimeType) {\n case MIME_TYPE.Json:\n case MIME_TYPE.Text:\n case MIME_TYPE.Html:\n if (typeof this.controllerResult_.responseData === 'object') {\n return JSON.stringify(this.controllerResult_.responseData);\n }\n break;\n case MIME_TYPE.Xml:\n if (typeof this.controllerResult_.responseData === 'object') {\n return XmlHelper.fromJsToXml(this.controllerResult_.responseData);\n }\n break;\n }\n return this.controllerResult_.responseData;\n }\n\n private endResponse_(negotiateMimeType: MIME_TYPE) {\n let data;\n try {\n data = this.getDataBasedOnMimeType_(negotiateMimeType);\n }\n catch (ex) {\n this.onErrorOccured(ex);\n return;\n }\n\n this.response.writeHead(this.controllerResult_.statusCode || HTTP_STATUS_CODE.Ok,\n { [__ContentType]: negotiateMimeType });\n this.response.end(data);\n }\n\n private handleRedirectResult_() {\n this.response.setHeader('Location', this.controllerResult_.responseData);\n this.response.writeHead(this.controllerResult_.statusCode || HTTP_STATUS_CODE.Ok,\n { 'Location': this.controllerResult_.responseData });\n this.response.end();\n }\n\n private handleFormatResult_() {\n const negotiateMimeType = this.getContentTypeFromNegotiationHavingMultipleTypes(Object.keys((this.controllerResult_ as HttpFormatResult).responseFormat) as MIME_TYPE[]);\n const key = Object.keys((this.controllerResult_ as HttpFormatResult).responseFormat).find(qry => qry === negotiateMimeType);\n if (key != null) {\n this.controllerResult_.responseData = (this.controllerResult_ as HttpFormatResult).responseFormat[key]();\n this.endResponse_(negotiateMimeType);\n }\n else {\n this.onNotAcceptableRequest();\n }\n }\n\n private handleFileResult_() {\n const result = this.controllerResult_;\n const parsedPath = path.parse(result.file.filePath);\n if (result.file.shouldDownload === true) {\n const fileName = result.file.alias == null ? parsedPath.name : result.file.alias;\n this.response.setHeader(\n \"Content-Disposition\",\n `attachment;filename=${fileName}${parsedPath.ext}`\n );\n }\n this.handleFileRequestFromAbsolutePath(result.file.filePath, parsedPath.ext);\n }\n\n onTerminationFromWall(result: HttpResult | HttpFormatResult) {\n this.handleFinalResult_(result);\n }\n\n private handleFinalResult_(result: HttpResult | HttpFormatResult) {\n result = result || textResult(\"\");\n this.controllerResult_ = result as HttpResult;\n\n ((this.cookieManager as any).responseCookie_ as string[]).forEach(value => {\n this.response.setHeader(__SetCookie, value);\n });\n\n if ((result as HttpResult).shouldRedirect == null || (result as HttpResult).shouldRedirect === false) {\n if ((result as HttpFormatResult).responseFormat == null) {\n if ((result as HttpResult).file == null) {\n const contentType = (result as HttpResult).contentType || MIME_TYPE.Text;\n const negotiateMimeType = this.getContentTypeFromNegotiation(contentType) as MIME_TYPE;\n if (negotiateMimeType != null) {\n this.endResponse_(negotiateMimeType);\n }\n else {\n this.onNotAcceptableRequest();\n }\n }\n else {\n this.handleFileResult_();\n }\n }\n else {\n this.handleFormatResult_();\n }\n }\n else {\n this.handleRedirectResult_();\n }\n }\n\n async onResultFromController(result: HttpResult | HttpFormatResult) {\n try {\n await this.runWallOutgoing();\n } catch (ex) {\n this.onErrorOccured(ex);\n return;\n }\n this.handleFinalResult_(result);\n }\n}","import { HTTP_STATUS_CODE, MIME_TYPE, ETag_Type } from \"../enums\";\nimport { Global } from \"../global\";\nimport * as path from \"path\";\nimport { __ContentType } from \"../constant\";\nimport { RequestHandlerHelper } from \"./request_handler_helper\";\nimport * as Fs from \"fs\";\nimport { getMimeTypeFromExtension, promise } from \"../helpers\";\nimport * as etag from \"etag\";\nimport * as fresh from \"fresh\";\nimport { isNullOrEmpty } from \"../utils\";\n\ntype FileInfo = {\n folder: string,\n file: string;\n};\nexport class FileHandler extends RequestHandlerHelper {\n\n private getFileInfoFromUrl_(urlPath: string) {\n const splittedValue = urlPath.split(\"/\");\n const fileInfo = {\n file: \"\"\n } as FileInfo;\n if (splittedValue.length > 2 || !isNullOrEmpty(path.parse(urlPath).ext)) {\n fileInfo.folder = splittedValue[1];\n fileInfo.file = splittedValue.splice(2).join(\"/\");\n return fileInfo;\n }\n fileInfo.folder = splittedValue[1];\n return fileInfo;\n\n }\n\n private getFileStats_(filePath) {\n return promise((res, rej) => {\n Fs.lstat(filePath, (err, status) => {\n if (err) {\n if (err.code === 'ENOENT') {\n res(null);\n }\n else {\n rej(err);\n }\n }\n else {\n res(status);\n }\n });\n });\n }\n\n protected handleFileRequestFromAbsolutePath(absolutePath: string, fileType: string) {\n this.getFileStats_(absolutePath).then(fileInfo => {\n if (fileInfo != null) {\n if (fileInfo.isDirectory() === true) {\n this.handleFileRequestForPath_(absolutePath);\n }\n else {\n this.sendFile_(absolutePath, fileType, fileInfo);\n }\n }\n else {\n this.onNotFound();\n }\n }).catch(ex => {\n this.onErrorOccured(ex);\n });\n }\n\n private checkForFolderAllowAndReturnPath_(urlPath: string) {\n const fileInfo = this.getFileInfoFromUrl_(urlPath);\n const getAbsPath = function () {\n const folder = Global.folders.find(qry => qry.alias === fileInfo.folder);\n if (folder != null) {\n return path.join(folder.path, fileInfo.file);\n }\n return null;\n };\n let absPath = getAbsPath();\n if (absPath == null) {\n fileInfo.folder = \"/\";\n fileInfo.file = urlPath;\n absPath = getAbsPath();\n }\n return absPath;\n }\n\n protected handleFileRequest(urlPath: string) {\n const extension = path.parse(urlPath).ext;\n const absFilePath = this.checkForFolderAllowAndReturnPath_(urlPath);\n if (absFilePath != null) {\n this.handleFileRequestFromAbsolutePath(absFilePath, extension);\n }\n else {\n this.onNotFound();\n }\n }\n\n /**\n * process folders handling asuuming path is folder.\n * Please check whether the file is folder before calling this function\n *\n * @private\n * @param {string} filePath\n * @param {Fs.Stats} fileInfo\n * @returns\n * @memberof FileHandler\n */\n private handleFileRequestForPath_(absolutePath: string) {\n\n absolutePath = path.join(absolutePath, \"index.html\");\n this.getFileStats_(absolutePath).then(fileInfo => {\n if (fileInfo != null) {\n const fileType = MIME_TYPE.Html;\n this.sendFile_(absolutePath, fileType, fileInfo);\n }\n else {\n this.onNotFound();\n }\n }).catch(ex => {\n this.onErrorOccured(ex);\n });\n }\n\n private isClientHasFreshFile_(lastModified: string, etagValue: string) {\n return fresh(this.request.headers, {\n 'etag': etagValue,\n 'last-modified': lastModified\n });\n }\n\n private sendFile_(filePath: string, fileType: string, fileInfo: Fs.Stats) {\n this.runWallOutgoing().then(() => {\n let mimeType;\n if (fileType[0] === '.') { // its extension\n mimeType = getMimeTypeFromExtension(fileType);\n }\n else { // mime type\n mimeType = fileType;\n }\n const negotiateMimeType = this.getContentTypeFromNegotiation(mimeType) as MIME_TYPE;\n if (negotiateMimeType != null) {\n const lastModified = fileInfo.mtime.toUTCString();\n const eTagValue = etag(fileInfo, {\n weak: Global.eTag.type === ETag_Type.Weak\n });\n if (this.isClientHasFreshFile_(lastModified, eTagValue)) { // client has fresh file\n this.response.statusCode = HTTP_STATUS_CODE.NotModified;\n this.response.end();\n }\n else {\n this.response.writeHead(HTTP_STATUS_CODE.Ok, {\n [__ContentType]: mimeType,\n 'Etag': eTagValue,\n 'Last-Modified': lastModified\n });\n const readStream = Fs.createReadStream(filePath);\n // Handle non-existent file\n readStream.on('error', this.onErrorOccured.bind(this));\n readStream.pipe(this.response);\n }\n }\n else {\n this.onNotAcceptableRequest();\n }\n }).catch(ex => {\n this.onErrorOccured(ex);\n });\n }\n}","export * from \"./route_handler\";\nexport * from \"./request_handler\";\nexport * from \"./file_handler\";\nexport * from \"./request_handler_helper\";\nexport * from \"./controller_result_handler\";\nexport * from \"./post_handler\";\nexport * from './injector_handler';","import { __Constructor } from \"../constant\";\n\ntype InjectorStoreInfo = {\n className: string;\n methods: {\n [methodName: string]: any[]\n }\n};\n// this stores information of injector values that are available per class & worker\nconst injectorStoreInfos: InjectorStoreInfo[] = [];\n// this stores injector values\nconst injectorValues: any[] = [];\n// this stores the singletons name & their respective index in injector values\nconst singletons: {\n [className: string]: number\n} = {};\nexport class InjectorHandler {\n\n static addWorkerValue(className: string, methodName: string, paramIndex, paramValue, shouldFindIndex = true): number {\n\n if (shouldFindIndex === true) {\n const paramValueIndex = injectorValues.indexOf(paramValue);\n if (paramValueIndex < 0) {\n paramValue = injectorValues.push(paramValue) - 1;\n }\n else {\n paramValue = paramValueIndex;\n }\n }\n \n\n const savedValue = injectorStoreInfos.find(x => x.className === className);\n const value: InjectorStoreInfo = {\n className: className,\n methods: {\n [methodName]: []\n }\n };\n if (savedValue == null) {\n value.methods[methodName][paramIndex] = paramValue;\n injectorStoreInfos.push(value);\n }\n else {\n // const savedMethod = savedValue.methods[methodName];\n if (savedValue.methods[methodName] == null) {\n savedValue.methods[methodName] = [];\n }\n savedValue.methods[methodName][paramIndex] = paramValue;\n }\n\n return paramValue;\n }\n\n static getConstructorValues(className: string) {\n return this.getMethodValues(className, __Constructor);\n }\n\n static getMethodValues(className: string, methodName: string) {\n const savedValue = injectorStoreInfos.find(qry => qry.className === className);\n if (savedValue != null) {\n const methodArgs = savedValue.methods[methodName];\n if (methodArgs != null) {\n return methodArgs.map(injectorValueIndex => {\n return injectorValues[injectorValueIndex];\n });\n }\n }\n return [];\n }\n\n static addSingleton(className: string, methodName: string, paramIndex, paramValue) {\n const singletonClassName = paramValue.name;\n if (singletonClassName) {\n if (singletons[singletonClassName] == null) {\n singletons[singletonClassName] = InjectorHandler.addWorkerValue(className, methodName, paramIndex, new paramValue());\n }\n else {\n InjectorHandler.addWorkerValue(className, methodName, paramIndex, singletons[singletonClassName], false);\n }\n }\n }\n}","import { ControllerResultHandler } from \"./controller_result_handler\";\nimport { promise, JsonHelper } from \"../helpers\";\nimport { __ContentType } from \"../constant\";\nimport { MIME_TYPE } from \"../enums\";\nimport * as ContentType from \"content-type\";\nimport * as QueryString from 'querystring';\nimport * as Multiparty from \"multiparty\";\nimport { MultiPartParseResult } from \"../types\";\nimport { FileManager } from \"../models\";\nimport { Global } from \"../global\";\n\n\nexport class PostHandler extends ControllerResultHandler {\n protected body: any;\n protected file: FileManager;\n\n private getPostRawData_(): Promise {\n const body = [];\n return promise((res, rej) => {\n this.request.on('data', (chunk) => {\n body.push(chunk);\n }).on('end', () => {\n const bodyBuffer = Buffer.concat(body);\n res(bodyBuffer.toString());\n }).on(\"error\", function (err) {\n rej(err);\n });\n });\n }\n\n private parseMultiPartData_(): Promise {\n return promise((res, rej) => {\n new Multiparty.Form().parse(this.request, (err, fields, files) => {\n if (err) {\n rej(err);\n }\n else {\n const result: MultiPartParseResult = {\n field: {},\n file: {}\n };\n for (const field in fields) {\n result.field[field] = fields[field].length === 1 ? fields[field][0] : fields[field];\n }\n for (const file in files) {\n result.file[file] = files[file].length === 1 ? files[file][0] : files[file];\n }\n res(result);\n }\n });\n });\n }\n\n protected async parsePostData() {\n\n let postData;\n\n let contentType = this.request.headers[__ContentType] || this.request.headers[\"content-type\"];\n if (contentType != null) {\n contentType = ContentType.parse(contentType as string).type;\n }\n if (contentType === MIME_TYPE.FormMultiPart) {\n const result = await this.parseMultiPartData_();\n postData = result.field;\n this.file = new FileManager(result.file);\n }\n else {\n this.file = new FileManager({});\n const bodyDataAsString = await this.getPostRawData_();\n switch (contentType) {\n case MIME_TYPE.Json:\n postData = JsonHelper.parse(bodyDataAsString);\n break;\n case MIME_TYPE.Text:\n case MIME_TYPE.Html:\n postData = bodyDataAsString; break;\n case MIME_TYPE.FormUrlEncoded:\n postData = QueryString.parse(bodyDataAsString); break;\n case MIME_TYPE.Xml:\n postData = new (Global as any).xmlParser().parse(bodyDataAsString);\n break;\n default:\n postData = {};\n }\n }\n\n return postData;\n\n }\n}","import * as http from \"http\";\nimport * as url from 'url';\nimport { Controller } from \"../abstracts\";\nimport { __ContentType, __AppName, __Cookie, __SetCookie } from \"../constant\";\nimport { Global } from \"../global\";\nimport { parseCookie, parseAndMatchRoute, promise } from \"../helpers\";\nimport { CookieManager, FileManager } from \"../models\";\nimport { GenericSessionProvider, GenericGuard } from \"../generics\";\nimport { RouteMatch, HttpRequest, HttpResponse } from \"../types\";\nimport { HTTP_METHOD } from \"../enums\";\nimport { PostHandler } from \"./post_handler\";\nimport { InjectorHandler } from \"./injector_handler\";\n\n\nexport class RequestHandler extends PostHandler {\n\n private session_: GenericSessionProvider;\n private query_: any;\n private data_ = {};\n private routeMatchInfo_: RouteMatch;\n\n\n constructor(request: http.IncomingMessage, response: http.ServerResponse) {\n super();\n this.request = request;\n this.response = response;\n this.registerEvents_();\n }\n\n private registerEvents_() {\n this.request.on('error', this.onBadRequest.bind(this));\n this.response.on('error', this.onErrorOccured.bind(this));\n }\n\n private executeWallIncoming_(): Promise {\n return promise((res) => {\n let index = 0;\n const wallLength = Global.walls.length;\n const executeWallIncomingByIndex = async () => {\n if (wallLength > index) {\n const wall = Global.walls[index++];\n const constructorArgsValues = InjectorHandler.getConstructorValues(wall.name);\n const wallObj = new wall(...constructorArgsValues);\n wallObj.cookie = this.cookieManager;\n wallObj.session = this.session_;\n wallObj.request = this.request as HttpRequest;\n wallObj.response = this.response as HttpResponse;\n wallObj.data = this.data_;\n wallObj.query = this.query_;\n this.wallInstances.push(wallObj);\n const methodArgsValues = InjectorHandler.getMethodValues(wall.name, 'onIncoming');\n try {\n const result = await wallObj.onIncoming(...methodArgsValues);\n if (result == null) {\n executeWallIncomingByIndex();\n }\n else {\n res(false);\n this.onTerminationFromWall(result);\n }\n } catch (ex) {\n this.onErrorOccured(ex);\n res(false);\n }\n }\n else {\n res(true);\n }\n };\n executeWallIncomingByIndex();\n });\n }\n\n private runController_() {\n const constructorValues = InjectorHandler.getConstructorValues(this.routeMatchInfo_.controller.name);\n const controllerObj: Controller = new this.routeMatchInfo_.controller(...constructorValues);\n controllerObj.request = this.request as HttpRequest;\n controllerObj.response = this.response;\n controllerObj.query = this.query_;\n controllerObj.body = this.body;\n controllerObj.session = this.session_;\n controllerObj.cookie = this.cookieManager;\n controllerObj.param = this.routeMatchInfo_.params;\n controllerObj.data = this.data_;\n controllerObj.file = this.file;\n const methodArgsValues = InjectorHandler.getMethodValues(this.routeMatchInfo_.controller.name, this.routeMatchInfo_.workerInfo.workerName);\n controllerObj[this.routeMatchInfo_.workerInfo.workerName](...methodArgsValues).then(\n this.onResultFromController.bind(this)\n ).catch(this.onErrorOccured.bind(this));\n }\n\n private executeShieldsProtection_(): Promise {\n return promise((res) => {\n let index = 0;\n const shieldLength = this.routeMatchInfo_.shields.length;\n const executeShieldByIndex = async () => {\n if (shieldLength > index) {\n const shield = this.routeMatchInfo_.shields[index++];\n const constructorArgsValues = InjectorHandler.getConstructorValues(shield.name);\n const shieldObj = new shield(...constructorArgsValues);\n shieldObj.cookie = this.cookieManager;\n shieldObj.query = this.query_;\n shieldObj.session = this.session_;\n shieldObj.request = this.request as HttpRequest;\n shieldObj.response = this.response as HttpResponse;\n shieldObj.data = this.data_;\n shieldObj.workerName = this.routeMatchInfo_.workerInfo.workerName;\n const methodArgsValues = InjectorHandler.getMethodValues(shield.name, 'protect');\n\n try {\n const result = await shieldObj.protect(...methodArgsValues);\n if (result == null) {\n executeShieldByIndex();\n }\n else {\n res(false);\n this.onResultFromController(result);\n }\n } catch (ex) {\n this.onErrorOccured(ex);\n res(false);\n }\n }\n else {\n res(true);\n }\n };\n executeShieldByIndex();\n });\n }\n\n private executeGuardsCheck_(guards: Array): Promise {\n return promise((res) => {\n let index = 0;\n const shieldLength = guards.length;\n const executeGuardByIndex = async () => {\n if (shieldLength > index) {\n const guard = guards[index++];\n const constructorArgsValues = InjectorHandler.getConstructorValues(guard.name);\n const guardObj = new guard(...constructorArgsValues);\n guardObj.body = this.body;\n guardObj.cookie = this.cookieManager;\n guardObj.query = this.query_;\n guardObj.session = this.session_;\n guardObj.request = this.request as HttpRequest;\n guardObj.response = this.response as HttpResponse;\n guardObj.data = this.data_;\n guardObj.file = this.file;\n guardObj.param = this.routeMatchInfo_.params;\n const methodArgsValues = InjectorHandler.getMethodValues(guard.name, 'check');\n try {\n const result = await guardObj.check(...methodArgsValues);\n if (result == null) {\n executeGuardByIndex();\n }\n else {\n res(false);\n this.onResultFromController(result);\n }\n } catch (ex) {\n this.onErrorOccured(ex);\n res(false);\n }\n }\n else {\n res(true);\n }\n };\n executeGuardByIndex();\n });\n }\n\n private parseCookieFromRequest_() {\n if (Global.shouldParseCookie === true) {\n const rawCookie = (this.request.headers[__Cookie] || this.request.headers[\"cookie\"]) as string;\n let parsedCookies;\n try {\n parsedCookies = parseCookie(rawCookie);\n } catch (ex) {\n this.onErrorOccured(ex);\n return false;\n }\n this.session_ = new Global.sessionProvider();\n this.session_.cookie = this.cookieManager = new CookieManager(parsedCookies);\n this.session_.sessionId = parsedCookies[Global.appSessionIdentifier];\n }\n else {\n this.cookieManager = new CookieManager({});\n }\n return true;\n }\n\n private setPreHeader_() {\n this.response.setHeader('X-Powered-By', Global.appName);\n this.response.setHeader('Vary', 'Accept-Encoding');\n this.response.sendDate = true;\n }\n\n private async onRouteMatched_() {\n const actionInfo = this.routeMatchInfo_.workerInfo;\n if (actionInfo == null) {\n if (this.request.method === HTTP_METHOD.Options) {\n this.onRequestOptions(this.routeMatchInfo_.allowedHttpMethod);\n }\n else {\n this.onMethodNotAllowed(this.routeMatchInfo_.allowedHttpMethod);\n }\n }\n else {\n let shouldExecuteNextComponent = await this.executeShieldsProtection_();\n if (shouldExecuteNextComponent === true) {\n shouldExecuteNextComponent = await this.handlePostData();\n if (shouldExecuteNextComponent === true) {\n shouldExecuteNextComponent = await this.executeGuardsCheck_(actionInfo.guards);\n if (shouldExecuteNextComponent === true) {\n this.runController_();\n }\n }\n }\n }\n }\n\n private async execute_() {\n const urlDetail = url.parse(this.request.url, true);\n this.query_ = urlDetail.query;\n let shouldExecuteNextProcess = this.parseCookieFromRequest_();\n if (shouldExecuteNextProcess === true) {\n shouldExecuteNextProcess = await this.executeWallIncoming_();\n if (shouldExecuteNextProcess === true) {\n const pathUrl = urlDetail.pathname;\n const requestMethod = this.request.method as HTTP_METHOD;\n try {\n this.routeMatchInfo_ = parseAndMatchRoute(pathUrl.toLowerCase(), requestMethod);\n }\n catch (ex) {\n this.onErrorOccured(ex);\n return;\n }\n if (this.routeMatchInfo_ == null) { // no route matched\n // it may be a file or folder then\n this.handleFileRequest(pathUrl);\n }\n else {\n this.onRouteMatched_();\n }\n }\n }\n }\n\n async handlePostData() {\n if (this.request.method === HTTP_METHOD.Get) {\n this.body = {};\n this.file = new FileManager({});\n }\n else if (Global.shouldParsePost === true) {\n try {\n this.body = await this.parsePostData();\n } catch (ex) {\n this.onBadRequest(ex);\n return false;\n }\n }\n return true;\n }\n\n async handle() {\n this.setPreHeader_();\n this.execute_();\n }\n}","import { HTTP_STATUS_CODE, MIME_TYPE, HTTP_METHOD } from \"../enums\";\nimport * as http from \"http\";\nimport { __ContentType } from \"../constant\";\nimport { Global } from \"../global\";\nimport * as Negotiator from \"negotiator\";\nimport { CookieManager } from \"../models\";\nimport { Wall } from \"../abstracts\";\nimport { IException } from \"../interfaces\";\nimport { JsonHelper, reverseLoop } from \"../helpers\";\nimport { isNull } from \"../utils\";\nimport { InjectorHandler } from \"./injector_handler\";\n\n\nexport class RequestHandlerHelper {\n protected cookieManager: CookieManager;\n protected response: http.ServerResponse;\n protected request: http.IncomingMessage;\n\n protected wallInstances: Wall[] = [];\n\n protected runWallOutgoing() {\n const outgoingResults: Array> = [];\n reverseLoop(this.wallInstances, (value: Wall) => {\n const methodArgsValues = InjectorHandler.getMethodValues(value.constructor.name, 'onOutgoing');\n outgoingResults.push(value.onOutgoing(methodArgsValues));\n });\n return Promise.all(outgoingResults);\n }\n\n protected getContentTypeFromNegotiation(type: MIME_TYPE) {\n const negotiator = new Negotiator(this.request);\n let availableTypes: MIME_TYPE[] = this.getAvailableTypes_(type);\n if (availableTypes == null) {\n availableTypes = [type];\n }\n return negotiator.mediaType(availableTypes) as MIME_TYPE;\n }\n\n protected getContentTypeFromNegotiationHavingMultipleTypes(types: MIME_TYPE[]) {\n const negotiator = new Negotiator(this.request);\n return negotiator.mediaType(types) as MIME_TYPE;\n }\n\n private getAvailableTypes_(type: MIME_TYPE) {\n switch (type) {\n case MIME_TYPE.Json:\n case MIME_TYPE.Xml:\n return [MIME_TYPE.Json, MIME_TYPE.Xml];\n case MIME_TYPE.Html:\n case MIME_TYPE.Css:\n case MIME_TYPE.Csv:\n case MIME_TYPE.Js:\n case MIME_TYPE.Rtf:\n case MIME_TYPE.Text:\n return [MIME_TYPE.Text, MIME_TYPE.Html, MIME_TYPE.Js,\n MIME_TYPE.Css, MIME_TYPE.Rtf, MIME_TYPE.Csv];\n }\n return null;\n }\n\n protected async onBadRequest(error) {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onBadRequest(error);\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.writeHead(HTTP_STATUS_CODE.BadRequest, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onForbiddenRequest() {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onForbiddenRequest();\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.writeHead(HTTP_STATUS_CODE.Forbidden, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onNotAcceptableRequest() {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onNotAcceptableRequest();\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.writeHead(HTTP_STATUS_CODE.NotAcceptable, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onNotFound() {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onNotFound(this.request.url);\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.writeHead(HTTP_STATUS_CODE.NotFound, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onMethodNotAllowed(allowedMethods: HTTP_METHOD[]) {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onMethodNotAllowed();\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.setHeader(\"Allow\", allowedMethods.join(\",\"));\n this.response.writeHead(HTTP_STATUS_CODE.MethodNotAllowed, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onErrorOccured(error) {\n if (typeof error === 'string') {\n error = {\n message: error\n } as IException;\n }\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onServerError(error);\n }\n catch (ex) {\n this.response.writeHead(HTTP_STATUS_CODE.InternalServerError, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(JsonHelper.stringify(ex));\n return;\n }\n this.response.writeHead(HTTP_STATUS_CODE.InternalServerError, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onRequestOptions(allowedMethods: HTTP_METHOD[]) {\n try {\n await this.runWallOutgoing();\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.setHeader(\"Allow\", allowedMethods.join(\",\"));\n this.response.writeHead(HTTP_STATUS_CODE.Ok, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(\"\");\n }\n}","import { RouteInfo, WorkerInfo, ParentRoute } from \"../types\";\nimport { GenericShield, GenericGuard } from \"../generics\";\nimport { isNull } from \"../utils\";\n\nconst routerCollection: RouteInfo[] = [];\n\nconst getActionPattern = (parentRoute: ParentRoute, pattern: string) => {\n return (isNull(parentRoute.path) || parentRoute.path === \"*\") ? pattern : `/${parentRoute.path}${pattern}`;\n};\n\nexport class RouteHandler {\n\n static get routerCollection() {\n return routerCollection;\n }\n\n static addToRouterCollection(value: ParentRoute) {\n const route = routerCollection.find(x => x.controllerName === value.controller.name);\n if (route == null) {\n routerCollection.push({\n workers: [],\n controller: value.controller as any,\n controllerName: value.controller.name,\n path: value.path,\n shields: [],\n values: []\n });\n }\n else {\n route.controller = value.controller as any;\n route.path = value.path;\n // change pattern value since we have controller name now.\n route.workers.forEach(actionInfo => {\n actionInfo.pattern = getActionPattern(value, actionInfo.pattern);\n });\n }\n } \n\n static addShields(shields: Array, className: string) {\n const index = routerCollection.findIndex(x => x.controllerName === className);\n if (index < 0) {\n routerCollection.push({\n workers: [],\n controller: null,\n controllerName: className,\n shields: shields,\n path: null,\n values: []\n });\n }\n else {\n routerCollection[index].shields = shields;\n }\n }\n\n static addWorker(newAction: WorkerInfo, className: string) {\n const router = routerCollection.find(x => x.controllerName === className);\n if (router == null) {\n routerCollection.push({\n workers: [newAction],\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = router.workers.find(val => val.workerName === newAction.workerName);\n if (savedAction == null) {\n newAction.pattern = getActionPattern(router, newAction.pattern);\n router.workers.push(newAction);\n }\n else {\n savedAction.methodsAllowed = newAction.methodsAllowed;\n savedAction.pattern = router.path == null ? savedAction.pattern : `/${router.path}${savedAction.pattern}`;\n }\n }\n }\n\n static addGuards(guards: Array, className: string, actionName: string) {\n const index = routerCollection.findIndex(x => x.controllerName === className);\n const pattern = actionName.toLowerCase();\n if (index < 0) {\n routerCollection.push({\n workers: [{\n workerName: actionName,\n guards: guards,\n methodsAllowed: null,\n pattern: pattern,\n values: []\n }],\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = routerCollection[index].workers.find(val => val.workerName === actionName);\n if (savedAction == null) {\n routerCollection[index].workers.push({\n workerName: actionName,\n guards: guards,\n methodsAllowed: null,\n pattern: pattern,\n values: []\n });\n }\n else {\n savedAction.guards = guards;\n }\n }\n }\n\n static addPattern(pattern: string, className: string, actionName: string) {\n const router = routerCollection.find(x => x.controllerName === className);\n if (router == null) {\n routerCollection.push({\n workers: [{\n workerName: actionName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: []\n }],\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = router.workers.find(val => val.workerName === actionName);\n pattern = getActionPattern(router, pattern);\n if (savedAction == null) {\n router.workers.push({\n workerName: actionName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: []\n });\n }\n else {\n savedAction.pattern = pattern;\n }\n }\n }\n}","\nimport { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const downloadResult = (filePath: string, downloadFileName?: string) => {\n return {\n statusCode: HTTP_STATUS_CODE.Ok,\n file: {\n filePath: filePath,\n shouldDownload: true,\n alias: downloadFileName\n }\n } as HttpResult;\n};","\nimport { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const fileResult = (filePath: string) => {\n return {\n statusCode: HTTP_STATUS_CODE.Ok,\n file: {\n filePath: filePath\n }\n } as HttpResult;\n};","import { DATA_TYPE } from \"../enums/data_type\";\n\nexport const getDataType = (value) => {\n const type = typeof value;\n switch (type) {\n case 'object':\n if (Array.isArray(value)) {\n return DATA_TYPE.Array;\n }\n default:\n return type;\n }\n};","import { MIME_TYPE } from \"../enums\";\n\nexport const getMimeTypeFromExtension = (ext: string): MIME_TYPE => {\n switch (ext) {\n case \".htm\":\n case \".html\":\n return MIME_TYPE.Html;\n case \".css\":\n return MIME_TYPE.Css;\n case \".js\":\n return MIME_TYPE.Js;\n case \".png\":\n return MIME_TYPE.Png;\n case \".woff\":\n return MIME_TYPE.Woff;\n case \".woff2\":\n return MIME_TYPE.Woff2;\n case \".json\":\n return MIME_TYPE.Json;\n case \".txt\":\n return MIME_TYPE.Text;\n case \".jpg\":\n case \".jpeg\":\n return MIME_TYPE.Jpeg;\n case \".rtf\":\n return MIME_TYPE.Rtf;\n case \".ttf\":\n return MIME_TYPE.Ttf;\n case \".eot\":\n return MIME_TYPE.Eot;\n case '.otf':\n return MIME_TYPE.Otf;\n case \".swf\":\n return MIME_TYPE.Swf;\n case \".avi\":\n return MIME_TYPE.Avi;\n case \".Svg\":\n return MIME_TYPE.Svg;\n case \".pdf\":\n return MIME_TYPE.Pdf;\n case \".xml\":\n return MIME_TYPE.Xml;\n case \".csv\":\n return MIME_TYPE.Csv;\n case \".xls\":\n return MIME_TYPE.Xls;\n case \".xlsx\":\n return MIME_TYPE.Xlsx;\n case \".bmp\":\n return MIME_TYPE.Bmp;\n case \".gif\":\n return MIME_TYPE.Gif;\n default:\n return \"application/octet-stream\" as MIME_TYPE;\n }\n};","import { readFile } from \"fs-extra\";\nimport { isEnvProduction } from \"./is_env_production\";\nimport * as path from \"path\";\nimport { Global } from \"../global\";\nimport { __CurrentPath } from \"../constant\";\n\nconst viewCache = {\n\n};\nexport const getViewFromFile = async function (fileLocation: string): Promise {\n const readView = function () {\n const pathOfView = path.join(__CurrentPath, `${Global.viewPath}/${fileLocation}`);\n return readFile(pathOfView, {\n encoding: 'utf8'\n });\n };\n\n if (isEnvProduction()) {\n if (viewCache[fileLocation] == null) {\n viewCache[fileLocation] = await readView();\n }\n return viewCache[fileLocation];\n\n }\n return await readView();\n};","import { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const htmlResult = (html: string, statusCode?: HTTP_STATUS_CODE) => {\n return {\n contentType: MIME_TYPE.Html,\n responseData: html,\n statusCode: statusCode || HTTP_STATUS_CODE.Ok\n } as HttpResult;\n};","export * from './json_result';\nexport * from './text_result';\nexport * from './html_result';\nexport * from './render_view';\nexport * from './download_result';\nexport * from './file_result';\nexport * from './redirect_result';\nexport * from './view_result';\nexport * from './get_view_from_file';\nexport * from \"./promise\";\nexport * from './log_helper';\nexport * from './xml_helper';\nexport * from \"./get_mime_type_from_extension\";\nexport * from \"./parse_match_route\";\nexport * from \"./parse_cookie\";\nexport * from './json_helper';\nexport * from './remove_last_slash';\nexport * from './remove_first_slash';\nexport * from './reverse_loop';","export const isEnvDev = () => {\n return process.env.NODE_ENV === 'development';\n};","export const isEnvProduction = () => {\n return process.env.NODE_ENV === \"production\";\n};","import { IException } from \"../interfaces\";\n\nexport class JsonHelper {\n static parse(value: string) {\n try {\n return JSON.parse(value);\n }\n catch (ex) {\n // tslint:disable-next-line\n throw {\n message: \"Post data is invalid\"\n } as IException;\n }\n }\n\n static stringify(value) {\n return JSON.stringify(value);\n }\n}","\nimport { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const jsonResult = (value: any, statusCode?: HTTP_STATUS_CODE) => {\n return {\n contentType: MIME_TYPE.Json,\n responseData: value,\n statusCode: statusCode || HTTP_STATUS_CODE.Ok\n } as HttpResult;\n};","import { IError } from \"../interfaces/error\";\nimport { ERROR_TYPE } from \"../enums/error_type\";\n\nexport class LogHelper implements IError {\n type: ERROR_TYPE;\n message: string;\n private info_: any;\n\n constructor(type: ERROR_TYPE, info?: any) {\n this.type = type;\n this.info_ = info;\n this.message = this.getMsg_();\n }\n\n throw() {\n const errMsg = this.get();\n throw JSON.stringify(errMsg);\n }\n\n static log(msg) {\n console.log(msg);\n }\n\n logError() {\n console.error(this.get());\n }\n\n logWarning() {\n console.warn(this.get());\n }\n\n get() {\n return {\n message: this.message,\n type: this.type\n } as IError;\n }\n\n private getMsg_() {\n let errMsg: string;\n switch (this.type) {\n case ERROR_TYPE.InvalidControllerName:\n errMsg = `Invalid controller name - '${this.info_}'. Controller name must contain 'controller'.`;\n break;\n case ERROR_TYPE.InvalidContentType:\n errMsg = `Content type - '${this.info_}' is not valid. Please create an issue if you think this is valid type.`;\n break;\n case ERROR_TYPE.PortInUse:\n errMsg = `Port ${this.info_} is being used by another process.`;\n break;\n case ERROR_TYPE.UndefinedViewEngine:\n errMsg = `View engine is not initiated.Initiate the view engine where fort is created.`;\n break;\n default:\n errMsg = this.message;\n break;\n }\n return errMsg;\n }\n}","import { isNullOrEmpty } from \"../utils\";\n\n \n\n\nexport const parseCookie = (cookie: string): { [key: string]: string } => {\n const value = {};\n if (!isNullOrEmpty(cookie)) {\n cookie.split(';').forEach((val) => {\n const parts = val.split('=');\n value[parts.shift().trim()] = decodeURI(parts.join('='));\n });\n }\n return value;\n};","import { RouteHandler } from \"../handlers/route_handler\";\nimport { RouteMatch } from \"../types/route_match\";\nimport { HTTP_METHOD } from \"../enums\";\nimport { removeLastSlash } from \".\";\nimport { RouteInfo } from \"../types\";\n\nconst checkRouteInWorkerForDefaultRoute = (route: RouteInfo, httpMethod: HTTP_METHOD, urlParts: string[]) => {\n\n const matchedRoute: RouteMatch = {\n allowedHttpMethod: []\n } as RouteMatch;\n matchedRoute.controller = route.controller;\n const urlPartLength = urlParts.length;\n\n const regex1 = /{(.*)}(?!.)/;\n const regex2 = /{(.*)}\\.(\\w+)(?!.)/;\n route.workers.every(routeActionInfo => {\n const patternSplit = routeActionInfo.pattern.split(\"/\");\n if (urlPartLength === patternSplit.length) {\n let isMatched = true;\n const params = {};\n urlParts.every((urlPart, i) => {\n const regMatch1 = patternSplit[i].match(regex1);\n const regMatch2 = patternSplit[i].match(regex2);\n if (regMatch1 != null) {\n params[regMatch1[1]] = urlPart;\n }\n else if (regMatch2 != null) {\n const splitByDot = urlPart.split(\".\");\n if (splitByDot[1] === regMatch2[2]) {\n params[regMatch2[1]] = splitByDot[0];\n }\n else {\n isMatched = false;\n return false;\n }\n }\n else if (urlPart !== patternSplit[i]) {\n isMatched = false;\n return false;\n }\n return true;\n });\n if (isMatched === true) {\n if (routeActionInfo.methodsAllowed.indexOf(httpMethod) >= 0) {\n matchedRoute.workerInfo = routeActionInfo;\n matchedRoute.params = params;\n matchedRoute.shields = route.shields;\n return false;\n }\n else {\n matchedRoute.allowedHttpMethod = [...matchedRoute.allowedHttpMethod, ...routeActionInfo.methodsAllowed];\n }\n }\n }\n return true;\n });\n if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {\n return null;\n }\n return matchedRoute;\n\n};\n\n\nconst checkRouteInWorker = (route: RouteInfo, httpMethod: HTTP_METHOD, urlParts: string[]) => {\n const matchedRoute: RouteMatch = {\n allowedHttpMethod: []\n } as RouteMatch;\n matchedRoute.controller = route.controller;\n const urlPartLength = urlParts.length;\n if (urlPartLength === 2) { // url does not have action path\n const pattern = `/${route.path}/`;\n route.workers.every(action => {\n if (action.pattern === pattern) {\n if (action.methodsAllowed.indexOf(httpMethod) >= 0) {\n matchedRoute.workerInfo = action;\n matchedRoute.params = {};\n matchedRoute.shields = route.shields;\n return false;\n }\n else {\n matchedRoute.allowedHttpMethod = [...matchedRoute.allowedHttpMethod, ...action.methodsAllowed];\n }\n }\n return true;\n });\n }\n else {\n const regex1 = /{(.*)}(?!.)/;\n const regex2 = /{(.*)}\\.(\\w+)(?!.)/;\n route.workers.every(routeActionInfo => {\n const patternSplit = routeActionInfo.pattern.split(\"/\");\n if (urlPartLength === patternSplit.length) {\n let isMatched = true;\n const params = {};\n urlParts.every((urlPart, i) => {\n const regMatch1 = patternSplit[i].match(regex1);\n const regMatch2 = patternSplit[i].match(regex2);\n if (regMatch1 != null) {\n params[regMatch1[1]] = urlPart;\n }\n else if (regMatch2 != null) {\n const splitByDot = urlPart.split(\".\");\n if (splitByDot[1] === regMatch2[2]) {\n params[regMatch2[1]] = splitByDot[0];\n }\n else {\n isMatched = false;\n return false;\n }\n }\n else if (urlPart !== patternSplit[i]) {\n isMatched = false;\n return false;\n }\n return true;\n });\n if (isMatched === true) {\n if (routeActionInfo.methodsAllowed.indexOf(httpMethod) >= 0) {\n matchedRoute.workerInfo = routeActionInfo;\n matchedRoute.params = params;\n matchedRoute.shields = route.shields;\n return false;\n }\n else {\n matchedRoute.allowedHttpMethod = [...matchedRoute.allowedHttpMethod, ...routeActionInfo.methodsAllowed];\n }\n }\n }\n return true;\n });\n }\n if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {\n return null;\n }\n return matchedRoute;\n\n};\n\nexport const parseAndMatchRoute = (url: string, httpMethod: HTTP_METHOD) => {\n if (url !== \"/\") {\n url = removeLastSlash(url);\n }\n\n const urlParts = url.split(\"/\");\n const firstPart = urlParts[1];\n let route = RouteHandler.routerCollection.find(qry => qry.path === firstPart);\n\n if (route == null) {\n route = RouteHandler.routerCollection.find(qry => qry.path === \"*\");\n return checkRouteInWorkerForDefaultRoute(route, httpMethod, urlParts);\n }\n else {\n return checkRouteInWorker(route, httpMethod, urlParts);\n }\n};","export const promise = (callBack: (resolve, reject) => void) => {\n return new Promise(callBack);\n};","import { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const redirectResult = (url: string) => {\n return {\n contentType: MIME_TYPE.Text,\n responseData: url,\n statusCode: HTTP_STATUS_CODE.Redirect,\n shouldRedirect: true\n } as HttpResult;\n};","export const removeFirstSlash = function (value: string) {\n // remove / from string at 0th index\n if (value[0] === \"/\") {\n return value.substr(1);\n }\n return value;\n};","export const removeLastSlash = (url: string) => {\n const urlLength = url.length;\n // removing / from url;\n if (url[urlLength - 1] === \"/\") {\n return url.substr(0, urlLength - 1);\n }\n return url;\n};","import { Global } from \"../global\";\nimport { isEnvDev } from \"./is_env_dev\";\nimport { LogHelper } from \"./log_helper\";\nimport { ERROR_TYPE } from \"../enums/error_type\";\n\nexport const renderView = (viewName: string, model?: any) => {\n if (isEnvDev()) {\n if (Global.viewEngine == null) {\n new LogHelper(ERROR_TYPE.UndefinedViewEngine).throw();\n }\n }\n return Global.viewEngine.render({\n view: viewName,\n model: model\n });\n};","export const reverseLoop = function (values: any[], cb: (value, index: number) => void) {\n for (let length = values.length, i = length - 1; i >= 0; i--) {\n cb(values[i], i);\n }\n};","import { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const textResult = (text: string, statusCode?: HTTP_STATUS_CODE) => {\n return {\n contentType: MIME_TYPE.Text,\n responseData: text,\n statusCode: statusCode || HTTP_STATUS_CODE.Ok\n } as HttpResult;\n};","import { renderView } from \"./render_view\";\nimport { HttpResult } from \"../types\";\nimport { MIME_TYPE, HTTP_STATUS_CODE } from \"../enums\";\n\n\nexport const viewResult = async (viewName: string, model?: any) => {\n const viewData = await renderView(viewName, model);\n return {\n contentType: MIME_TYPE.Html,\n responseData: viewData,\n statusCode: HTTP_STATUS_CODE.Ok\n } as HttpResult;\n};","import { getDataType } from \"./get_data_type\";\nimport { DATA_TYPE } from \"../enums/data_type\";\nimport * as jsontoxml from \"jsontoxml\";\n\nexport class XmlHelper {\n\n static fromJsToXml(value) {\n const addKeyToObjectIfNeeded = (key: string, obj) => {\n const type = getDataType(obj);\n if (type === DATA_TYPE.Object) {\n const keys = Object.keys(obj);\n if (keys.length !== 1) {\n obj = {\n [key]: obj\n };\n }\n }\n return obj;\n };\n const dataType = getDataType(value);\n switch (dataType) {\n case DATA_TYPE.Array:\n (value as []).forEach((val, index) => {\n value[index] = addKeyToObjectIfNeeded(\"item\", val);\n });\n value = {\n root: value\n };\n break;\n case DATA_TYPE.Object:\n value = addKeyToObjectIfNeeded(\"root\", value);\n\n }\n return jsontoxml(value, {\n xmlHeader: true\n });\n }\n}","export * from './models';\nexport * from './abstracts';\nexport * from './decorators';\nexport * from './enums';\nexport * from './helpers';\nexport * from './types';\nexport * from './extra';","import { HttpCookie } from \"./http_cookie\";\nimport { IHttpCookie } from \"../interfaces\";\n\nexport class CookieManager {\n private responseCookie_: string[] = [];\n private cookieCollection_: { [key: string]: string };\n\n constructor(parsedValue: { [key: string]: string }) {\n this.cookieCollection_ = parsedValue;\n }\n\n /**\n * return cookie by name\n *\n * @param {string} name\n * @returns\n * @memberof CookieManager\n */\n getCookie(name: string): HttpCookie {\n return {\n name: name,\n value: this.cookieCollection_[name]\n } as IHttpCookie;\n }\n\n /**\n * add cookie\n *\n * @param {HttpCookie} cookie\n * @memberof CookieManager\n */\n addCookie(cookie: HttpCookie) {\n this.cookieCollection_[cookie.name] = cookie.value;\n this.responseCookie_.push(this.getCookieStringFromCookie_(cookie));\n }\n\n /**\n * remove cookie\n *\n * @param {HttpCookie} cookie\n * @memberof CookieManager\n */\n removeCookie(cookie: HttpCookie) {\n this.cookieCollection_[cookie.name] = null;\n cookie.expires = new Date('Thu, 01 Jan 1970 00:00:00 GMT');\n cookie.maxAge = -1;\n this.responseCookie_.push(this.getCookieStringFromCookie_(cookie));\n }\n\n /**\n * collection of http cookie\n *\n * @readonly\n * @memberof CookieManager\n */\n get cookieCollection() {\n return this.cookieCollection_;\n }\n\n /**\n * determine whether value exist or not\n *\n * @param {string} name\n * @returns\n * @memberof CookieManager\n */\n isExist(name: string) {\n return this.cookieCollection_[name] != null;\n }\n\n private getCookieStringFromCookie_(cookie: HttpCookie) {\n const cookies = [];\n cookies.push(`${cookie.name}=${cookie.value}`);\n if (cookie.expires) {\n cookies.push(`Expires=${cookie.expires.toUTCString()}`);\n }\n if (cookie.httpOnly === true) {\n cookies.push(\"HttpOnly\");\n }\n if (cookie.maxAge != null) {\n cookies.push(`Max-Age=${cookie.maxAge}`);\n }\n if (cookie.path) {\n cookies.push(`Path=${cookie.path}`);\n }\n if (cookie.domain) {\n cookies.push(`Domain=${cookie.domain}`);\n }\n return cookies.join('; ');\n }\n}","import { IException } from \"../interfaces\";\nimport { promise } from \"../helpers\";\n\nexport class ErrorHandler {\n onServerError(ex: IException): Promise {\n return promise((resolve, reject) => {\n let errMessage = `internal server error
\n message : ${ex.message}
`;\n if (ex.stack) {\n errMessage += `stacktrace: ${ex.stack}
`;\n }\n if (ex.type) {\n errMessage += `type: ${ex.type}
`;\n }\n resolve(errMessage);\n });\n }\n\n onBadRequest(ex: IException): Promise {\n return promise((resolve, reject) => {\n let errMessage = `Bad Request
`;\n if (ex.message) {\n errMessage += ` message : ${ex.message}
`;\n }\n if (ex.stack) {\n errMessage += `stacktrace: ${ex.stack}
`;\n }\n if (ex.type) {\n errMessage += `type: ${ex.type}
`;\n }\n resolve(errMessage);\n });\n }\n\n onForbiddenRequest(): Promise {\n return promise((resolve, reject) => {\n const errMessage = `Forbidden
`;\n resolve(errMessage);\n });\n }\n\n onNotAcceptableRequest(): Promise {\n return promise((resolve, reject) => {\n const errMessage = `Not Acceptable
`;\n resolve(errMessage);\n });\n }\n\n onMethodNotAllowed(): Promise {\n return promise((resolve, reject) => {\n const errMessage = `Method Not allowed.
`;\n resolve(errMessage);\n });\n }\n\n onNotFound(url: string): Promise {\n return promise((resolve, reject) => {\n const errMessage = `The requested resource ${url} was not found.
`;\n resolve(errMessage);\n });\n }\n}","import { HttpFile } from \"./http_file\";\nimport * as Fs from \"fs-extra\";\n\nexport class FileManager {\n\n private files_: { [fieldName: string]: HttpFile };\n\n constructor(value) {\n this.files_ = value as any;\n }\n\n /**\n * get total no of files\n *\n * @returns - number\n * @memberof FileManager\n */\n get count() {\n return Object.keys(this.files_).length;\n }\n\n get files() {\n\n return Object.keys(this.files_).map(fileId => {\n return this.files_[fileId];\n });\n }\n\n /**\n * check for existance of file\n *\n * @param {string} fieldName\n * @returns\n * @memberof FileManager\n */\n isExist(fieldName: string) {\n return this.files_[fieldName] != null;\n }\n\n /**\n * return the file\n *\n * @param {string} fieldName\n * @returns\n * @memberof FileManager\n */\n getFile(fieldName: string) {\n return this.files_[fieldName];\n }\n\n /**\n * saves file to supplied path\n *\n * @param {string} fieldName\n * @param {string} pathToSave\n * @returns\n * @memberof FileManager\n */\n saveTo(fieldName: string, pathToSave: string) {\n return Fs.copy(this.files_[fieldName].path, pathToSave);\n }\n}","import { ParentRoute, AppOption, EtagOption } from \"../types\";\nimport { Wall, ViewEngine, SessionProvider, XmlParser } from \"../abstracts\";\nimport { RouteHandler, RequestHandler } from \"../handlers\";\nimport { Global } from \"../global\";\nimport { MemorySessionProvider, MustacheViewEngine } from \"../extra\";\nimport { ErrorHandler } from \".\";\nimport { __AppName } from \"../constant\";\nimport * as http from \"http\";\nimport { ETag_Type, ERROR_TYPE } from \"../enums\";\nimport { LogHelper, promise, removeLastSlash, removeFirstSlash } from \"../helpers\";\nimport { GenericSessionProvider, GenericXmlParser, GenericController } from \"../generics\";\nimport { isNull, isNullOrEmpty, isArray } from \"../utils\";\n\nexport class Fort {\n routes: ParentRoute[] = [];\n walls: Array = [];\n httpServer: http.Server;\n\n /**\n * view engine use to render the view\n *\n * @type {typeof ViewEngine}\n * @memberof Fort\n */\n viewEngine?: typeof ViewEngine;\n\n /**\n * sessionProvider class, default - MemorySessionProvider\n *\n * @type {typeof SessionProvider}\n */\n sessionProvider?: typeof SessionProvider;\n\n /**\n * Custom error handler class\n *\n * @type {typeof ErrorHandler}\n */\n errorHandler?: typeof ErrorHandler;\n\n /**\n * XmlParser class - used to parse the xml \n *\n * @type {typeof XmlParser}\n * @memberof Fort\n */\n xmlParser?: typeof XmlParser;\n\n private saveAppOption_(option: AppOption) {\n const defaultEtagConfig = {\n type: ETag_Type.Weak\n } as EtagOption;\n\n Global.port = option.port == null ? 4000 : option.port;\n Global.shouldParseCookie = option.shouldParseCookie == null ? true : option.shouldParseCookie;\n Global.shouldParsePost = isNull(option.shouldParsePost) ? true : option.shouldParsePost;\n Global.sessionTimeOut = isNull(option.sessionTimeOut) ? 60 : option.sessionTimeOut;\n Global.folders = option.folders == null ? [] : option.folders;\n if (isArray(Global.folders) === false) {\n throw new Error(`Option folders should be an array`);\n }\n Global.appName = isNullOrEmpty(option.appName) === true ? __AppName : option.appName;\n Global.appSessionIdentifier = `${Global.appName}_session_id`;\n Global.eTag = isNull(option.eTag) ? defaultEtagConfig : option.eTag;\n Global.walls = this.walls as any;\n Global.viewEngine = isNull(this.viewEngine) ? new MustacheViewEngine() : new (this.viewEngine as any)();\n Global.sessionProvider = isNull(this.sessionProvider) ? MemorySessionProvider as any :\n this.sessionProvider as typeof GenericSessionProvider;\n Global.errorHandler = isNull(this.errorHandler) ? ErrorHandler : this.errorHandler;\n Global.xmlParser = isNull(this.xmlParser) ? GenericXmlParser : this.xmlParser;\n Global.viewPath = isNull(option.viewPath) ? \"views\" : option.viewPath;\n }\n\n create(option?: AppOption): Promise {\n if (option == null) {\n option = {\n\n };\n }\n\n if (this.routes == null) {\n this.routes = [];\n }\n let isDefaultRouteExist = false;\n // removing / from routes\n this.routes.forEach(route => {\n route.path = removeFirstSlash(route.path);\n route.path = removeLastSlash(route.path);\n if (route.path === \"*\") {\n isDefaultRouteExist = true;\n }\n RouteHandler.addToRouterCollection(route);\n });\n if (isDefaultRouteExist === false) {\n RouteHandler.addToRouterCollection({\n controller: GenericController,\n path: \"*\"\n });\n }\n if (option.folders != null) {\n // remove / from files routes\n option.folders.forEach(folder => {\n const length = folder.alias.length;\n if (length > 1) {\n folder.alias = removeFirstSlash(folder.alias);\n folder.alias = removeLastSlash(folder.alias);\n }\n\n });\n }\n\n this.saveAppOption_(option);\n return promise((res, rej) => {\n this.httpServer = http.createServer((request, response) => {\n new RequestHandler(request, response).handle();\n }).once(\"error\", (err) => {\n if ((err as any).code === 'EADDRINUSE') {\n const error = new LogHelper(ERROR_TYPE.PortInUse, Global.port).get();\n rej(error);\n }\n else {\n rej(err);\n }\n }).once('listening', () => {\n res();\n }).listen(Global.port);\n });\n }\n\n destroy(): Promise {\n return promise((res, rej) => {\n this.httpServer.close(res);\n });\n }\n\n}\n","import { IHttpCookie } from \"../interfaces\";\n\nexport class HttpCookie implements IHttpCookie {\n name: string;\n value: string;\n maxAge?: number;\n expires?: Date;\n domain?: string;\n httpOnly?: boolean;\n secure?: boolean;\n path?: string;\n\n constructor(name: string, value: string) {\n this.name = name;\n this.value = value;\n }\n}","import { IncomingHttpHeaders } from \"http2\";\n\n \nexport class HttpFile {\n\n /**\n * same as name - the field name for this file\n */\n fieldName: string;\n\n /**\n * the filename that the user reports for the file\n */\n originalFilename: string;\n\n /**\n * the absolute path of the uploaded file on disk\n */\n path: string;\n\n /**\n * the HTTP headers that were sent along with this file\n */\n headers?: IncomingHttpHeaders;\n\n /**\n * size of the file in bytes\n */\n size?: number;\n\n}\n","export * from './error_handler';\nexport * from './http_cookie';\nexport * from './fort';\nexport * from './router';\nexport * from './cookie_manager';\nexport * from \"./file_manager\";\nexport * from \"./http_file\";","import { RouteInfo } from \"../types\";\nimport { RouteHandler } from \"../handlers\";\n\nexport class Router {\n routes: RouteInfo[] = RouteHandler.routerCollection;\n}","import { HttpRequest } from \"../types\";\n\nexport class HttpRequestStub implements HttpRequest {\n headers;\n\n constructor(headers) {\n this.headers = headers;\n }\n}","import { HttpResponse } from \"../types\";\n\nexport class HttpResponseStub implements HttpResponse {\n private headers_;\n constructor(headers) {\n this.headers_ = headers;\n }\n\n getHeader(name: string) {\n return this.headers_[name];\n }\n\n\n hasHeader(name: string) {\n return this.headers_[name] != null;\n }\n\n setHeader(name: string, value: number | string | string[]) {\n this.headers_[name] = value;\n }\n\n getHeaders() {\n return this.headers_;\n }\n\n getHeaderNames(): string[] {\n return Object.keys[this.headers_];\n }\n\n removeHeader(name: string) {\n delete this.headers_[name];\n }\n}","export * from './init_controller';\nexport * from './init_guard';\nexport * from './init_shield';\nexport * from './init_wall';","\nimport { CookieManager, FileManager } from \"../models\";\nimport { Global } from \"../global\";\nimport { ControllerTestData } from \"../types\";\nimport { HttpResponseStub } from \"./http_response_stub\";\nimport { HttpRequestStub } from \"./http_request_stub\";\nimport { Controller } from \"../abstracts\";\n\n\n\nexport const initController = (controllerInstance: Controller, data?: ControllerTestData) => {\n data = data || {};\n const parsedCookies = data.cookieValue || {};\n const headers = (data.request && data.request.headers) || {};\n controllerInstance.request = new HttpRequestStub(headers);\n controllerInstance.response = new HttpResponseStub(headers);\n controllerInstance.query = data.query || {};\n controllerInstance.body = data.body || {};\n controllerInstance.cookie = new CookieManager(parsedCookies);\n const session = new Global.sessionProvider();\n session.cookie = controllerInstance.cookie;\n session.sessionId = parsedCookies[Global.appSessionIdentifier];\n controllerInstance.session = session;\n controllerInstance.param = data.param || {};\n controllerInstance.data = data.data || {};\n controllerInstance.file = new FileManager(data.file || {});\n return controllerInstance;\n};","\nimport { initController } from \"./init_controller\";\nimport { ControllerTestData } from \"../types\";\n\nexport type GuardTestData = ControllerTestData;\n\nexport const initGuard = (guardInstance, data?: GuardTestData) => {\n return initController(guardInstance, data);\n};","\nimport { initController } from \"./init_controller\";\nimport { ControllerTestData } from \"../types\";\n\nexport type ShieldTestData = ControllerTestData & {\n workerName?: string;\n};\n\nexport const initShield = (shieldInstance, data?: ShieldTestData) => {\n const value: ShieldTestData = initController(shieldInstance, data) as any;\n value.workerName = data && data.workerName;\n return value;\n};","\nimport { initController } from \"./init_controller\";\nimport { ControllerTestData } from \"../types\";\n\nexport type WallTestData = ControllerTestData;\n\nexport const initWall = (wallInstance, data?: WallTestData) => {\n return initController(wallInstance, data);\n};","export * from './is_null_or_empty';\nexport * from './is_null';\nexport * from './is_array';","export const isArray = (value) => {\n return Array.isArray(value);\n};","export const isNull = (value) => {\n return value == null;\n};","export const isNullOrEmpty = (value: string) => {\n return value == null || value.length === 0;\n};","module.exports = require(\"content-type\");","module.exports = require(\"etag\");","module.exports = require(\"fresh\");","module.exports = require(\"fs\");","module.exports = require(\"fs-extra\");","module.exports = require(\"http\");","module.exports = require(\"jsontoxml\");","module.exports = require(\"multiparty\");","module.exports = require(\"mustache\");","module.exports = require(\"negotiator\");","module.exports = require(\"path\");","module.exports = require(\"querystring\");","module.exports = require(\"uniqid\");","module.exports = require(\"url\");"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack://FortJs/webpack/bootstrap","webpack://FortJs/external \"path\"","webpack://FortJs/external \"fs-extra\"","webpack://FortJs/external \"negotiator\"","webpack://FortJs/external \"fs\"","webpack://FortJs/external \"jsontoxml\"","webpack://FortJs/external \"url\"","webpack://FortJs/external \"etag\"","webpack://FortJs/external \"fresh\"","webpack://FortJs/external \"content-type\"","webpack://FortJs/external \"querystring\"","webpack://FortJs/external \"multiparty\"","webpack://FortJs/external \"mustache\"","webpack://FortJs/external \"uniqid\"","webpack://FortJs/external \"http\"","webpack://FortJs/./src/enums/mime_type.ts","webpack://FortJs/./src/enums/http_method.ts","webpack://FortJs/./src/enums/http_status_code.ts","webpack://FortJs/./src/enums/etag_type.ts","webpack://FortJs/./src/enums/error_type.ts","webpack://FortJs/./src/enums/index.ts","webpack://FortJs/./src/helpers/json_result.ts","webpack://FortJs/./src/helpers/text_result.ts","webpack://FortJs/./src/helpers/html_result.ts","webpack://FortJs/./src/global.ts","webpack://FortJs/./src/helpers/is_env_dev.ts","webpack://FortJs/./src/helpers/log_helper.ts","webpack://FortJs/./src/helpers/render_view.ts","webpack://FortJs/./src/helpers/download_result.ts","webpack://FortJs/./src/helpers/file_result.ts","webpack://FortJs/./src/helpers/redirect_result.ts","webpack://FortJs/./src/helpers/view_result.ts","webpack://FortJs/./src/helpers/is_env_production.ts","webpack://FortJs/./src/constant.ts","webpack://FortJs/./src/helpers/get_view_from_file.ts","webpack://FortJs/./src/helpers/promise.ts","webpack://FortJs/./src/enums/data_type.ts","webpack://FortJs/./src/helpers/get_data_type.ts","webpack://FortJs/./src/helpers/xml_helper.ts","webpack://FortJs/./src/helpers/get_mime_type_from_extension.ts","webpack://FortJs/./src/utils/is_null_or_empty.ts","webpack://FortJs/./src/utils/is_null.ts","webpack://FortJs/./src/utils/is_array.ts","webpack://FortJs/./src/utils/index.ts","webpack://FortJs/./src/handlers/route_handler.ts","webpack://FortJs/./src/helpers/parse_match_route.ts","webpack://FortJs/./src/helpers/parse_cookie.ts","webpack://FortJs/./src/helpers/json_helper.ts","webpack://FortJs/./src/helpers/remove_last_slash.ts","webpack://FortJs/./src/helpers/remove_first_slash.ts","webpack://FortJs/./src/helpers/reverse_loop.ts","webpack://FortJs/./src/helpers/index.ts","webpack://FortJs/./src/models/error_handler.ts","webpack://FortJs/./src/models/http_cookie.ts","webpack://FortJs/./src/handlers/injector_handler.ts","webpack://FortJs/./src/handlers/request_handler_helper.ts","webpack://FortJs/./src/handlers/file_handler.ts","webpack://FortJs/./src/handlers/controller_result_handler.ts","webpack://FortJs/./src/handlers/post_handler.ts","webpack://FortJs/./src/handlers/request_handler.ts","webpack://FortJs/./src/handlers/index.ts","webpack://FortJs/./src/extra/mustache_view_engine.ts","webpack://FortJs/./src/abstracts/session_provider.ts","webpack://FortJs/./src/extra/memory_session_provider.ts","webpack://FortJs/./src/extra/index.ts","webpack://FortJs/./src/test_helpers/http_response_stub.ts","webpack://FortJs/./src/test_helpers/http_request_stub.ts","webpack://FortJs/./src/test_helpers/init_controller.ts","webpack://FortJs/./src/test_helpers/init_guard.ts","webpack://FortJs/./src/test_helpers/init_shield.ts","webpack://FortJs/./src/test_helpers/init_wall.ts","webpack://FortJs/./src/test_helpers/index.ts","webpack://FortJs/./src/abstracts/controller.ts","webpack://FortJs/./src/abstracts/shield.ts","webpack://FortJs/./src/abstracts/guard.ts","webpack://FortJs/./src/abstracts/view_engine.ts","webpack://FortJs/./src/abstracts/wall.ts","webpack://FortJs/./src/abstracts/xml_parser.ts","webpack://FortJs/./src/abstracts/index.ts","webpack://FortJs/./src/generics/generic_guard.ts","webpack://FortJs/./src/generics/generic_shield.ts","webpack://FortJs/./src/generics/generic_session_provider.ts","webpack://FortJs/./src/generics/generic_wall.ts","webpack://FortJs/./src/generics/generic_controller.ts","webpack://FortJs/./src/generics/generic_xml_parser.ts","webpack://FortJs/./src/generics/index.ts","webpack://FortJs/./src/models/fort.ts","webpack://FortJs/./src/models/router.ts","webpack://FortJs/./src/models/cookie_manager.ts","webpack://FortJs/./src/models/file_manager.ts","webpack://FortJs/./src/models/http_file.ts","webpack://FortJs/./src/models/index.ts","webpack://FortJs/./src/decorators/worker.ts","webpack://FortJs/./src/decorators/shields.ts","webpack://FortJs/./src/decorators/guards.ts","webpack://FortJs/./src/decorators/route.ts","webpack://FortJs/./src/decorators/default_worker.ts","webpack://FortJs/./src/decorators/assign.ts","webpack://FortJs/./src/decorators/singleton.ts","webpack://FortJs/./src/decorators/index.ts","webpack://FortJs/./src/index.ts"],"names":[],"mappings":";;;;;;;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA,iC;;;;;;ACAA,qC;;;;;;ACAA,uC;;;;;;AC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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAyB;AACG;AACC;AACL;AACE;AAEF","file":"fort.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 14);\n","module.exports = require(\"path\");","module.exports = require(\"fs-extra\");","module.exports = require(\"negotiator\");","module.exports = require(\"fs\");","module.exports = require(\"jsontoxml\");","module.exports = require(\"url\");","module.exports = require(\"etag\");","module.exports = require(\"fresh\");","module.exports = require(\"content-type\");","module.exports = require(\"querystring\");","module.exports = require(\"multiparty\");","module.exports = require(\"mustache\");","module.exports = require(\"uniqid\");","module.exports = require(\"http\");","export enum MIME_TYPE {\n Text = \"text/plain\",\n Json = \"application/json\",\n Html = \"text/html\",\n FormUrlEncoded = \"application/x-www-form-urlencoded\",\n Css = \"text/css\",\n Csv = \"text/csv\",\n Js = \"application/javascript\",\n Bmp = \"image/bmp\",\n Jpeg = \"image/jpeg\",\n Gif = \"image/gif\",\n Ico = \"image/x-icon\",\n Png = \"image/png\",\n Pdf = \"application/pdf\",\n Svg = \"image/svg+xml\",\n Rtf = \"application/rtf\",\n Xml = \"application/xml\",\n Xls = \"application/vnd.ms-excel\",\n Xlsx = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n Ttf = \"font/ttf\",\n Woff = \"font/woff\",\n Woff2 = \"font/woff2\",\n Eot = \"application/vnd.ms-fontobject\",\n Otf = \"font/otf\",\n Swf = \"application/x-shockwave-flash\",\n Avi = \"video/avi\",\n FormMultiPart = \"multipart/form-data\"\n\n}","export enum HTTP_METHOD {\n Get = \"GET\",\n Post = \"POST\",\n Put = \"PUT\",\n Patch = \"PATCH\",\n Delete = \"DELETE\",\n Options = \"OPTIONS\",\n Head = \"HEAD\"\n}","export enum HTTP_STATUS_CODE {\n BadRequest = 400,\n Unauthorized = 401,\n Forbidden = 403,\n NotFound = 404,\n Ok = 200,\n Created = 201,\n NoContent = 204,\n Redirect = 302,\n NotModified = 304,\n MethodNotAllowed = 405,\n NotAcceptable = 406,\n InternalServerError = 500,\n}","export enum ETag_Type {\n Strong = \"strong\",\n Weak = \"weak\"\n}","export enum ERROR_TYPE {\n InvalidControllerName = \"invalid_controller_name\",\n InvalidContentType = \"invalid_content_type\",\n PortInUse = \"port_in_use\",\n UndefinedViewEngine = \"undefined_view_engine\"\n}","export * from './mime_type';\nexport * from './http_method';\nexport * from './http_status_code';\nexport * from \"./etag_type\";\nexport * from \"./error_type\";","\nimport { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const jsonResult = (value: any, statusCode?: HTTP_STATUS_CODE) => {\n return {\n contentType: MIME_TYPE.Json,\n responseData: value,\n statusCode: statusCode || HTTP_STATUS_CODE.Ok\n } as HttpResult;\n};","import { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const textResult = (text: string, statusCode?: HTTP_STATUS_CODE) => {\n return {\n contentType: MIME_TYPE.Text,\n responseData: text,\n statusCode: statusCode || HTTP_STATUS_CODE.Ok\n } as HttpResult;\n};","import { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const htmlResult = (html: string, statusCode?: HTTP_STATUS_CODE) => {\n return {\n contentType: MIME_TYPE.Html,\n responseData: html,\n statusCode: statusCode || HTTP_STATUS_CODE.Ok\n } as HttpResult;\n};","import * as http from \"http\";\nimport { ErrorHandler } from \"./models\";\nimport { ViewEngine, XmlParser } from \"./abstracts\";\nimport { EtagOption, FolderMap } from \"./types\";\nimport { GenericSessionProvider, GenericWall } from \"./generics\";\n\nexport class Global {\n static request: http.IncomingMessage;\n static response: http.ServerResponse;\n static port: number;\n static viewPath: string;\n static shouldParseCookie: boolean;\n static shouldParsePost: boolean;\n static sessionProvider: typeof GenericSessionProvider;\n static sessionTimeOut?: number;\n static viewEngine: ViewEngine;\n static walls: Array = [];\n static errorHandler: typeof ErrorHandler;\n static connectonKeepAliveTimeout?: number;\n\n static appName?: string;\n\n static eTag?: EtagOption;\n\n static folders?: FolderMap[];\n static appSessionIdentifier: string;\n static xmlParser: typeof XmlParser;\n}","export const isEnvDev = () => {\n return process.env.NODE_ENV === 'development';\n};","import { IError } from \"../interfaces/error\";\nimport { ERROR_TYPE } from \"../enums/error_type\";\n\nexport class LogHelper implements IError {\n type: ERROR_TYPE;\n message: string;\n private info_: any;\n\n constructor(type: ERROR_TYPE, info?: any) {\n this.type = type;\n this.info_ = info;\n this.message = this.getMsg_();\n }\n\n throw() {\n const errMsg = this.get();\n throw JSON.stringify(errMsg);\n }\n\n static log(msg) {\n console.log(msg);\n }\n\n logError() {\n console.error(this.get());\n }\n\n logWarning() {\n console.warn(this.get());\n }\n\n get() {\n return {\n message: this.message,\n type: this.type\n } as IError;\n }\n\n private getMsg_() {\n let errMsg: string;\n switch (this.type) {\n case ERROR_TYPE.InvalidControllerName:\n errMsg = `Invalid controller name - '${this.info_}'. Controller name must contain 'controller'.`;\n break;\n case ERROR_TYPE.InvalidContentType:\n errMsg = `Content type - '${this.info_}' is not valid. Please create an issue if you think this is valid type.`;\n break;\n case ERROR_TYPE.PortInUse:\n errMsg = `Port ${this.info_} is being used by another process.`;\n break;\n case ERROR_TYPE.UndefinedViewEngine:\n errMsg = `View engine is not initiated.Initiate the view engine where fort is created.`;\n break;\n default:\n errMsg = this.message;\n break;\n }\n return errMsg;\n }\n}","import { Global } from \"../global\";\nimport { isEnvDev } from \"./is_env_dev\";\nimport { LogHelper } from \"./log_helper\";\nimport { ERROR_TYPE } from \"../enums/error_type\";\n\nexport const renderView = (viewName: string, model?: any) => {\n if (isEnvDev()) {\n if (Global.viewEngine == null) {\n new LogHelper(ERROR_TYPE.UndefinedViewEngine).throw();\n }\n }\n return Global.viewEngine.render({\n view: viewName,\n model: model\n });\n};","\nimport { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const downloadResult = (filePath: string, downloadFileName?: string) => {\n return {\n statusCode: HTTP_STATUS_CODE.Ok,\n file: {\n filePath: filePath,\n shouldDownload: true,\n alias: downloadFileName\n }\n } as HttpResult;\n};","\nimport { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const fileResult = (filePath: string) => {\n return {\n statusCode: HTTP_STATUS_CODE.Ok,\n file: {\n filePath: filePath\n }\n } as HttpResult;\n};","import { MIME_TYPE } from \"../enums\";\nimport { HTTP_STATUS_CODE } from \"../enums/http_status_code\";\nimport { HttpResult } from \"../types/http_result\";\n\nexport const redirectResult = (url: string) => {\n return {\n contentType: MIME_TYPE.Text,\n responseData: url,\n statusCode: HTTP_STATUS_CODE.Redirect,\n shouldRedirect: true\n } as HttpResult;\n};","import { renderView } from \"./render_view\";\nimport { HttpResult } from \"../types\";\nimport { MIME_TYPE, HTTP_STATUS_CODE } from \"../enums\";\n\n\nexport const viewResult = async (viewName: string, model?: any) => {\n const viewData = await renderView(viewName, model);\n return {\n contentType: MIME_TYPE.Html,\n responseData: viewData,\n statusCode: HTTP_STATUS_CODE.Ok\n } as HttpResult;\n};","export const isEnvProduction = () => {\n return process.env.NODE_ENV === \"production\";\n};","import { Global } from \"./global\";\n/* tslint:disable */\nexport const __ContentType = \"Content-Type\";\nexport const __AppName = \"fort\";\nexport const __Cookie = \"Cookie\";\nexport const __SetCookie = 'Set-Cookie';\nexport const __CurrentPath = process.cwd();\nexport const __ContentLength = \"Content-Length\";\nexport const __Constructor = \"const_constructor\";","import { readFile } from \"fs-extra\";\nimport { isEnvProduction } from \"./is_env_production\";\nimport * as path from \"path\";\nimport { Global } from \"../global\";\nimport { __CurrentPath } from \"../constant\";\n\nconst viewCache = {\n\n};\nexport const getViewFromFile = async function (fileLocation: string): Promise {\n const readView = function () {\n const pathOfView = path.join(__CurrentPath, `${Global.viewPath}/${fileLocation}`);\n return readFile(pathOfView, {\n encoding: 'utf8'\n });\n };\n\n if (isEnvProduction()) {\n if (viewCache[fileLocation] == null) {\n viewCache[fileLocation] = await readView();\n }\n return viewCache[fileLocation];\n\n }\n return await readView();\n};","export const promise = (callBack: (resolve, reject) => void) => {\n return new Promise(callBack);\n};","export enum DATA_TYPE {\n String = \"string\",\n Number = \"number\",\n Array = \"array\",\n Object = \"object\",\n Function = \"function\"\n}","import { DATA_TYPE } from \"../enums/data_type\";\n\nexport const getDataType = (value) => {\n const type = typeof value;\n switch (type) {\n case 'object':\n if (Array.isArray(value)) {\n return DATA_TYPE.Array;\n }\n default:\n return type;\n }\n};","import { getDataType } from \"./get_data_type\";\nimport { DATA_TYPE } from \"../enums/data_type\";\nimport * as jsontoxml from \"jsontoxml\";\n\nexport class XmlHelper {\n\n static fromJsToXml(value) {\n const addKeyToObjectIfNeeded = (key: string, obj) => {\n const type = getDataType(obj);\n if (type === DATA_TYPE.Object) {\n const keys = Object.keys(obj);\n if (keys.length !== 1) {\n obj = {\n [key]: obj\n };\n }\n }\n return obj;\n };\n const dataType = getDataType(value);\n switch (dataType) {\n case DATA_TYPE.Array:\n (value as []).forEach((val, index) => {\n value[index] = addKeyToObjectIfNeeded(\"item\", val);\n });\n value = {\n root: value\n };\n break;\n case DATA_TYPE.Object:\n value = addKeyToObjectIfNeeded(\"root\", value);\n\n }\n return jsontoxml(value, {\n xmlHeader: true\n });\n }\n}","import { MIME_TYPE } from \"../enums\";\n\nexport const getMimeTypeFromExtension = (ext: string): MIME_TYPE => {\n switch (ext) {\n case \".htm\":\n case \".html\":\n return MIME_TYPE.Html;\n case \".css\":\n return MIME_TYPE.Css;\n case \".js\":\n return MIME_TYPE.Js;\n case \".png\":\n return MIME_TYPE.Png;\n case \".woff\":\n return MIME_TYPE.Woff;\n case \".woff2\":\n return MIME_TYPE.Woff2;\n case \".json\":\n return MIME_TYPE.Json;\n case \".txt\":\n return MIME_TYPE.Text;\n case \".jpg\":\n case \".jpeg\":\n return MIME_TYPE.Jpeg;\n case \".rtf\":\n return MIME_TYPE.Rtf;\n case \".ttf\":\n return MIME_TYPE.Ttf;\n case \".eot\":\n return MIME_TYPE.Eot;\n case '.otf':\n return MIME_TYPE.Otf;\n case \".swf\":\n return MIME_TYPE.Swf;\n case \".avi\":\n return MIME_TYPE.Avi;\n case \".Svg\":\n return MIME_TYPE.Svg;\n case \".pdf\":\n return MIME_TYPE.Pdf;\n case \".xml\":\n return MIME_TYPE.Xml;\n case \".csv\":\n return MIME_TYPE.Csv;\n case \".xls\":\n return MIME_TYPE.Xls;\n case \".xlsx\":\n return MIME_TYPE.Xlsx;\n case \".bmp\":\n return MIME_TYPE.Bmp;\n case \".gif\":\n return MIME_TYPE.Gif;\n default:\n return \"application/octet-stream\" as MIME_TYPE;\n }\n};","export const isNullOrEmpty = (value: string) => {\n return value == null || value.length === 0;\n};","export const isNull = (value) => {\n return value == null;\n};","export const isArray = (value) => {\n return Array.isArray(value);\n};","export * from './is_null_or_empty';\nexport * from './is_null';\nexport * from './is_array';","import { RouteInfo, WorkerInfo, ParentRoute } from \"../types\";\nimport { GenericShield, GenericGuard } from \"../generics\";\nimport { isNull } from \"../utils\";\n\nconst routerCollection: RouteInfo[] = [];\n\nconst getActionPattern = (parentRoute: ParentRoute, pattern: string) => {\n return (isNull(parentRoute.path) || parentRoute.path === \"*\") ? pattern : `/${parentRoute.path}${pattern}`;\n};\n\nexport class RouteHandler {\n\n static get routerCollection() {\n return routerCollection;\n }\n\n static addToRouterCollection(value: ParentRoute) {\n const route = routerCollection.find(x => x.controllerName === value.controller.name);\n if (route == null) {\n routerCollection.push({\n workers: [],\n controller: value.controller as any,\n controllerName: value.controller.name,\n path: value.path,\n shields: [],\n values: []\n });\n }\n else {\n route.controller = value.controller as any;\n route.path = value.path;\n // change pattern value since we have controller name now.\n route.workers.forEach(actionInfo => {\n actionInfo.pattern = getActionPattern(value, actionInfo.pattern);\n });\n }\n } \n\n static addShields(shields: Array, className: string) {\n const index = routerCollection.findIndex(x => x.controllerName === className);\n if (index < 0) {\n routerCollection.push({\n workers: [],\n controller: null,\n controllerName: className,\n shields: shields,\n path: null,\n values: []\n });\n }\n else {\n routerCollection[index].shields = shields;\n }\n }\n\n static addWorker(newAction: WorkerInfo, className: string) {\n const router = routerCollection.find(x => x.controllerName === className);\n if (router == null) {\n routerCollection.push({\n workers: [newAction],\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = router.workers.find(val => val.workerName === newAction.workerName);\n if (savedAction == null) {\n newAction.pattern = getActionPattern(router, newAction.pattern);\n router.workers.push(newAction);\n }\n else {\n savedAction.methodsAllowed = newAction.methodsAllowed;\n savedAction.pattern = router.path == null ? savedAction.pattern : `/${router.path}${savedAction.pattern}`;\n }\n }\n }\n\n static addGuards(guards: Array, className: string, actionName: string) {\n const index = routerCollection.findIndex(x => x.controllerName === className);\n const pattern = actionName.toLowerCase();\n if (index < 0) {\n routerCollection.push({\n workers: [{\n workerName: actionName,\n guards: guards,\n methodsAllowed: null,\n pattern: pattern,\n values: []\n }],\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = routerCollection[index].workers.find(val => val.workerName === actionName);\n if (savedAction == null) {\n routerCollection[index].workers.push({\n workerName: actionName,\n guards: guards,\n methodsAllowed: null,\n pattern: pattern,\n values: []\n });\n }\n else {\n savedAction.guards = guards;\n }\n }\n }\n\n static addPattern(pattern: string, className: string, actionName: string) {\n const router = routerCollection.find(x => x.controllerName === className);\n if (router == null) {\n routerCollection.push({\n workers: [{\n workerName: actionName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: []\n }],\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = router.workers.find(val => val.workerName === actionName);\n pattern = getActionPattern(router, pattern);\n if (savedAction == null) {\n router.workers.push({\n workerName: actionName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: []\n });\n }\n else {\n savedAction.pattern = pattern;\n }\n }\n }\n}","import { RouteHandler } from \"../handlers/route_handler\";\nimport { RouteMatch } from \"../types/route_match\";\nimport { HTTP_METHOD } from \"../enums\";\nimport { removeLastSlash } from \".\";\nimport { RouteInfo } from \"../types\";\n\nconst checkRouteInWorkerForDefaultRoute = (route: RouteInfo, httpMethod: HTTP_METHOD, urlParts: string[]) => {\n\n const matchedRoute: RouteMatch = {\n allowedHttpMethod: []\n } as RouteMatch;\n matchedRoute.controller = route.controller;\n const urlPartLength = urlParts.length;\n\n const regex1 = /{(.*)}(?!.)/;\n const regex2 = /{(.*)}\\.(\\w+)(?!.)/;\n route.workers.every(routeActionInfo => {\n const patternSplit = routeActionInfo.pattern.split(\"/\");\n if (urlPartLength === patternSplit.length) {\n let isMatched = true;\n const params = {};\n urlParts.every((urlPart, i) => {\n const regMatch1 = patternSplit[i].match(regex1);\n const regMatch2 = patternSplit[i].match(regex2);\n if (regMatch1 != null) {\n params[regMatch1[1]] = urlPart;\n }\n else if (regMatch2 != null) {\n const splitByDot = urlPart.split(\".\");\n if (splitByDot[1] === regMatch2[2]) {\n params[regMatch2[1]] = splitByDot[0];\n }\n else {\n isMatched = false;\n return false;\n }\n }\n else if (urlPart !== patternSplit[i]) {\n isMatched = false;\n return false;\n }\n return true;\n });\n if (isMatched === true) {\n if (routeActionInfo.methodsAllowed.indexOf(httpMethod) >= 0) {\n matchedRoute.workerInfo = routeActionInfo;\n matchedRoute.params = params;\n matchedRoute.shields = route.shields;\n return false;\n }\n else {\n matchedRoute.allowedHttpMethod = [...matchedRoute.allowedHttpMethod, ...routeActionInfo.methodsAllowed];\n }\n }\n }\n return true;\n });\n if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {\n return null;\n }\n return matchedRoute;\n\n};\n\n\nconst checkRouteInWorker = (route: RouteInfo, httpMethod: HTTP_METHOD, urlParts: string[]) => {\n const matchedRoute: RouteMatch = {\n allowedHttpMethod: []\n } as RouteMatch;\n matchedRoute.controller = route.controller;\n const urlPartLength = urlParts.length;\n if (urlPartLength === 2) { // url does not have action path\n const pattern = `/${route.path}/`;\n route.workers.every(action => {\n if (action.pattern === pattern) {\n if (action.methodsAllowed.indexOf(httpMethod) >= 0) {\n matchedRoute.workerInfo = action;\n matchedRoute.params = {};\n matchedRoute.shields = route.shields;\n return false;\n }\n else {\n matchedRoute.allowedHttpMethod = [...matchedRoute.allowedHttpMethod, ...action.methodsAllowed];\n }\n }\n return true;\n });\n }\n else {\n const regex1 = /{(.*)}(?!.)/;\n const regex2 = /{(.*)}\\.(\\w+)(?!.)/;\n route.workers.every(routeActionInfo => {\n const patternSplit = routeActionInfo.pattern.split(\"/\");\n if (urlPartLength === patternSplit.length) {\n let isMatched = true;\n const params = {};\n urlParts.every((urlPart, i) => {\n const regMatch1 = patternSplit[i].match(regex1);\n const regMatch2 = patternSplit[i].match(regex2);\n if (regMatch1 != null) {\n params[regMatch1[1]] = urlPart;\n }\n else if (regMatch2 != null) {\n const splitByDot = urlPart.split(\".\");\n if (splitByDot[1] === regMatch2[2]) {\n params[regMatch2[1]] = splitByDot[0];\n }\n else {\n isMatched = false;\n return false;\n }\n }\n else if (urlPart !== patternSplit[i]) {\n isMatched = false;\n return false;\n }\n return true;\n });\n if (isMatched === true) {\n if (routeActionInfo.methodsAllowed.indexOf(httpMethod) >= 0) {\n matchedRoute.workerInfo = routeActionInfo;\n matchedRoute.params = params;\n matchedRoute.shields = route.shields;\n return false;\n }\n else {\n matchedRoute.allowedHttpMethod = [...matchedRoute.allowedHttpMethod, ...routeActionInfo.methodsAllowed];\n }\n }\n }\n return true;\n });\n }\n if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {\n return null;\n }\n return matchedRoute;\n\n};\n\nexport const parseAndMatchRoute = (url: string, httpMethod: HTTP_METHOD) => {\n if (url !== \"/\") {\n url = removeLastSlash(url);\n }\n\n const urlParts = url.split(\"/\");\n const firstPart = urlParts[1];\n let route = RouteHandler.routerCollection.find(qry => qry.path === firstPart);\n\n if (route == null) {\n route = RouteHandler.routerCollection.find(qry => qry.path === \"*\");\n return checkRouteInWorkerForDefaultRoute(route, httpMethod, urlParts);\n }\n else {\n return checkRouteInWorker(route, httpMethod, urlParts);\n }\n};","import { isNullOrEmpty } from \"../utils\";\n\n \n\n\nexport const parseCookie = (cookie: string): { [key: string]: string } => {\n const value = {};\n if (!isNullOrEmpty(cookie)) {\n cookie.split(';').forEach((val) => {\n const parts = val.split('=');\n value[parts.shift().trim()] = decodeURI(parts.join('='));\n });\n }\n return value;\n};","import { IException } from \"../interfaces\";\n\nexport class JsonHelper {\n static parse(value: string) {\n try {\n return JSON.parse(value);\n }\n catch (ex) {\n // tslint:disable-next-line\n throw {\n message: \"Post data is invalid\"\n } as IException;\n }\n }\n\n static stringify(value) {\n return JSON.stringify(value);\n }\n}","export const removeLastSlash = (url: string) => {\n const urlLength = url.length;\n // removing / from url;\n if (url[urlLength - 1] === \"/\") {\n return url.substr(0, urlLength - 1);\n }\n return url;\n};","export const removeFirstSlash = function (value: string) {\n // remove / from string at 0th index\n if (value[0] === \"/\") {\n return value.substr(1);\n }\n return value;\n};","export const reverseLoop = function (values: any[], cb: (value, index: number) => void) {\n for (let length = values.length, i = length - 1; i >= 0; i--) {\n cb(values[i], i);\n }\n};","export * from './json_result';\nexport * from './text_result';\nexport * from './html_result';\nexport * from './render_view';\nexport * from './download_result';\nexport * from './file_result';\nexport * from './redirect_result';\nexport * from './view_result';\nexport * from './get_view_from_file';\nexport * from \"./promise\";\nexport * from './log_helper';\nexport * from './xml_helper';\nexport * from \"./get_mime_type_from_extension\";\nexport * from \"./parse_match_route\";\nexport * from \"./parse_cookie\";\nexport * from './json_helper';\nexport * from './remove_last_slash';\nexport * from './remove_first_slash';\nexport * from './reverse_loop';","import { IException } from \"../interfaces\";\nimport { promise } from \"../helpers\";\n\nexport class ErrorHandler {\n onServerError(ex: IException): Promise {\n return promise((resolve, reject) => {\n let errMessage = `internal server error
\n message : ${ex.message}
`;\n if (ex.stack) {\n errMessage += `stacktrace: ${ex.stack}
`;\n }\n if (ex.type) {\n errMessage += `type: ${ex.type}
`;\n }\n resolve(errMessage);\n });\n }\n\n onBadRequest(ex: IException): Promise {\n return promise((resolve, reject) => {\n let errMessage = `Bad Request
`;\n if (ex.message) {\n errMessage += ` message : ${ex.message}
`;\n }\n if (ex.stack) {\n errMessage += `stacktrace: ${ex.stack}
`;\n }\n if (ex.type) {\n errMessage += `type: ${ex.type}
`;\n }\n resolve(errMessage);\n });\n }\n\n onForbiddenRequest(): Promise {\n return promise((resolve, reject) => {\n const errMessage = `Forbidden
`;\n resolve(errMessage);\n });\n }\n\n onNotAcceptableRequest(): Promise {\n return promise((resolve, reject) => {\n const errMessage = `Not Acceptable
`;\n resolve(errMessage);\n });\n }\n\n onMethodNotAllowed(): Promise {\n return promise((resolve, reject) => {\n const errMessage = `Method Not allowed.
`;\n resolve(errMessage);\n });\n }\n\n onNotFound(url: string): Promise {\n return promise((resolve, reject) => {\n const errMessage = `The requested resource ${url} was not found.
`;\n resolve(errMessage);\n });\n }\n}","import { IHttpCookie } from \"../interfaces\";\n\nexport class HttpCookie implements IHttpCookie {\n name: string;\n value: string;\n maxAge?: number;\n expires?: Date;\n domain?: string;\n httpOnly?: boolean;\n secure?: boolean;\n path?: string;\n\n constructor(name: string, value: string) {\n this.name = name;\n this.value = value;\n }\n}","import { __Constructor } from \"../constant\";\n\ntype InjectorStoreInfo = {\n className: string;\n methods: {\n [methodName: string]: any[]\n }\n};\n// this stores information of injector values that are available per class & worker\nconst injectorStoreInfos: InjectorStoreInfo[] = [];\n// this stores injector values\nconst injectorValues: any[] = [];\n// this stores the singletons name & their respective index in injector values\nconst singletons: {\n [className: string]: number\n} = {};\nexport class InjectorHandler {\n\n static addWorkerValue(className: string, methodName: string, paramIndex, paramValue, shouldFindIndex = true): number {\n\n if (shouldFindIndex === true) {\n const paramValueIndex = injectorValues.indexOf(paramValue);\n if (paramValueIndex < 0) {\n paramValue = injectorValues.push(paramValue) - 1;\n }\n else {\n paramValue = paramValueIndex;\n }\n }\n \n\n const savedValue = injectorStoreInfos.find(x => x.className === className);\n const value: InjectorStoreInfo = {\n className: className,\n methods: {\n [methodName]: []\n }\n };\n if (savedValue == null) {\n value.methods[methodName][paramIndex] = paramValue;\n injectorStoreInfos.push(value);\n }\n else {\n // const savedMethod = savedValue.methods[methodName];\n if (savedValue.methods[methodName] == null) {\n savedValue.methods[methodName] = [];\n }\n savedValue.methods[methodName][paramIndex] = paramValue;\n }\n\n return paramValue;\n }\n\n static getConstructorValues(className: string) {\n return this.getMethodValues(className, __Constructor);\n }\n\n static getMethodValues(className: string, methodName: string) {\n const savedValue = injectorStoreInfos.find(qry => qry.className === className);\n if (savedValue != null) {\n const methodArgs = savedValue.methods[methodName];\n if (methodArgs != null) {\n return methodArgs.map(injectorValueIndex => {\n return injectorValues[injectorValueIndex];\n });\n }\n }\n return [];\n }\n\n static addSingleton(className: string, methodName: string, paramIndex, paramValue) {\n const singletonClassName = paramValue.name;\n if (singletonClassName) {\n if (singletons[singletonClassName] == null) {\n singletons[singletonClassName] = InjectorHandler.addWorkerValue(className, methodName, paramIndex, new paramValue());\n }\n else {\n InjectorHandler.addWorkerValue(className, methodName, paramIndex, singletons[singletonClassName], false);\n }\n }\n }\n}","import { HTTP_STATUS_CODE, MIME_TYPE, HTTP_METHOD } from \"../enums\";\nimport * as http from \"http\";\nimport { __ContentType } from \"../constant\";\nimport { Global } from \"../global\";\nimport * as Negotiator from \"negotiator\";\nimport { CookieManager } from \"../models\";\nimport { Wall } from \"../abstracts\";\nimport { IException } from \"../interfaces\";\nimport { JsonHelper, reverseLoop } from \"../helpers\";\nimport { isNull } from \"../utils\";\nimport { InjectorHandler } from \"./injector_handler\";\n\n\nexport class RequestHandlerHelper {\n protected cookieManager: CookieManager;\n protected response: http.ServerResponse;\n protected request: http.IncomingMessage;\n\n protected wallInstances: Wall[] = [];\n\n protected runWallOutgoing() {\n const outgoingResults: Array> = [];\n reverseLoop(this.wallInstances, (value: Wall) => {\n const methodArgsValues = InjectorHandler.getMethodValues(value.constructor.name, 'onOutgoing');\n outgoingResults.push(value.onOutgoing(methodArgsValues));\n });\n return Promise.all(outgoingResults);\n }\n\n protected getContentTypeFromNegotiation(type: MIME_TYPE) {\n const negotiator = new Negotiator(this.request);\n let availableTypes: MIME_TYPE[] = this.getAvailableTypes_(type);\n if (availableTypes == null) {\n availableTypes = [type];\n }\n return negotiator.mediaType(availableTypes) as MIME_TYPE;\n }\n\n protected getContentTypeFromNegotiationHavingMultipleTypes(types: MIME_TYPE[]) {\n const negotiator = new Negotiator(this.request);\n return negotiator.mediaType(types) as MIME_TYPE;\n }\n\n private getAvailableTypes_(type: MIME_TYPE) {\n switch (type) {\n case MIME_TYPE.Json:\n case MIME_TYPE.Xml:\n return [MIME_TYPE.Json, MIME_TYPE.Xml];\n case MIME_TYPE.Html:\n case MIME_TYPE.Css:\n case MIME_TYPE.Csv:\n case MIME_TYPE.Js:\n case MIME_TYPE.Rtf:\n case MIME_TYPE.Text:\n return [MIME_TYPE.Text, MIME_TYPE.Html, MIME_TYPE.Js,\n MIME_TYPE.Css, MIME_TYPE.Rtf, MIME_TYPE.Csv];\n }\n return null;\n }\n\n protected async onBadRequest(error) {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onBadRequest(error);\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.writeHead(HTTP_STATUS_CODE.BadRequest, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onForbiddenRequest() {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onForbiddenRequest();\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.writeHead(HTTP_STATUS_CODE.Forbidden, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onNotAcceptableRequest() {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onNotAcceptableRequest();\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.writeHead(HTTP_STATUS_CODE.NotAcceptable, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onNotFound() {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onNotFound(this.request.url);\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.writeHead(HTTP_STATUS_CODE.NotFound, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onMethodNotAllowed(allowedMethods: HTTP_METHOD[]) {\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onMethodNotAllowed();\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.setHeader(\"Allow\", allowedMethods.join(\",\"));\n this.response.writeHead(HTTP_STATUS_CODE.MethodNotAllowed, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onErrorOccured(error) {\n if (typeof error === 'string') {\n error = {\n message: error\n } as IException;\n }\n let errMessage;\n try {\n await this.runWallOutgoing();\n errMessage = await new Global.errorHandler().onServerError(error);\n }\n catch (ex) {\n this.response.writeHead(HTTP_STATUS_CODE.InternalServerError, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(JsonHelper.stringify(ex));\n return;\n }\n this.response.writeHead(HTTP_STATUS_CODE.InternalServerError, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(errMessage);\n }\n\n protected async onRequestOptions(allowedMethods: HTTP_METHOD[]) {\n try {\n await this.runWallOutgoing();\n }\n catch (ex) {\n return this.onErrorOccured(ex);\n }\n this.response.setHeader(\"Allow\", allowedMethods.join(\",\"));\n this.response.writeHead(HTTP_STATUS_CODE.Ok, { [__ContentType]: MIME_TYPE.Html });\n this.response.end(\"\");\n }\n}","import { HTTP_STATUS_CODE, MIME_TYPE, ETag_Type } from \"../enums\";\nimport { Global } from \"../global\";\nimport * as path from \"path\";\nimport { __ContentType } from \"../constant\";\nimport { RequestHandlerHelper } from \"./request_handler_helper\";\nimport * as Fs from \"fs\";\nimport { getMimeTypeFromExtension, promise } from \"../helpers\";\nimport * as etag from \"etag\";\nimport * as fresh from \"fresh\";\nimport { isNullOrEmpty } from \"../utils\";\n\ntype FileInfo = {\n folder: string,\n file: string;\n};\nexport class FileHandler extends RequestHandlerHelper {\n\n private getFileInfoFromUrl_(urlPath: string) {\n const splittedValue = urlPath.split(\"/\");\n const fileInfo = {\n file: \"\"\n } as FileInfo;\n if (splittedValue.length > 2 || !isNullOrEmpty(path.parse(urlPath).ext)) {\n fileInfo.folder = splittedValue[1];\n fileInfo.file = splittedValue.splice(2).join(\"/\");\n return fileInfo;\n }\n fileInfo.folder = splittedValue[1];\n return fileInfo;\n\n }\n\n private getFileStats_(filePath) {\n return promise((res, rej) => {\n Fs.lstat(filePath, (err, status) => {\n if (err) {\n if (err.code === 'ENOENT') {\n res(null);\n }\n else {\n rej(err);\n }\n }\n else {\n res(status);\n }\n });\n });\n }\n\n protected handleFileRequestFromAbsolutePath(absolutePath: string, fileType: string) {\n this.getFileStats_(absolutePath).then(fileInfo => {\n if (fileInfo != null) {\n if (fileInfo.isDirectory() === true) {\n this.handleFileRequestForPath_(absolutePath);\n }\n else {\n this.sendFile_(absolutePath, fileType, fileInfo);\n }\n }\n else {\n this.onNotFound();\n }\n }).catch(ex => {\n this.onErrorOccured(ex);\n });\n }\n\n private checkForFolderAllowAndReturnPath_(urlPath: string) {\n const fileInfo = this.getFileInfoFromUrl_(urlPath);\n const getAbsPath = function () {\n const folder = Global.folders.find(qry => qry.alias === fileInfo.folder);\n if (folder != null) {\n return path.join(folder.path, fileInfo.file);\n }\n return null;\n };\n let absPath = getAbsPath();\n if (absPath == null) {\n fileInfo.folder = \"/\";\n fileInfo.file = urlPath;\n absPath = getAbsPath();\n }\n return absPath;\n }\n\n protected handleFileRequest(urlPath: string) {\n const extension = path.parse(urlPath).ext;\n const absFilePath = this.checkForFolderAllowAndReturnPath_(urlPath);\n if (absFilePath != null) {\n this.handleFileRequestFromAbsolutePath(absFilePath, extension);\n }\n else {\n this.onNotFound();\n }\n }\n\n /**\n * process folders handling asuuming path is folder.\n * Please check whether the file is folder before calling this function\n *\n * @private\n * @param {string} filePath\n * @param {Fs.Stats} fileInfo\n * @returns\n * @memberof FileHandler\n */\n private handleFileRequestForPath_(absolutePath: string) {\n\n absolutePath = path.join(absolutePath, \"index.html\");\n this.getFileStats_(absolutePath).then(fileInfo => {\n if (fileInfo != null) {\n const fileType = MIME_TYPE.Html;\n this.sendFile_(absolutePath, fileType, fileInfo);\n }\n else {\n this.onNotFound();\n }\n }).catch(ex => {\n this.onErrorOccured(ex);\n });\n }\n\n private isClientHasFreshFile_(lastModified: string, etagValue: string) {\n return fresh(this.request.headers, {\n 'etag': etagValue,\n 'last-modified': lastModified\n });\n }\n\n private sendFile_(filePath: string, fileType: string, fileInfo: Fs.Stats) {\n this.runWallOutgoing().then(() => {\n let mimeType;\n if (fileType[0] === '.') { // its extension\n mimeType = getMimeTypeFromExtension(fileType);\n }\n else { // mime type\n mimeType = fileType;\n }\n const negotiateMimeType = this.getContentTypeFromNegotiation(mimeType) as MIME_TYPE;\n if (negotiateMimeType != null) {\n const lastModified = fileInfo.mtime.toUTCString();\n const eTagValue = etag(fileInfo, {\n weak: Global.eTag.type === ETag_Type.Weak\n });\n if (this.isClientHasFreshFile_(lastModified, eTagValue)) { // client has fresh file\n this.response.statusCode = HTTP_STATUS_CODE.NotModified;\n this.response.end();\n }\n else {\n this.response.writeHead(HTTP_STATUS_CODE.Ok, {\n [__ContentType]: mimeType,\n 'Etag': eTagValue,\n 'Last-Modified': lastModified\n });\n const readStream = Fs.createReadStream(filePath);\n // Handle non-existent file\n readStream.on('error', this.onErrorOccured.bind(this));\n readStream.pipe(this.response);\n }\n }\n else {\n this.onNotAcceptableRequest();\n }\n }).catch(ex => {\n this.onErrorOccured(ex);\n });\n }\n}","\nimport { HttpResult, HttpFormatResult } from \"../types\";\nimport { __SetCookie, __ContentType } from \"../constant\";\nimport { MIME_TYPE, HTTP_STATUS_CODE } from \"../enums\";\nimport { FileHandler } from \"./file_handler\";\nimport * as path from 'path';\nimport { XmlHelper, textResult } from \"../helpers\";\n\nexport class ControllerResultHandler extends FileHandler {\n private controllerResult_: HttpResult;\n\n private getDataBasedOnMimeType_(mimeType: MIME_TYPE) {\n switch (mimeType) {\n case MIME_TYPE.Json:\n case MIME_TYPE.Text:\n case MIME_TYPE.Html:\n if (typeof this.controllerResult_.responseData === 'object') {\n return JSON.stringify(this.controllerResult_.responseData);\n }\n break;\n case MIME_TYPE.Xml:\n if (typeof this.controllerResult_.responseData === 'object') {\n return XmlHelper.fromJsToXml(this.controllerResult_.responseData);\n }\n break;\n }\n return this.controllerResult_.responseData;\n }\n\n private endResponse_(negotiateMimeType: MIME_TYPE) {\n let data;\n try {\n data = this.getDataBasedOnMimeType_(negotiateMimeType);\n }\n catch (ex) {\n this.onErrorOccured(ex);\n return;\n }\n\n this.response.writeHead(this.controllerResult_.statusCode || HTTP_STATUS_CODE.Ok,\n { [__ContentType]: negotiateMimeType });\n this.response.end(data);\n }\n\n private handleRedirectResult_() {\n this.response.setHeader('Location', this.controllerResult_.responseData);\n this.response.writeHead(this.controllerResult_.statusCode || HTTP_STATUS_CODE.Ok,\n { 'Location': this.controllerResult_.responseData });\n this.response.end();\n }\n\n private handleFormatResult_() {\n const negotiateMimeType = this.getContentTypeFromNegotiationHavingMultipleTypes(Object.keys((this.controllerResult_ as HttpFormatResult).responseFormat) as MIME_TYPE[]);\n const key = Object.keys((this.controllerResult_ as HttpFormatResult).responseFormat).find(qry => qry === negotiateMimeType);\n if (key != null) {\n this.controllerResult_.responseData = (this.controllerResult_ as HttpFormatResult).responseFormat[key]();\n this.endResponse_(negotiateMimeType);\n }\n else {\n this.onNotAcceptableRequest();\n }\n }\n\n private handleFileResult_() {\n const result = this.controllerResult_;\n const parsedPath = path.parse(result.file.filePath);\n if (result.file.shouldDownload === true) {\n const fileName = result.file.alias == null ? parsedPath.name : result.file.alias;\n this.response.setHeader(\n \"Content-Disposition\",\n `attachment;filename=${fileName}${parsedPath.ext}`\n );\n }\n this.handleFileRequestFromAbsolutePath(result.file.filePath, parsedPath.ext);\n }\n\n onTerminationFromWall(result: HttpResult | HttpFormatResult) {\n this.handleFinalResult_(result);\n }\n\n private handleFinalResult_(result: HttpResult | HttpFormatResult) {\n result = result || textResult(\"\");\n this.controllerResult_ = result as HttpResult;\n\n ((this.cookieManager as any).responseCookie_ as string[]).forEach(value => {\n this.response.setHeader(__SetCookie, value);\n });\n\n if ((result as HttpResult).shouldRedirect == null || (result as HttpResult).shouldRedirect === false) {\n if ((result as HttpFormatResult).responseFormat == null) {\n if ((result as HttpResult).file == null) {\n const contentType = (result as HttpResult).contentType || MIME_TYPE.Text;\n const negotiateMimeType = this.getContentTypeFromNegotiation(contentType) as MIME_TYPE;\n if (negotiateMimeType != null) {\n this.endResponse_(negotiateMimeType);\n }\n else {\n this.onNotAcceptableRequest();\n }\n }\n else {\n this.handleFileResult_();\n }\n }\n else {\n this.handleFormatResult_();\n }\n }\n else {\n this.handleRedirectResult_();\n }\n }\n\n async onResultFromController(result: HttpResult | HttpFormatResult) {\n try {\n await this.runWallOutgoing();\n } catch (ex) {\n this.onErrorOccured(ex);\n return;\n }\n this.handleFinalResult_(result);\n }\n}","import { ControllerResultHandler } from \"./controller_result_handler\";\nimport { promise, JsonHelper } from \"../helpers\";\nimport { __ContentType } from \"../constant\";\nimport { MIME_TYPE } from \"../enums\";\nimport * as ContentType from \"content-type\";\nimport * as QueryString from 'querystring';\nimport * as Multiparty from \"multiparty\";\nimport { MultiPartParseResult } from \"../types\";\nimport { FileManager } from \"../models\";\nimport { Global } from \"../global\";\n\n\nexport class PostHandler extends ControllerResultHandler {\n protected body: any;\n protected file: FileManager;\n\n private getPostRawData_(): Promise {\n const body = [];\n return promise((res, rej) => {\n this.request.on('data', (chunk) => {\n body.push(chunk);\n }).on('end', () => {\n const bodyBuffer = Buffer.concat(body);\n res(bodyBuffer.toString());\n }).on(\"error\", function (err) {\n rej(err);\n });\n });\n }\n\n private parseMultiPartData_(): Promise {\n return promise((res, rej) => {\n new Multiparty.Form().parse(this.request, (err, fields, files) => {\n if (err) {\n rej(err);\n }\n else {\n const result: MultiPartParseResult = {\n field: {},\n file: {}\n };\n for (const field in fields) {\n result.field[field] = fields[field].length === 1 ? fields[field][0] : fields[field];\n }\n for (const file in files) {\n result.file[file] = files[file].length === 1 ? files[file][0] : files[file];\n }\n res(result);\n }\n });\n });\n }\n\n protected async parsePostData() {\n\n let postData;\n\n let contentType = this.request.headers[__ContentType] || this.request.headers[\"content-type\"];\n if (contentType != null) {\n contentType = ContentType.parse(contentType as string).type;\n }\n if (contentType === MIME_TYPE.FormMultiPart) {\n const result = await this.parseMultiPartData_();\n postData = result.field;\n this.file = new FileManager(result.file);\n }\n else {\n this.file = new FileManager({});\n const bodyDataAsString = await this.getPostRawData_();\n switch (contentType) {\n case MIME_TYPE.Json:\n postData = JsonHelper.parse(bodyDataAsString);\n break;\n case MIME_TYPE.Text:\n case MIME_TYPE.Html:\n postData = bodyDataAsString; break;\n case MIME_TYPE.FormUrlEncoded:\n postData = QueryString.parse(bodyDataAsString); break;\n case MIME_TYPE.Xml:\n postData = new (Global as any).xmlParser().parse(bodyDataAsString);\n break;\n default:\n postData = {};\n }\n }\n\n return postData;\n\n }\n}","import * as http from \"http\";\nimport * as url from 'url';\nimport { Controller } from \"../abstracts\";\nimport { __ContentType, __AppName, __Cookie, __SetCookie } from \"../constant\";\nimport { Global } from \"../global\";\nimport { parseCookie, parseAndMatchRoute, promise } from \"../helpers\";\nimport { CookieManager, FileManager } from \"../models\";\nimport { GenericSessionProvider, GenericGuard } from \"../generics\";\nimport { RouteMatch, HttpRequest, HttpResponse } from \"../types\";\nimport { HTTP_METHOD } from \"../enums\";\nimport { PostHandler } from \"./post_handler\";\nimport { InjectorHandler } from \"./injector_handler\";\n\n\nexport class RequestHandler extends PostHandler {\n\n private session_: GenericSessionProvider;\n private query_: any;\n private data_ = {};\n private routeMatchInfo_: RouteMatch;\n\n\n constructor(request: http.IncomingMessage, response: http.ServerResponse) {\n super();\n this.request = request;\n this.response = response;\n this.registerEvents_();\n }\n\n private registerEvents_() {\n this.request.on('error', this.onBadRequest.bind(this));\n this.response.on('error', this.onErrorOccured.bind(this));\n }\n\n private executeWallIncoming_(): Promise {\n return promise((res) => {\n let index = 0;\n const wallLength = Global.walls.length;\n const executeWallIncomingByIndex = async () => {\n if (wallLength > index) {\n const wall = Global.walls[index++];\n const constructorArgsValues = InjectorHandler.getConstructorValues(wall.name);\n const wallObj = new wall(...constructorArgsValues);\n wallObj.cookie = this.cookieManager;\n wallObj.session = this.session_;\n wallObj.request = this.request as HttpRequest;\n wallObj.response = this.response as HttpResponse;\n wallObj.data = this.data_;\n wallObj.query = this.query_;\n this.wallInstances.push(wallObj);\n const methodArgsValues = InjectorHandler.getMethodValues(wall.name, 'onIncoming');\n try {\n const result = await wallObj.onIncoming(...methodArgsValues);\n if (result == null) {\n executeWallIncomingByIndex();\n }\n else {\n res(false);\n this.onTerminationFromWall(result);\n }\n } catch (ex) {\n this.onErrorOccured(ex);\n res(false);\n }\n }\n else {\n res(true);\n }\n };\n executeWallIncomingByIndex();\n });\n }\n\n private runController_() {\n const constructorValues = InjectorHandler.getConstructorValues(this.routeMatchInfo_.controller.name);\n const controllerObj: Controller = new this.routeMatchInfo_.controller(...constructorValues);\n controllerObj.request = this.request as HttpRequest;\n controllerObj.response = this.response;\n controllerObj.query = this.query_;\n controllerObj.body = this.body;\n controllerObj.session = this.session_;\n controllerObj.cookie = this.cookieManager;\n controllerObj.param = this.routeMatchInfo_.params;\n controllerObj.data = this.data_;\n controllerObj.file = this.file;\n const methodArgsValues = InjectorHandler.getMethodValues(this.routeMatchInfo_.controller.name, this.routeMatchInfo_.workerInfo.workerName);\n controllerObj[this.routeMatchInfo_.workerInfo.workerName](...methodArgsValues).then(\n this.onResultFromController.bind(this)\n ).catch(this.onErrorOccured.bind(this));\n }\n\n private executeShieldsProtection_(): Promise {\n return promise((res) => {\n let index = 0;\n const shieldLength = this.routeMatchInfo_.shields.length;\n const executeShieldByIndex = async () => {\n if (shieldLength > index) {\n const shield = this.routeMatchInfo_.shields[index++];\n const constructorArgsValues = InjectorHandler.getConstructorValues(shield.name);\n const shieldObj = new shield(...constructorArgsValues);\n shieldObj.cookie = this.cookieManager;\n shieldObj.query = this.query_;\n shieldObj.session = this.session_;\n shieldObj.request = this.request as HttpRequest;\n shieldObj.response = this.response as HttpResponse;\n shieldObj.data = this.data_;\n shieldObj.workerName = this.routeMatchInfo_.workerInfo.workerName;\n const methodArgsValues = InjectorHandler.getMethodValues(shield.name, 'protect');\n\n try {\n const result = await shieldObj.protect(...methodArgsValues);\n if (result == null) {\n executeShieldByIndex();\n }\n else {\n res(false);\n this.onResultFromController(result);\n }\n } catch (ex) {\n this.onErrorOccured(ex);\n res(false);\n }\n }\n else {\n res(true);\n }\n };\n executeShieldByIndex();\n });\n }\n\n private executeGuardsCheck_(guards: Array): Promise {\n return promise((res) => {\n let index = 0;\n const shieldLength = guards.length;\n const executeGuardByIndex = async () => {\n if (shieldLength > index) {\n const guard = guards[index++];\n const constructorArgsValues = InjectorHandler.getConstructorValues(guard.name);\n const guardObj = new guard(...constructorArgsValues);\n guardObj.body = this.body;\n guardObj.cookie = this.cookieManager;\n guardObj.query = this.query_;\n guardObj.session = this.session_;\n guardObj.request = this.request as HttpRequest;\n guardObj.response = this.response as HttpResponse;\n guardObj.data = this.data_;\n guardObj.file = this.file;\n guardObj.param = this.routeMatchInfo_.params;\n const methodArgsValues = InjectorHandler.getMethodValues(guard.name, 'check');\n try {\n const result = await guardObj.check(...methodArgsValues);\n if (result == null) {\n executeGuardByIndex();\n }\n else {\n res(false);\n this.onResultFromController(result);\n }\n } catch (ex) {\n this.onErrorOccured(ex);\n res(false);\n }\n }\n else {\n res(true);\n }\n };\n executeGuardByIndex();\n });\n }\n\n private parseCookieFromRequest_() {\n if (Global.shouldParseCookie === true) {\n const rawCookie = (this.request.headers[__Cookie] || this.request.headers[\"cookie\"]) as string;\n let parsedCookies;\n try {\n parsedCookies = parseCookie(rawCookie);\n } catch (ex) {\n this.onErrorOccured(ex);\n return false;\n }\n this.session_ = new Global.sessionProvider();\n this.session_.cookie = this.cookieManager = new CookieManager(parsedCookies);\n this.session_.sessionId = parsedCookies[Global.appSessionIdentifier];\n }\n else {\n this.cookieManager = new CookieManager({});\n }\n return true;\n }\n\n private setPreHeader_() {\n this.response.setHeader('X-Powered-By', Global.appName);\n this.response.setHeader('Vary', 'Accept-Encoding');\n this.response.sendDate = true;\n }\n\n private async onRouteMatched_() {\n const actionInfo = this.routeMatchInfo_.workerInfo;\n if (actionInfo == null) {\n if (this.request.method === HTTP_METHOD.Options) {\n this.onRequestOptions(this.routeMatchInfo_.allowedHttpMethod);\n }\n else {\n this.onMethodNotAllowed(this.routeMatchInfo_.allowedHttpMethod);\n }\n }\n else {\n let shouldExecuteNextComponent = await this.executeShieldsProtection_();\n if (shouldExecuteNextComponent === true) {\n shouldExecuteNextComponent = await this.handlePostData();\n if (shouldExecuteNextComponent === true) {\n shouldExecuteNextComponent = await this.executeGuardsCheck_(actionInfo.guards);\n if (shouldExecuteNextComponent === true) {\n this.runController_();\n }\n }\n }\n }\n }\n\n private async execute_() {\n const urlDetail = url.parse(this.request.url, true);\n this.query_ = urlDetail.query;\n let shouldExecuteNextProcess = this.parseCookieFromRequest_();\n if (shouldExecuteNextProcess === true) {\n shouldExecuteNextProcess = await this.executeWallIncoming_();\n if (shouldExecuteNextProcess === true) {\n const pathUrl = urlDetail.pathname;\n const requestMethod = this.request.method as HTTP_METHOD;\n try {\n this.routeMatchInfo_ = parseAndMatchRoute(pathUrl.toLowerCase(), requestMethod);\n }\n catch (ex) {\n this.onErrorOccured(ex);\n return;\n }\n if (this.routeMatchInfo_ == null) { // no route matched\n // it may be a file or folder then\n this.handleFileRequest(pathUrl);\n }\n else {\n this.onRouteMatched_();\n }\n }\n }\n }\n\n async handlePostData() {\n if (this.request.method === HTTP_METHOD.Get) {\n this.body = {};\n this.file = new FileManager({});\n }\n else if (Global.shouldParsePost === true) {\n try {\n this.body = await this.parsePostData();\n } catch (ex) {\n this.onBadRequest(ex);\n return false;\n }\n }\n return true;\n }\n\n async handle() {\n this.setPreHeader_();\n this.execute_();\n }\n}","export * from \"./route_handler\";\nexport * from \"./request_handler\";\nexport * from \"./file_handler\";\nexport * from \"./request_handler_helper\";\nexport * from \"./controller_result_handler\";\nexport * from \"./post_handler\";\nexport * from './injector_handler';","import * as Mustache from \"mustache\";\nimport { ViewEngineData } from \"../types\";\nimport { getViewFromFile } from \"../helpers\";\nimport { ViewEngine } from \"../abstracts\";\n\nexport class MustacheViewEngine implements ViewEngine {\n\n async render(value: ViewEngineData) {\n const viewData = await getViewFromFile(value.view);\n return Mustache.render(viewData, value.model);\n }\n}","import { CookieManager } from \"../models\";\nimport * as getUniqId from \"uniqid\";\nimport { Global } from \"../global\";\nimport { SessionValue } from \"../types\";\n\nexport abstract class SessionProvider {\n\n sessionId: string;\n protected cookie: CookieManager;\n\n abstract get(key: string): Promise;\n abstract isExist(key: string): Promise;\n abstract getAll(): Promise;\n abstract set(key: string, val: any): Promise;\n abstract setMany(values: SessionValue[]): Promise;\n abstract remove(key: string): Promise;\n\n abstract clear(): Promise;\n\n protected createSession() {\n const now = new Date();\n this.sessionId = getUniqId();\n this.cookie.addCookie({\n name: Global.appSessionIdentifier,\n value: this.sessionId,\n httpOnly: true,\n path: \"/\",\n expires: new Date(now.setMinutes(now.getMinutes() + Global.sessionTimeOut)),\n maxAge: Global.sessionTimeOut * 60\n });\n }\n\n protected destroySession() {\n const cookie = this.cookie.getCookie(Global.appSessionIdentifier);\n cookie.httpOnly = true;\n cookie.path = \"/\";\n this.cookie.removeCookie(cookie);\n }\n}\n\n","\nimport { SessionProvider } from \"../abstracts/session_provider\";\nimport { SessionValue } from \"../types/session_value\";\n\n\ninterface ISessionValueFormat {\n identifier: string;\n datas: SessionValue[];\n}\n\nconst sessionValues: ISessionValueFormat[] = [];\n\nexport class MemorySessionProvider extends SessionProvider {\n\n async get(key: string) {\n const savedSession = sessionValues.find(q => q.identifier === this.sessionId);\n if (savedSession != null) {\n const session = savedSession.datas.find(qry => qry.key === key);\n return session.value;\n }\n return null;\n }\n\n async isExist(key: string) {\n const savedValue = sessionValues.find(q => q.identifier === this.sessionId);\n if (savedValue == null) {\n return false;\n }\n else {\n const index = savedValue.datas.findIndex(qry => qry.key === key);\n return index >= 0;\n }\n }\n\n async getAll() {\n const savedValue = sessionValues.find(q => q.identifier === this.sessionId);\n return savedValue == null ? [] : savedValue.datas;\n }\n\n async set(key: string, val: any) {\n const savedValue = sessionValues.find(q => q.identifier === this.sessionId);\n if (savedValue == null) {\n this.createSession();\n sessionValues.push({\n identifier: this.sessionId,\n datas: [{\n key: key,\n value: val\n }]\n });\n }\n else {\n const savedSessionData = savedValue.datas.find(q => q.key === key);\n if (savedSessionData == null) {\n savedValue.datas.push({\n key: key,\n value: val\n });\n }\n else {\n savedSessionData.value = val;\n }\n }\n }\n\n setMany(values: SessionValue[]) {\n return Promise.all(\n values.map(async (value) => {\n return await this.set(value.key, value.value);\n })\n );\n }\n\n async remove(key: string) {\n const savedValue = sessionValues.find(q => q.identifier === this.sessionId);\n if (savedValue != null) {\n const index = savedValue.datas.findIndex(q => q.key === key);\n savedValue.datas.splice(index, 1);\n }\n }\n\n async clear() {\n // remove session values\n const index = sessionValues.findIndex(q => q.identifier === this.sessionId);\n if (index >= 0) {\n sessionValues.splice(index, 1);\n }\n // expire cookie in browser\n this.destroySession();\n }\n}","export * from './mustache_view_engine';\nexport * from \"./memory_session_provider\";","import { HttpResponse } from \"../types\";\n\nexport class HttpResponseStub implements HttpResponse {\n private headers_;\n constructor(headers) {\n this.headers_ = headers;\n }\n\n getHeader(name: string) {\n return this.headers_[name];\n }\n\n\n hasHeader(name: string) {\n return this.headers_[name] != null;\n }\n\n setHeader(name: string, value: number | string | string[]) {\n this.headers_[name] = value;\n }\n\n getHeaders() {\n return this.headers_;\n }\n\n getHeaderNames(): string[] {\n return Object.keys[this.headers_];\n }\n\n removeHeader(name: string) {\n delete this.headers_[name];\n }\n}","import { HttpRequest } from \"../types\";\n\nexport class HttpRequestStub implements HttpRequest {\n headers;\n\n constructor(headers) {\n this.headers = headers;\n }\n}","\nimport { CookieManager, FileManager } from \"../models\";\nimport { Global } from \"../global\";\nimport { ControllerTestData } from \"../types\";\nimport { HttpResponseStub } from \"./http_response_stub\";\nimport { HttpRequestStub } from \"./http_request_stub\";\nimport { Controller } from \"../abstracts\";\n\n\n\nexport const initController = (controllerInstance: Controller, data?: ControllerTestData) => {\n data = data || {};\n const parsedCookies = data.cookieValue || {};\n const headers = (data.request && data.request.headers) || {};\n controllerInstance.request = new HttpRequestStub(headers);\n controllerInstance.response = new HttpResponseStub(headers);\n controllerInstance.query = data.query || {};\n controllerInstance.body = data.body || {};\n controllerInstance.cookie = new CookieManager(parsedCookies);\n const session = new Global.sessionProvider();\n session.cookie = controllerInstance.cookie;\n session.sessionId = parsedCookies[Global.appSessionIdentifier];\n controllerInstance.session = session;\n controllerInstance.param = data.param || {};\n controllerInstance.data = data.data || {};\n controllerInstance.file = new FileManager(data.file || {});\n return controllerInstance;\n};","\nimport { initController } from \"./init_controller\";\nimport { ControllerTestData } from \"../types\";\n\nexport type GuardTestData = ControllerTestData;\n\nexport const initGuard = (guardInstance, data?: GuardTestData) => {\n return initController(guardInstance, data);\n};","\nimport { initController } from \"./init_controller\";\nimport { ControllerTestData } from \"../types\";\n\nexport type ShieldTestData = ControllerTestData & {\n workerName?: string;\n};\n\nexport const initShield = (shieldInstance, data?: ShieldTestData) => {\n const value: ShieldTestData = initController(shieldInstance, data) as any;\n value.workerName = data && data.workerName;\n return value;\n};","\nimport { initController } from \"./init_controller\";\nimport { ControllerTestData } from \"../types\";\n\nexport type WallTestData = ControllerTestData;\n\nexport const initWall = (wallInstance, data?: WallTestData) => {\n return initController(wallInstance, data);\n};","export * from './init_controller';\nexport * from './init_guard';\nexport * from './init_shield';\nexport * from './init_wall';","import { HttpRequest, HttpResponse, ControllerTestData } from \"../types\";\nimport { CookieManager, FileManager } from \"../models\";\nimport { SessionProvider } from \".\";\nimport { initController } from \"../test_helpers\";\n\n\nexport abstract class Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: string };\n body?: { [key: string]: any };\n session: SessionProvider;\n cookie: CookieManager;\n param?: { [key: string]: string };\n data: { [key: string]: any };\n\n file?: FileManager;\n\n constructor(...args) {\n\n }\n\n initialize(data?: ControllerTestData) {\n initController(this, data);\n }\n}","import { HttpRequest, HttpResponse, HttpResult } from \"../types\";\nimport { CookieManager } from \"../models\";\nimport { SessionProvider, Controller } from \".\";\nimport { ShieldTestData, initShield } from \"../test_helpers\";\n\n\nexport abstract class Shield implements Controller {\n workerName: string;\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: string };\n\n session: SessionProvider;\n cookie: CookieManager;\n\n data: { [key: string]: any };\n\n abstract protect(...args): Promise;\n\n constructor(...args) {\n\n }\n\n initialize(data?: ShieldTestData) {\n return initShield(this, data);\n }\n}\n\n","import { HttpRequest, HttpResponse, HttpResult } from \"../types\";\nimport { CookieManager, FileManager } from \"../models\";\nimport { Controller } from \"./controller\";\nimport { SessionProvider } from \"./session_provider\";\nimport { GuardTestData, initGuard } from \"../test_helpers\";\n\n\nexport abstract class Guard implements Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: string };\n body: { [key: string]: any };\n session: SessionProvider;\n cookie: CookieManager;\n param?: { [key: string]: string };\n data: { [key: string]: any };\n file: FileManager;\n abstract check(...args): Promise;\n\n constructor(...args) {\n\n }\n\n initialize(data?: GuardTestData) {\n return initGuard(this, data);\n }\n}","import { ViewEngineData } from \"../types\";\n\nexport abstract class ViewEngine {\n abstract render(value: ViewEngineData): Promise;\n}","import { HttpRequest, HttpResponse, HttpResult } from \"../types\";\nimport { CookieManager } from \"../models\";\nimport { Controller } from \"./controller\";\nimport { SessionProvider } from \"./session_provider\";\nimport { WallTestData, initWall } from \"../test_helpers\";\n\n\nexport abstract class Wall implements Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: string };\n session: SessionProvider;\n cookie: CookieManager;\n\n data: { [key: string]: any };\n\n abstract onIncoming(...args): Promise;\n async onOutgoing(...args) {\n return null;\n }\n\n constructor(...args) {\n\n }\n\n initialize(data?: WallTestData) {\n return initWall(this, data);\n }\n}","export abstract class XmlParser {\n abstract async parse(xml: string): Promise;\n}","export * from './controller';\nexport * from './shield';\nexport * from './session_provider';\nexport * from './guard';\nexport * from './view_engine';\nexport * from './wall';\nexport * from \"./xml_parser\";","import { Guard } from \"../abstracts\";\nimport { HttpResult } from \"../types\";\n\nexport class GenericGuard extends Guard {\n\n constructor(...args) {\n super();\n }\n\n check(...args): Promise {\n return null;\n }\n}","import { Shield } from \"../abstracts\";\nimport { HttpResult } from \"../types\";\n\nexport class GenericShield extends Shield {\n constructor(...args) {\n super();\n }\n \n protect(...args): Promise {\n return null;\n }\n}","import { SessionProvider } from \"../abstracts\";\nimport { SessionValue } from \"../types\";\nimport { CookieManager } from \"../models\";\n\n\nexport class GenericSessionProvider extends SessionProvider {\n sessionId: string;\n\n cookie: CookieManager;\n get() {\n return null;\n }\n\n getAll() {\n return null;\n }\n\n set(key, value) {\n return null;\n }\n\n isExist(key) {\n return null;\n }\n\n remove(key) {\n return null;\n }\n\n setMany(values: SessionValue[]): Promise {\n return null;\n }\n\n async clear() {\n\n }\n}","import { Wall } from \"../abstracts\";\nimport { HttpResult } from \"../types\";\n\nexport class GenericWall extends Wall {\n constructor(...args) {\n super();\n }\n onIncoming(...args): Promise {\n return null;\n }\n}","import { Controller } from \"../abstracts\";\n\nexport class GenericController extends Controller {\n constructor(...args) {\n super();\n }\n}","import { XmlParser } from \"../abstracts\";\nimport { IException } from \"../interfaces\";\n\nexport class GenericXmlParser implements XmlParser {\n async parse(xml: string): Promise {\n // tslint:disable-next-line\n throw {\n message: \"no xml parser configured\"\n } as IException;\n }\n}","export * from './generic_guard';\nexport * from './generic_shield';\nexport * from './generic_session_provider';\nexport * from \"./generic_wall\";\nexport * from \"./generic_controller\";\nexport * from './generic_xml_parser';","import { ParentRoute, AppOption, EtagOption } from \"../types\";\nimport { Wall, ViewEngine, SessionProvider, XmlParser } from \"../abstracts\";\nimport { RouteHandler, RequestHandler } from \"../handlers\";\nimport { Global } from \"../global\";\nimport { MemorySessionProvider, MustacheViewEngine } from \"../extra\";\nimport { ErrorHandler } from \".\";\nimport { __AppName } from \"../constant\";\nimport * as http from \"http\";\nimport { ETag_Type, ERROR_TYPE } from \"../enums\";\nimport { LogHelper, promise, removeLastSlash, removeFirstSlash } from \"../helpers\";\nimport { GenericSessionProvider, GenericXmlParser, GenericController } from \"../generics\";\nimport { isNull, isNullOrEmpty, isArray } from \"../utils\";\n\nexport class Fort {\n routes: ParentRoute[] = [];\n walls: Array = [];\n httpServer: http.Server;\n\n /**\n * view engine use to render the view\n *\n * @type {typeof ViewEngine}\n * @memberof Fort\n */\n viewEngine?: typeof ViewEngine;\n\n /**\n * sessionProvider class, default - MemorySessionProvider\n *\n * @type {typeof SessionProvider}\n */\n sessionProvider?: typeof SessionProvider;\n\n /**\n * Custom error handler class\n *\n * @type {typeof ErrorHandler}\n */\n errorHandler?: typeof ErrorHandler;\n\n /**\n * XmlParser class - used to parse the xml \n *\n * @type {typeof XmlParser}\n * @memberof Fort\n */\n xmlParser?: typeof XmlParser;\n\n private saveAppOption_(option: AppOption) {\n const defaultEtagConfig = {\n type: ETag_Type.Weak\n } as EtagOption;\n\n Global.port = option.port == null ? 4000 : option.port;\n Global.shouldParseCookie = option.shouldParseCookie == null ? true : option.shouldParseCookie;\n Global.shouldParsePost = isNull(option.shouldParsePost) ? true : option.shouldParsePost;\n Global.sessionTimeOut = isNull(option.sessionTimeOut) ? 60 : option.sessionTimeOut;\n Global.folders = option.folders == null ? [] : option.folders;\n if (isArray(Global.folders) === false) {\n throw new Error(`Option folders should be an array`);\n }\n Global.appName = isNullOrEmpty(option.appName) === true ? __AppName : option.appName;\n Global.appSessionIdentifier = `${Global.appName}_session_id`;\n Global.eTag = isNull(option.eTag) ? defaultEtagConfig : option.eTag;\n Global.walls = this.walls as any;\n Global.viewEngine = isNull(this.viewEngine) ? new MustacheViewEngine() : new (this.viewEngine as any)();\n Global.sessionProvider = isNull(this.sessionProvider) ? MemorySessionProvider as any :\n this.sessionProvider as typeof GenericSessionProvider;\n Global.errorHandler = isNull(this.errorHandler) ? ErrorHandler : this.errorHandler;\n Global.xmlParser = isNull(this.xmlParser) ? GenericXmlParser : this.xmlParser;\n Global.viewPath = isNull(option.viewPath) ? \"views\" : option.viewPath;\n }\n\n create(option?: AppOption): Promise {\n if (option == null) {\n option = {\n\n };\n }\n\n if (this.routes == null) {\n this.routes = [];\n }\n let isDefaultRouteExist = false;\n // removing / from routes\n this.routes.forEach(route => {\n route.path = removeFirstSlash(route.path);\n route.path = removeLastSlash(route.path);\n if (route.path === \"*\") {\n isDefaultRouteExist = true;\n }\n RouteHandler.addToRouterCollection(route);\n });\n if (isDefaultRouteExist === false) {\n RouteHandler.addToRouterCollection({\n controller: GenericController,\n path: \"*\"\n });\n }\n if (option.folders != null) {\n // remove / from files routes\n option.folders.forEach(folder => {\n const length = folder.alias.length;\n if (length > 1) {\n folder.alias = removeFirstSlash(folder.alias);\n folder.alias = removeLastSlash(folder.alias);\n }\n\n });\n }\n\n this.saveAppOption_(option);\n return promise((res, rej) => {\n this.httpServer = http.createServer((request, response) => {\n new RequestHandler(request, response).handle();\n }).once(\"error\", (err) => {\n if ((err as any).code === 'EADDRINUSE') {\n const error = new LogHelper(ERROR_TYPE.PortInUse, Global.port).get();\n rej(error);\n }\n else {\n rej(err);\n }\n }).once('listening', () => {\n res();\n }).listen(Global.port);\n });\n }\n\n destroy(): Promise {\n return promise((res, rej) => {\n this.httpServer.close(res);\n });\n }\n\n}\n","import { RouteInfo } from \"../types\";\nimport { RouteHandler } from \"../handlers\";\n\nexport class Router {\n routes: RouteInfo[] = RouteHandler.routerCollection;\n}","import { HttpCookie } from \"./http_cookie\";\nimport { IHttpCookie } from \"../interfaces\";\n\nexport class CookieManager {\n private responseCookie_: string[] = [];\n private cookieCollection_: { [key: string]: string };\n\n constructor(parsedValue: { [key: string]: string }) {\n this.cookieCollection_ = parsedValue;\n }\n\n /**\n * return cookie by name\n *\n * @param {string} name\n * @returns\n * @memberof CookieManager\n */\n getCookie(name: string): HttpCookie {\n return {\n name: name,\n value: this.cookieCollection_[name]\n } as IHttpCookie;\n }\n\n /**\n * add cookie\n *\n * @param {HttpCookie} cookie\n * @memberof CookieManager\n */\n addCookie(cookie: HttpCookie) {\n this.cookieCollection_[cookie.name] = cookie.value;\n this.responseCookie_.push(this.getCookieStringFromCookie_(cookie));\n }\n\n /**\n * remove cookie\n *\n * @param {HttpCookie} cookie\n * @memberof CookieManager\n */\n removeCookie(cookie: HttpCookie) {\n this.cookieCollection_[cookie.name] = null;\n cookie.expires = new Date('Thu, 01 Jan 1970 00:00:00 GMT');\n cookie.maxAge = -1;\n this.responseCookie_.push(this.getCookieStringFromCookie_(cookie));\n }\n\n /**\n * collection of http cookie\n *\n * @readonly\n * @memberof CookieManager\n */\n get cookieCollection() {\n return this.cookieCollection_;\n }\n\n /**\n * determine whether value exist or not\n *\n * @param {string} name\n * @returns\n * @memberof CookieManager\n */\n isExist(name: string) {\n return this.cookieCollection_[name] != null;\n }\n\n private getCookieStringFromCookie_(cookie: HttpCookie) {\n const cookies = [];\n cookies.push(`${cookie.name}=${cookie.value}`);\n if (cookie.expires) {\n cookies.push(`Expires=${cookie.expires.toUTCString()}`);\n }\n if (cookie.httpOnly === true) {\n cookies.push(\"HttpOnly\");\n }\n if (cookie.maxAge != null) {\n cookies.push(`Max-Age=${cookie.maxAge}`);\n }\n if (cookie.path) {\n cookies.push(`Path=${cookie.path}`);\n }\n if (cookie.domain) {\n cookies.push(`Domain=${cookie.domain}`);\n }\n return cookies.join('; ');\n }\n}","import { HttpFile } from \"./http_file\";\nimport * as Fs from \"fs-extra\";\n\nexport class FileManager {\n\n private files_: { [fieldName: string]: HttpFile };\n\n constructor(value) {\n this.files_ = value as any;\n }\n\n /**\n * get total no of files\n *\n * @returns - number\n * @memberof FileManager\n */\n get count() {\n return Object.keys(this.files_).length;\n }\n\n get files() {\n\n return Object.keys(this.files_).map(fileId => {\n return this.files_[fileId];\n });\n }\n\n /**\n * check for existance of file\n *\n * @param {string} fieldName\n * @returns\n * @memberof FileManager\n */\n isExist(fieldName: string) {\n return this.files_[fieldName] != null;\n }\n\n /**\n * return the file\n *\n * @param {string} fieldName\n * @returns\n * @memberof FileManager\n */\n getFile(fieldName: string) {\n return this.files_[fieldName];\n }\n\n /**\n * saves file to supplied path\n *\n * @param {string} fieldName\n * @param {string} pathToSave\n * @returns\n * @memberof FileManager\n */\n saveTo(fieldName: string, pathToSave: string) {\n return Fs.copy(this.files_[fieldName].path, pathToSave);\n }\n}","import { IncomingHttpHeaders } from \"http2\";\n\n \nexport class HttpFile {\n\n /**\n * same as name - the field name for this file\n */\n fieldName: string;\n\n /**\n * the filename that the user reports for the file\n */\n originalFilename: string;\n\n /**\n * the absolute path of the uploaded file on disk\n */\n path: string;\n\n /**\n * the HTTP headers that were sent along with this file\n */\n headers?: IncomingHttpHeaders;\n\n /**\n * size of the file in bytes\n */\n size?: number;\n\n}\n","export * from './error_handler';\nexport * from './http_cookie';\nexport * from './fort';\nexport * from './router';\nexport * from './cookie_manager';\nexport * from \"./file_manager\";\nexport * from \"./http_file\";","import { HTTP_METHOD } from \"../enums\";\nimport { RouteHandler } from \"../handlers\";\nimport { WorkerInfo } from \"../types\";\n\n// tslint:disable-next-line\nexport const Worker = (allowedMethods?: HTTP_METHOD[]): MethodDecorator => {\n return (target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className = (target.constructor.name as string);\n const actionInfo: WorkerInfo = {\n workerName: methodName,\n methodsAllowed: allowedMethods == null ? [\n HTTP_METHOD.Delete, HTTP_METHOD.Get, HTTP_METHOD.Post, HTTP_METHOD.Patch, HTTP_METHOD.Put\n ] : allowedMethods,\n guards: [],\n pattern: `/${methodName.toLowerCase()}`,\n values: []\n };\n RouteHandler.addWorker(actionInfo, className);\n };\n};\n","import { Shield } from \"../abstracts\";\nimport { RouteHandler } from \"../handlers\";\nimport { GenericShield } from \"../generics\";\n \n// tslint:disable-next-line\nexport const Shields = (shieldsValue: Array): ClassDecorator => {\n return (target: any) => {\n const className = target.name;\n RouteHandler.addShields(shieldsValue as Array, className);\n };\n};","import { RouteHandler } from \"../handlers\";\nimport { GenericGuard } from \"../generics\";\nimport { Guard } from \"../abstracts/guard\";\n\n// tslint:disable-next-line\nexport const Guards = (value: Array): MethodDecorator => {\n return ((target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className = (target.constructor.name as string);\n RouteHandler.addGuards(value as Array, className, methodName);\n });\n};","import { RouteHandler } from \"../handlers\";\nimport { removeLastSlash } from \"../helpers\";\n\n// tslint:disable-next-line\nexport const Route = (format: string): MethodDecorator => {\n return ((target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className = (target.constructor.name as string);\n // remove / from route\n if (format != null && format !== '/') {\n format = removeLastSlash(format);\n }\n RouteHandler.addPattern(format, className, methodName);\n });\n};","import { RouteHandler } from \"../handlers\";\nimport { HTTP_METHOD } from \"../enums\";\nimport { WorkerInfo } from \"../types\";\n\n// tslint:disable-next-line\nexport const DefaultWorker = (allowedMethods?: HTTP_METHOD[]): MethodDecorator => {\n return (target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className = (target.constructor.name as string);\n const actionInfo: WorkerInfo = {\n workerName: methodName,\n methodsAllowed: allowedMethods == null ? [HTTP_METHOD.Get] : allowedMethods,\n guards: [],\n pattern: \"/\",\n values: []\n };\n RouteHandler.addWorker(actionInfo, className);\n };\n};\n","import { InjectorHandler } from \"../handlers\";\nimport { __Constructor } from \"../constant\";\n\n// tslint:disable-next-line\nexport const Assign = (value): ParameterDecorator => {\n return (target: any, methodName: string, paramIndex: number) => {\n const className: string = target.name || target.constructor.name;\n if (methodName == null) {\n methodName = __Constructor;\n }\n InjectorHandler.addWorkerValue(className, methodName, paramIndex, value);\n };\n};","import { InjectorHandler } from \"../handlers\";\nimport { __Constructor } from \"../constant\";\n\n// tslint:disable-next-line\nexport const Singleton = (value): ParameterDecorator => {\n return (target: any, methodName: string, paramIndex: number) => {\n const className: string = target.name || target.constructor.name;\n if (methodName == null || methodName === 'constructor') {\n methodName = __Constructor;\n }\n InjectorHandler.addSingleton(className, methodName, paramIndex, value);\n };\n};","export * from './worker';\nexport * from './shields';\nexport * from './guards';\nexport * from './route';\nexport * from './default_worker';\nexport * from './assign';\nexport * from './singleton';","export * from './models';\nexport * from './abstracts';\nexport * from './decorators';\nexport * from './enums';\nexport * from './helpers';\nexport * from './types';\nexport * from './extra';"],"sourceRoot":""}
\ No newline at end of file
diff --git a/package.json b/package.json
index c7f23413..950a5f9d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "fortjs",
- "version": "1.8.2",
+ "version": "1.8.3",
"description": "Fort based MVC web framework for nodejs targeting good code structures & modularity.",
"main": "dist/fort.js",
"types": "dist/ts/index.d.ts",
diff --git a/tests/general/controllers/injection_controller.ts b/tests/general/controllers/injection_controller.ts
index 1a2ee321..1d80cbf5 100644
--- a/tests/general/controllers/injection_controller.ts
+++ b/tests/general/controllers/injection_controller.ts
@@ -2,6 +2,11 @@ import { Controller, viewResult, Worker, Route, jsonResult, HTTP_METHOD, Default
export class InjectionController extends Controller {
+ // do not remove constructor and value
+ constructor(@Assign('Welcome to fort') title){
+ super();
+ }
+
@Worker()
async getMultipleStringInjection(@Assign('Welcome to fort') title, @Assign('Hello World') helloWorld, @Assign('ujjwal') firstName, @Assign('Gupta') lastName) {
return jsonResult({ value: [title, helloWorld, firstName, lastName] });