diff --git a/dist/fort.js b/dist/fort.js index a4df3131..0e5780e3 100644 --- a/dist/fort.js +++ b/dist/fort.js @@ -2854,6 +2854,7 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod var RequestHandlerHelper = /** @class */ (function () { function RequestHandlerHelper() { this.wallInstances = []; + this.controllerResult_ = {}; } RequestHandlerHelper.prototype.runWallOutgoing = function () { var _this = this; diff --git a/dist/fort.js.map b/dist/fort.js.map index f4181571..fa213e45 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/result_mapper.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/expect_body.ts","webpack://FortJs/./src/decorators/expect_query.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/fort_global.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/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/compar_expected_and_remove_unnecessary.ts","webpack://FortJs/./src/helpers/download_result.ts","webpack://FortJs/./src/helpers/file_result.ts","webpack://FortJs/./src/helpers/get_class_name.ts","webpack://FortJs/./src/helpers/get_data_type.ts","webpack://FortJs/./src/helpers/get_mime_type_from_extension.ts","webpack://FortJs/./src/helpers/get_result_based_on_mime.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/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/remove_method_and_null_from_object.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/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/logger.ts","webpack://FortJs/./src/models/route_info.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 \"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;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;;;;;ACFF,yC;;;;;;;;;;;ACAA,iC;;;;;;;;;;;ACAA,kC;;;;;;;;;;;ACAA,+B;;;;;;;;;;;ACAA,qC;;;;;;;;;;;ACAA,iC;;;;;;;;;;;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, Logger } from \"../models\";\nimport { SessionProvider } from \".\";\nimport { initController } from \"../test_helpers\";\nimport { FortGlobal } from \"../fort_global\";\n\n\nexport abstract class Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: any };\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 get logger(): Logger {\n return FortGlobal.logger;\n }\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, Logger } from \"../models\";\nimport { Controller } from \"./controller\";\nimport { SessionProvider } from \"./session_provider\";\nimport { GuardTestData, initGuard } from \"../test_helpers\";\nimport { FortGlobal } from \"../fort_global\";\n\nexport abstract class Guard implements Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: any };\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 get logger(): Logger {\n return FortGlobal.logger;\n }\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\";\nexport * from './result_mapper';","import { MIME_TYPE } from \"../enums\";\n\nexport abstract class ResultMapper {\n abstract map(type: MIME_TYPE, result, setMimeType?: (type) => void): any;\n}","import { CookieManager } from \"../models\";\nimport * as getUniqId from \"uniqid\";\nimport { FortGlobal } from \"../fort_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<{ [key: string]: any }>;\n abstract set(key: string, val: any): Promise;\n abstract setMany(values: { [key: string]: any }): Promise;\n abstract remove(key: string): Promise;\n\n abstract clear(): Promise;\n\n protected createSession(sessionId?) {\n const now = new Date();\n this.sessionId = sessionId != null ? sessionId : getUniqId();\n this.cookie.addCookie({\n name: FortGlobal.appSessionIdentifier,\n value: this.sessionId,\n httpOnly: true,\n path: \"/\",\n expires: new Date(now.setMinutes(now.getMinutes() + FortGlobal.sessionTimeOut)),\n maxAge: FortGlobal.sessionTimeOut * 60\n });\n }\n\n protected destroySession() {\n const cookie = this.cookie.getCookie(FortGlobal.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, Logger } from \"../models\";\nimport { SessionProvider, Controller } from \".\";\nimport { ShieldTestData, initShield } from \"../test_helpers\";\nimport { FortGlobal } from \"../fort_global\";\n\nexport abstract class Shield implements Controller {\n workerName: string;\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: any };\n\n session: SessionProvider;\n cookie: CookieManager;\n\n data: { [key: string]: any };\n\n get logger(): Logger {\n return FortGlobal.logger;\n }\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, HttpFormatResult } from \"../types\";\nimport { CookieManager, Logger } from \"../models\";\nimport { Controller } from \"./controller\";\nimport { SessionProvider } from \"./session_provider\";\nimport { WallTestData, initWall } from \"../test_helpers\";\nimport { FortGlobal } from \"../fort_global\";\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 get logger(): Logger {\n return FortGlobal.logger;\n }\n\n abstract onIncoming(...args): Promise;\n\n async onOutgoing(finalResult: HttpResult | HttpFormatResult, ...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 { FortGlobal } from \"./fort_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\";\nimport { Route } from \"./route\";\nimport { Worker } from \"./worker\";\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 Worker(allowedMethods == null ? [HTTP_METHOD.Get] : allowedMethods)(target, methodName, descriptor);\n Route(\"/\")(target, methodName, descriptor);\n };\n};\n","import { RouteHandler } from \"../handlers\";\nimport { getDataType, getClassName, removeMethodAndNullFromObject } from \"../helpers\";\nimport { DATA_TYPE } from \"../enums/data_type\";\n\nexport function ExpectBody(value: any): MethodDecorator {\n return (target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className: string = getClassName(target);\n const type = getDataType(value);\n switch (type) {\n case DATA_TYPE.Function:\n const valueClassName = getClassName(value);\n if (valueClassName != null) {\n value = new value();\n }\n case DATA_TYPE.Object:\n value = removeMethodAndNullFromObject(value);\n RouteHandler.addExpected(\"body\", className, methodName, value); break;\n default:\n throw new Error(`expected body should be always an object but found ${type}`);\n }\n\n };\n}","import { RouteHandler } from \"../handlers\";\nimport { DATA_TYPE } from \"../enums/data_type\";\nimport { getClassName, removeMethodAndNullFromObject, getDataType } from \"../helpers\";\n\nexport function ExpectQuery(value: any): MethodDecorator {\n return (target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className: string = getClassName(target);\n const type = getDataType(value);\n switch (type) {\n case DATA_TYPE.Function:\n const valueClassName = getClassName(value);\n if (valueClassName != null) {\n value = new value();\n }\n case DATA_TYPE.Object:\n value = removeMethodAndNullFromObject(value);\n RouteHandler.addExpected(\"query\", className, methodName, value); break;\n default:\n throw new Error(`expected query should be always an object but found ${type}`);\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';\nexport * from './expect_body';\nexport * from './expect_query';","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) {\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\";\nexport * from \"./data_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\";","import { SessionProvider } from \"../abstracts/session_provider\";\n\nconst sessionValues: { [identifier: string]: any } = {};\n\nexport class MemorySessionProvider extends SessionProvider {\n\n async get(key: string) {\n const savedSession = sessionValues[this.sessionId];\n return savedSession != null ? savedSession[key] : null;\n }\n\n async isExist(key: string) {\n const savedValue = sessionValues[this.sessionId];\n return savedValue == null ? false : savedValue[key] != null;\n }\n\n async getAll() {\n const savedValue = sessionValues[this.sessionId];\n return savedValue == null ? {} : savedValue;\n }\n\n async set(key: string, val: any) {\n const savedValue = sessionValues[this.sessionId];\n if (savedValue == null) {\n this.createSession();\n sessionValues[this.sessionId] = {\n [key]: val\n };\n }\n else {\n savedValue[key] = val;\n }\n }\n\n setMany(values: { [key: string]: any }) {\n return Promise.all(\n Object.keys(values).map((key) => {\n return this.set(key, values[key]);\n })\n );\n }\n\n async remove(key: string) {\n const savedValue = sessionValues[this.sessionId];\n if (savedValue != null) {\n savedValue[key] = null;\n }\n }\n\n async clear() {\n // remove session values\n delete sessionValues[this.sessionId];\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({\n fileLocation: value.view\n });\n return Mustache.render(viewData, value.model);\n }\n}","import { ErrorHandler, Logger } from \"./models\";\nimport { ViewEngine, XmlParser } from \"./abstracts\";\nimport { EtagOption, FolderMap } from \"./types\";\nimport { GenericSessionProvider, GenericWall } from \"./generics\";\n\nconst isDevelopment = process.env.NODE_ENV === 'development';\nconst isProduction = process.env.NODE_ENV === \"production\";\nexport class FortGlobal {\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\n static logger: Logger;\n\n static get isDevelopment() {\n return isDevelopment;\n }\n\n static get isProduction() {\n return isProduction;\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';","\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 { textResult, getResultBasedOnMiMe } from \"../helpers\";\n\nexport class ControllerResultHandler extends FileHandler {\n\n\n private endResponse_(negotiateMimeType: MIME_TYPE) {\n let data;\n try {\n data = getResultBasedOnMiMe(negotiateMimeType,\n (this.controllerResult_ as HttpResult).responseData\n , (type: MIME_TYPE) => {\n negotiateMimeType = type;\n }\n );\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_ as HttpResult).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_ as HttpResult).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_ as HttpResult;\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.controllerResult_ = result;\n this.handleFinalResult_();\n }\n\n private handleFinalResult_() {\n const result = this.controllerResult_;\n ((this.cookieManager as any).responseCookie_ as string[]).forEach(value => {\n this.response.setHeader(__SetCookie, value);\n });\n\n if ((result as HttpResult).shouldRedirect === true) {\n this.handleRedirectResult_();\n }\n else {\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 }\n\n\n async onResultFromController(result: HttpResult | HttpFormatResult) {\n this.controllerResult_ = result || textResult(\"\");\n try {\n await this.runWallOutgoing();\n } catch (ex) {\n this.onErrorOccured(ex);\n return;\n }\n this.handleFinalResult_();\n }\n}","import { HTTP_STATUS_CODE, MIME_TYPE, ETag_Type } from \"../enums\";\nimport { FortGlobal } from \"../fort_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.handleFileRequestForFolderPath_(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 = FortGlobal.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 handleFileRequestForFolderPath_(absolutePath: string) {\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(this.onErrorOccured.bind(this));\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 sendFileAsResponse_(filePath: string, mimeType: MIME_TYPE) {\n this.response.writeHead(HTTP_STATUS_CODE.Ok, {\n [__ContentType]: mimeType\n });\n const readStream = Fs.createReadStream(filePath);\n // Handle non-existent file\n readStream.on('error', this.onErrorOccured.bind(this));\n readStream.on('open', () => {\n readStream.pipe(this.response);\n });\n }\n\n private getMimeTypeFromFileType_(fileType: string) {\n return fileType[0] === '.' ? getMimeTypeFromExtension(fileType) :\n fileType as MIME_TYPE;\n }\n\n sendFile_: (filePath: string, fileType: string, fileInfo: Fs.Stats) => any;\n}\n\nif (FortGlobal.isProduction) {\n FileHandler.prototype.sendFile_ = function (filePath: string, fileType: string, fileInfo: Fs.Stats) {\n this.runWallOutgoing().then(() => {\n const lastModified = fileInfo.mtime.toUTCString();\n const eTagValue = etag(fileInfo, {\n weak: FortGlobal.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.setHeader('Etag', eTagValue);\n this.response.setHeader('Last-Modified', lastModified);\n this.sendFileAsResponse_(filePath, this.getMimeTypeFromFileType_(fileType));\n }\n }).catch(this.onErrorOccured.bind(this));\n };\n}\nelse {\n FileHandler.prototype.sendFile_ = function (filePath: string, fileType: string, fileInfo: Fs.Stats) {\n this.runWallOutgoing().then(() => {\n this.sendFileAsResponse_(filePath, this.getMimeTypeFromFileType_(fileType));\n }).catch(this.onErrorOccured.bind(this));\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 { FortGlobal } from \"../fort_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 (FortGlobal 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 { FortGlobal } from \"../fort_global\";\nimport { parseCookie, parseAndMatchRoute, promise, compareExpectedAndRemoveUnnecessary } 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\";\nimport { RouteHandler } from \"./route_handler\";\nimport { IException } from \"../interfaces\";\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 = FortGlobal.walls.length;\n const executeWallIncomingByIndex = async () => {\n if (wallLength > index) {\n const wall = FortGlobal.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\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 runController_;\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\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\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 (FortGlobal.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 FortGlobal.sessionProvider();\n this.session_.cookie = this.cookieManager = new CookieManager(parsedCookies);\n this.session_.sessionId = parsedCookies[FortGlobal.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', FortGlobal.appName);\n this.response.setHeader('Vary', 'Accept-Encoding');\n this.response.sendDate = true;\n }\n\n private checkExpectedQuery_() {\n const expectedQuery = RouteHandler.getExpectedQuery(this.routeMatchInfo_.controllerName, this.routeMatchInfo_.workerInfo.workerName);\n if (expectedQuery != null) {\n this.query_ = compareExpectedAndRemoveUnnecessary(expectedQuery, this.query_, true);\n }\n }\n\n private checkExpectedBody_() {\n const expectedBody = RouteHandler.getExpectedBody(this.routeMatchInfo_.controllerName, this.routeMatchInfo_.workerInfo.workerName);\n if (expectedBody != null) {\n this.body = compareExpectedAndRemoveUnnecessary(expectedBody, this.body, false);\n }\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 this.checkExpectedQuery_();\n if (this.query_ == null) {\n this.onBadRequest({\n message: \"Bad query string data - query string data does not match with expected value\"\n } as IException);\n return;\n }\n let shouldExecuteNextComponent = await this.executeShieldsProtection_();\n if (shouldExecuteNextComponent === true) {\n shouldExecuteNextComponent = await this.handlePostData();\n if (shouldExecuteNextComponent === true) {\n this.checkExpectedBody_();\n if (this.body == null) {\n this.onBadRequest({\n message: \"Bad body data - body data does not match with expected value\"\n } as IException);\n return;\n }\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 (FortGlobal.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\n setControllerProps_() {\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 return controllerObj[this.routeMatchInfo_.workerInfo.workerName](...methodArgsValues);\n }\n}\nif (FortGlobal.isProduction) {\n RequestHandler.prototype.runController_ = function () {\n this.setControllerProps_().then(\n this.onResultFromController.bind(this)\n ).catch(this.onErrorOccured.bind(this));\n };\n}\nelse {\n RequestHandler.prototype.runController_ = function () {\n const result = this.setControllerProps_();\n if (Promise.resolve(result) !== result) {\n this.onErrorOccured({\n message: \"Wrong implementation - worker does not return promise\"\n } as IException);\n }\n else {\n result.then(\n this.onResultFromController.bind(this)\n ).catch(this.onErrorOccured.bind(this));\n }\n };\n}","import { HTTP_STATUS_CODE, MIME_TYPE, HTTP_METHOD } from \"../enums\";\nimport * as http from \"http\";\nimport { __ContentType } from \"../constant\";\nimport { FortGlobal } from \"../fort_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\";\nimport { HttpResult, HttpFormatResult } from \"../types\";\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 controllerResult_: HttpResult | HttpFormatResult;\n\n protected runWallOutgoing() {\n const outgoingResults: Array> = [];\n reverseLoop(this.wallInstances, (value: Wall) => {\n const methodArgsValues = InjectorHandler.getMethodValues(value.constructor.name, 'onOutgoing');\n methodArgsValues.shift();\n outgoingResults.push(value.onOutgoing(this.controllerResult_, ...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 FortGlobal.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 FortGlobal.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 FortGlobal.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 FortGlobal.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 FortGlobal.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 FortGlobal.errorHandler().onServerError(error);\n }\n catch (ex) {\n errMessage = JsonHelper.stringify(ex);\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 { WorkerInfo, ParentRoute } from \"../types\";\nimport { GenericShield, GenericGuard } from \"../generics\";\nimport { isNull } from \"../utils\";\nimport { RouteInfo } from \"../models\";\nimport { IRouteInfo } from \"../interfaces\";\nimport { getDataType } from \"../helpers\";\n\nconst routerCollection: {\n [controllerName: string]: RouteInfo\n} = {};\n\nconst pushRouterIntoCollection = (route: IRouteInfo) => {\n const routeObj = new RouteInfo();\n routeObj.init(route);\n routerCollection[route.controllerName] = routeObj;\n};\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 get routesAsArray() {\n return Object.keys(routerCollection).map(workerName => {\n return routerCollection[workerName];\n });\n }\n\n static findControllerFromPath(urlParts: string[]) {\n for (const controllerName in routerCollection) {\n let isMatched: boolean = false as any;\n const controller = routerCollection[controllerName];\n const patternSplit = controller.path.split(\"/\");\n\n patternSplit.every((patternPart, i) => {\n isMatched = patternPart === urlParts[i];\n return isMatched;\n });\n if (isMatched === true) {\n return controller;\n }\n }\n }\n\n static get defaultRoute() {\n return routerCollection[RouteHandler.defaultRouteControllerName];\n }\n\n static defaultRouteControllerName: string;\n\n static addToRouterCollection(value: ParentRoute) {\n const route = routerCollection[value.controller.name];\n if (route == null) {\n pushRouterIntoCollection({\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 for (const workerName in route.workers) {\n const actionInfo = route.workers[workerName];\n actionInfo.pattern = getActionPattern(value, actionInfo.pattern);\n }\n }\n }\n\n static addShields(shields: Array, className: string) {\n const route = routerCollection[className];\n if (route == null) {\n pushRouterIntoCollection({\n workers: {},\n controller: null,\n controllerName: className,\n shields: shields,\n path: null,\n values: []\n });\n }\n else {\n route.shields = shields;\n }\n }\n\n static addWorker(newWorker: WorkerInfo, className: string) {\n\n const workerName = newWorker.workerName;\n const route = routerCollection[className];\n if (route == null) {\n pushRouterIntoCollection({\n workers: {\n [workerName]: newWorker\n },\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = route.workers[workerName];\n if (savedAction == null) {\n newWorker.pattern = getActionPattern(route, newWorker.pattern);\n route.workers[workerName] = newWorker;\n }\n else {\n savedAction.methodsAllowed = newWorker.methodsAllowed;\n savedAction.pattern = getActionPattern(route, savedAction.pattern);\n // route.path == null ? savedAction.pattern : `/${route.path}${savedAction.pattern}`;\n }\n }\n }\n\n static addGuards(guards: Array, className: string, workerName: string) {\n\n const route = routerCollection[className];\n const pattern = workerName.toLowerCase();\n if (route == null) {\n pushRouterIntoCollection({\n workers: {\n [workerName]: {\n workerName: workerName,\n guards: guards,\n methodsAllowed: null,\n pattern: pattern,\n values: []\n }\n },\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = route.workers[workerName];\n if (savedAction == null) {\n route.workers[workerName] = {\n workerName: workerName,\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, workerName: string) {\n const route = routerCollection[className];\n if (route == null) {\n pushRouterIntoCollection({\n workers: {\n [workerName]: {\n workerName: workerName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: []\n }\n },\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = route.workers[workerName];\n pattern = getActionPattern(route, pattern);\n if (savedAction == null) {\n route.workers[workerName] = {\n workerName: workerName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: []\n };\n }\n else {\n savedAction.pattern = pattern;\n }\n }\n }\n\n static addExpected(type: string, className: string, workerName: string, expectedValue: any) {\n\n for (const prop in expectedValue) {\n const propValue = expectedValue[prop];\n expectedValue[prop] = getDataType(propValue);\n }\n\n const isQuery = type === 'query';\n const pattern = workerName.toLowerCase();\n const router = routerCollection[className];\n const worker = {\n workerName: workerName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: [],\n expectedQuery: isQuery ? expectedValue : null,\n expectedBody: isQuery ? null : expectedValue\n };\n if (router == null) {\n pushRouterIntoCollection({\n workers: {\n [workerName]: worker\n },\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = router.workers[workerName];\n if (savedAction == null) {\n router.workers[workerName] = worker;\n }\n else {\n savedAction.expectedQuery = worker.expectedQuery;\n savedAction.expectedBody = worker.expectedBody;\n }\n }\n }\n\n static getExpectedQuery(controllerName: string, workerName: string) {\n return routerCollection[controllerName].workers[workerName].expectedQuery;\n }\n\n static getExpectedBody(controllerName: string, workerName: string) {\n return routerCollection[controllerName].workers[workerName].expectedBody;\n }\n\n}","import { getDataType } from \"./get_data_type\";\nimport { DATA_TYPE } from \"../enums/data_type\";\n\nexport const compareExpectedAndRemoveUnnecessary = (expected, actual, isQuery) => {\n const result = {};\n for (const prop in expected) {\n if (isQuery === true && expected[prop] === DATA_TYPE.Number) {\n result[prop] = Number(actual[prop]);\n if (isNaN(result[prop]) === true) {\n return null;\n }\n }\n else {\n result[prop] = actual[prop];\n }\n if (expected[prop] !== getDataType(result[prop])) {\n return null;\n }\n }\n return result;\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};","export const getClassName = (target): string => {\n return target.name || (target.constructor && target.constructor.name);\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 { MIME_TYPE } from \"../enums\";\nimport { ResultMapper } from \"../abstracts\";\n\nexport let getResultBasedOnMiMe: (type: MIME_TYPE, result, setMimeType?: (type) => void) => any;\n\nexport function setResultMapper(mapper: typeof ResultMapper) {\n if (mapper) {\n getResultBasedOnMiMe = (type, result, callBack) => {\n return new (mapper as any)().map(type, result, callBack);\n };\n }\n else {\n getResultBasedOnMiMe = (type, result, callBack) => {\n switch (type) {\n case MIME_TYPE.Json:\n case MIME_TYPE.Text:\n case MIME_TYPE.Html:\n case MIME_TYPE.Xml:\n if (typeof result === 'object' === true) {\n callBack(MIME_TYPE.Json);\n return JSON.stringify(result);\n }\n }\n return result;\n };\n }\n}","import { readFile } from \"fs-extra\";\nimport * as path from \"path\";\nimport { FortGlobal } from \"../fort_global\";\nimport { __CurrentPath } from \"../constant\";\nimport { ViewReadOption } from \"../types\";\n\nconst viewCache = {\n\n};\n\nexport let getViewFromFile: (option: ViewReadOption) => Promise;\n\nconst readView = async (option: ViewReadOption) => {\n const pathOfView = path.join(FortGlobal.viewPath, option.fileLocation);\n const result = await readFile(pathOfView, {\n encoding: 'utf8'\n });\n if (option.mapView != null) {\n return option.mapView(result);\n }\n return result;\n};\nif (FortGlobal.isProduction === true) {\n getViewFromFile = async function (option: ViewReadOption): Promise {\n if (viewCache[option.fileLocation] == null) {\n viewCache[option.fileLocation] = await readView(option);\n }\n return viewCache[option.fileLocation];\n };\n}\nelse {\n getViewFromFile = async function (option: ViewReadOption): Promise {\n return await readView(option);\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 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 \"./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';\nexport * from './compar_expected_and_remove_unnecessary';\nexport * from './get_data_type';\nexport * from './get_class_name';\nexport * from './remove_method_and_null_from_object';\nexport * from './get_result_based_on_mime';","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 \"../models\";\n\nconst regex1 = /{(.*)}(?!.)/;\nconst regex2 = /{(.*)}\\.(\\w+)(?!.)/;\n\nconst checkRouteInWorker = (route: RouteInfo, httpMethod: HTTP_METHOD, urlParts: string[]) => {\n const matchedRoute: RouteMatch = {\n allowedHttpMethod: [],\n controller: route.controller,\n controllerName: route.controllerName\n } as RouteMatch;\n\n const urlPartLength = urlParts.length;\n for (const workerName in route.workers) {\n const worker = route.workers[workerName];\n const patternSplit = worker.pattern.split(\"/\");\n if (urlPartLength === patternSplit.length) {\n let isMatched = true;\n const params = {};\n urlParts.every((urlPart, i) => {\n // if not equal then check for regex match\n if (urlPart !== patternSplit[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 }\n }\n else {\n isMatched = false;\n }\n }\n // means its direct match\n return isMatched;\n });\n if (isMatched === true) {\n if (worker.methodsAllowed.indexOf(httpMethod) >= 0) {\n matchedRoute.workerInfo = worker;\n matchedRoute.params = params;\n matchedRoute.shields = route.shields;\n break;\n }\n else {\n matchedRoute.allowedHttpMethod = [...matchedRoute.allowedHttpMethod, ...worker.methodsAllowed];\n }\n }\n }\n }\n if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {\n return null;\n }\n return matchedRoute;\n\n};\n\nexport function parseAndMatchRoute(url: string, httpMethod: HTTP_METHOD) {\n url = removeLastSlash(url);\n const urlParts = url.split(\"/\");\n const route = RouteHandler.findControllerFromPath(urlParts);\n return route == null ? checkRouteInWorker(RouteHandler.defaultRoute, httpMethod, urlParts) :\n checkRouteInWorker(route, httpMethod, urlParts);\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 { getDataType } from \"./get_data_type\";\nimport { DATA_TYPE } from \"../enums/data_type\";\n\nexport const removeMethodAndNullFromObject = (value: object) => {\n\n const outputValue = {};\n for (const prop in value) {\n const type = getDataType(value[prop]);\n if (!(value[prop] == null || type === DATA_TYPE.Function)) {\n outputValue[prop] = value[prop];\n }\n }\n\n return outputValue;\n};","import { FortGlobal } from \"../fort_global\";\nimport { LogHelper } from \"./log_helper\";\nimport { ERROR_TYPE } from \"../enums/error_type\";\n\nexport let renderView: (viewName: string, model?: any) => Promise;\n\nif (FortGlobal.isProduction === true) {\n renderView = (viewName: string, model?: any) => {\n return FortGlobal.viewEngine.render({\n view: viewName,\n model\n });\n };\n}\nelse {\n renderView = (viewName: string, model?: any) => {\n if (FortGlobal.viewEngine == null) {\n new LogHelper(ERROR_TYPE.UndefinedViewEngine).throw();\n }\n return FortGlobal.viewEngine.render({\n view: viewName,\n model\n });\n };\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};","export * from './models';\nexport * from './abstracts';\nexport * from './decorators';\nexport * from './enums';\nexport * from './helpers';\nexport * from './types';\nexport * from './extra';\nexport * from './interfaces';","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, ResultMapper } from \"../abstracts\";\nimport { RouteHandler, RequestHandler } from \"../handlers\";\nimport { FortGlobal } from \"../fort_global\";\nimport { MemorySessionProvider, MustacheViewEngine } from \"../extra\";\nimport { ErrorHandler } from \".\";\nimport { __AppName, __CurrentPath } from \"../constant\";\nimport * as http from \"http\";\nimport { ETag_Type, ERROR_TYPE } from \"../enums\";\nimport { LogHelper, promise, removeLastSlash, removeFirstSlash, setResultMapper } from \"../helpers\";\nimport { GenericSessionProvider, GenericXmlParser, GenericController } from \"../generics\";\nimport { isNull, isNullOrEmpty, isArray } from \"../utils\";\nimport { Logger } from \"./logger\";\nimport * as path from \"path\";\n\nexport class Fort {\n\n logger: Logger;\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 resultMapper?: typeof ResultMapper;\n\n private saveAppOption_(option: AppOption) {\n const defaultEtagConfig = {\n type: ETag_Type.Weak\n } as EtagOption;\n\n FortGlobal.port = option.port == null ? 4000 : option.port;\n FortGlobal.shouldParseCookie = option.shouldParseCookie == null ? true : option.shouldParseCookie;\n FortGlobal.shouldParsePost = isNull(option.shouldParsePost) ? true : option.shouldParsePost;\n FortGlobal.sessionTimeOut = isNull(option.sessionTimeOut) ? 60 : option.sessionTimeOut;\n FortGlobal.folders = option.folders == null ? [] : option.folders;\n if (isArray(FortGlobal.folders) === false) {\n throw new Error(`Option folders should be an array`);\n }\n FortGlobal.appName = isNullOrEmpty(option.appName) === true ? __AppName : option.appName;\n FortGlobal.appSessionIdentifier = `${FortGlobal.appName}_session_id`;\n FortGlobal.eTag = isNull(option.eTag) ? defaultEtagConfig : option.eTag;\n FortGlobal.walls = this.walls as any;\n FortGlobal.viewEngine = isNull(this.viewEngine) ? new MustacheViewEngine() : new (this.viewEngine as any)();\n FortGlobal.sessionProvider = isNull(this.sessionProvider) ? MemorySessionProvider as any :\n this.sessionProvider as typeof GenericSessionProvider;\n FortGlobal.errorHandler = isNull(this.errorHandler) ? ErrorHandler : this.errorHandler;\n FortGlobal.xmlParser = isNull(this.xmlParser) ? GenericXmlParser : this.xmlParser;\n FortGlobal.viewPath = isNull(option.viewPath) ? path.join(__CurrentPath, \"views\") : option.viewPath;\n setResultMapper(this.resultMapper);\n if (this.logger) {\n if (typeof this.logger === 'function') {\n this.logger = new (this as any).logger();\n }\n }\n else {\n this.logger = new Logger();\n }\n FortGlobal.logger = this.logger;\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 RouteHandler.addToRouterCollection(route);\n if (route.path === \"/*\") {\n RouteHandler.defaultRouteControllerName = route.controller.name;\n isDefaultRouteExist = true;\n }\n });\n if (isDefaultRouteExist === false) {\n RouteHandler.defaultRouteControllerName = GenericController.name;\n RouteHandler.addToRouterCollection({\n controller: GenericController,\n path: \"/*\"\n });\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 if (this.httpServer != null) {\n return;\n }\n return promise((res, rej) => {\n this.httpServer = http.createServer(this.onNewRequest).once(\"error\", (err) => {\n if ((err as any).code === 'EADDRINUSE') {\n const error = new LogHelper(ERROR_TYPE.PortInUse, FortGlobal.port).get();\n rej(error);\n }\n else {\n rej(err);\n }\n }).once('listening', () => {\n // set default route\n // RouteHandler.defaultRouteControllerName = RouteHandler.getDefaultRoute();\n res();\n }).listen(FortGlobal.port);\n });\n }\n\n onNewRequest(request, response) {\n new RequestHandler(request, response).handle();\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\";\nexport * from \"./logger\";\nexport * from './route_info';","export class Logger {\n info?(...args) {\n this.debug(args);\n }\n error?(...args) {\n this.debug(args);\n }\n log?(...args) {\n this.debug(args);\n }\n debug?(...args) {\n console.log(...args);\n }\n}","import { GenericShield, GenericController } from \"../generics\";\nimport { WorkerInfo } from \"../types\";\nimport { IRouteInfo } from \"../interfaces\";\n\nexport class RouteInfo implements IRouteInfo {\n controller: typeof GenericController;\n controllerName: string;\n path: string;\n workers: {\n [workerName: string]: WorkerInfo\n };\n\n get workersAsArray() {\n return Object.keys(this.workers).map(workerName => {\n return this.workers[workerName];\n return this.workers[workerName];\n });\n }\n\n shields: Array;\n values: any[];\n\n init(value: IRouteInfo) {\n this.controllerName = value.controllerName;\n this.controller = value.controller;\n this.path = value.path;\n this.shields = value.shields;\n this.values = value.values;\n this.workers = value.workers;\n }\n}","import { RouteHandler } from \"../handlers\";\nimport { RouteInfo } from \"./route_info\";\n\nexport class Router {\n get routes() {\n return RouteHandler.routerCollection;\n }\n\n get routesAsArray() {\n return RouteHandler.routesAsArray;\n }\n\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 { FortGlobal } from \"../fort_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 FortGlobal.sessionProvider();\n session.cookie = controllerInstance.cookie;\n session.sessionId = parsedCookies[FortGlobal.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(\"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/./src/abstracts/controller.ts","webpack://FortJs/./src/abstracts/guard.ts","webpack://FortJs/./src/abstracts/index.ts","webpack://FortJs/./src/abstracts/result_mapper.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/expect_body.ts","webpack://FortJs/./src/decorators/expect_query.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/fort_global.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/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/compar_expected_and_remove_unnecessary.ts","webpack://FortJs/./src/helpers/download_result.ts","webpack://FortJs/./src/helpers/file_result.ts","webpack://FortJs/./src/helpers/get_class_name.ts","webpack://FortJs/./src/helpers/get_data_type.ts","webpack://FortJs/./src/helpers/get_mime_type_from_extension.ts","webpack://FortJs/./src/helpers/get_result_based_on_mime.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/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/remove_method_and_null_from_object.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/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/logger.ts","webpack://FortJs/./src/models/route_info.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 \"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;AAAA;AAAiD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AA,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, Logger } from \"../models\";\nimport { SessionProvider } from \".\";\nimport { initController } from \"../test_helpers\";\nimport { FortGlobal } from \"../fort_global\";\n\n\nexport abstract class Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: any };\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 get logger(): Logger {\n return FortGlobal.logger;\n }\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, Logger } from \"../models\";\nimport { Controller } from \"./controller\";\nimport { SessionProvider } from \"./session_provider\";\nimport { GuardTestData, initGuard } from \"../test_helpers\";\nimport { FortGlobal } from \"../fort_global\";\n\nexport abstract class Guard implements Controller {\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: any };\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 get logger(): Logger {\n return FortGlobal.logger;\n }\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\";\nexport * from './result_mapper';","import { MIME_TYPE } from \"../enums\";\n\nexport abstract class ResultMapper {\n abstract map(type: MIME_TYPE, result, setMimeType?: (type) => void): any;\n}","import { CookieManager } from \"../models\";\nimport * as getUniqId from \"uniqid\";\nimport { FortGlobal } from \"../fort_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<{ [key: string]: any }>;\n abstract set(key: string, val: any): Promise;\n abstract setMany(values: { [key: string]: any }): Promise;\n abstract remove(key: string): Promise;\n\n abstract clear(): Promise;\n\n protected createSession(sessionId?) {\n const now = new Date();\n this.sessionId = sessionId != null ? sessionId : getUniqId();\n this.cookie.addCookie({\n name: FortGlobal.appSessionIdentifier,\n value: this.sessionId,\n httpOnly: true,\n path: \"/\",\n expires: new Date(now.setMinutes(now.getMinutes() + FortGlobal.sessionTimeOut)),\n maxAge: FortGlobal.sessionTimeOut * 60\n });\n }\n\n protected destroySession() {\n const cookie = this.cookie.getCookie(FortGlobal.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, Logger } from \"../models\";\nimport { SessionProvider, Controller } from \".\";\nimport { ShieldTestData, initShield } from \"../test_helpers\";\nimport { FortGlobal } from \"../fort_global\";\n\nexport abstract class Shield implements Controller {\n workerName: string;\n request: HttpRequest;\n response: HttpResponse;\n query: { [key: string]: any };\n\n session: SessionProvider;\n cookie: CookieManager;\n\n data: { [key: string]: any };\n\n get logger(): Logger {\n return FortGlobal.logger;\n }\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, HttpFormatResult } from \"../types\";\nimport { CookieManager, Logger } from \"../models\";\nimport { Controller } from \"./controller\";\nimport { SessionProvider } from \"./session_provider\";\nimport { WallTestData, initWall } from \"../test_helpers\";\nimport { FortGlobal } from \"../fort_global\";\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 get logger(): Logger {\n return FortGlobal.logger;\n }\n\n abstract onIncoming(...args): Promise;\n\n async onOutgoing(finalResult: HttpResult | HttpFormatResult, ...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 { FortGlobal } from \"./fort_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\";\nimport { Route } from \"./route\";\nimport { Worker } from \"./worker\";\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 Worker(allowedMethods == null ? [HTTP_METHOD.Get] : allowedMethods)(target, methodName, descriptor);\n Route(\"/\")(target, methodName, descriptor);\n };\n};\n","import { RouteHandler } from \"../handlers\";\nimport { getDataType, getClassName, removeMethodAndNullFromObject } from \"../helpers\";\nimport { DATA_TYPE } from \"../enums/data_type\";\n\nexport function ExpectBody(value: any): MethodDecorator {\n return (target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className: string = getClassName(target);\n const type = getDataType(value);\n switch (type) {\n case DATA_TYPE.Function:\n const valueClassName = getClassName(value);\n if (valueClassName != null) {\n value = new value();\n }\n case DATA_TYPE.Object:\n value = removeMethodAndNullFromObject(value);\n RouteHandler.addExpected(\"body\", className, methodName, value); break;\n default:\n throw new Error(`expected body should be always an object but found ${type}`);\n }\n\n };\n}","import { RouteHandler } from \"../handlers\";\nimport { DATA_TYPE } from \"../enums/data_type\";\nimport { getClassName, removeMethodAndNullFromObject, getDataType } from \"../helpers\";\n\nexport function ExpectQuery(value: any): MethodDecorator {\n return (target: any, methodName: string, descriptor: PropertyDescriptor) => {\n const className: string = getClassName(target);\n const type = getDataType(value);\n switch (type) {\n case DATA_TYPE.Function:\n const valueClassName = getClassName(value);\n if (valueClassName != null) {\n value = new value();\n }\n case DATA_TYPE.Object:\n value = removeMethodAndNullFromObject(value);\n RouteHandler.addExpected(\"query\", className, methodName, value); break;\n default:\n throw new Error(`expected query should be always an object but found ${type}`);\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';\nexport * from './expect_body';\nexport * from './expect_query';","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) {\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\";\nexport * from \"./data_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\";","import { SessionProvider } from \"../abstracts/session_provider\";\n\nconst sessionValues: { [identifier: string]: any } = {};\n\nexport class MemorySessionProvider extends SessionProvider {\n\n async get(key: string) {\n const savedSession = sessionValues[this.sessionId];\n return savedSession != null ? savedSession[key] : null;\n }\n\n async isExist(key: string) {\n const savedValue = sessionValues[this.sessionId];\n return savedValue == null ? false : savedValue[key] != null;\n }\n\n async getAll() {\n const savedValue = sessionValues[this.sessionId];\n return savedValue == null ? {} : savedValue;\n }\n\n async set(key: string, val: any) {\n const savedValue = sessionValues[this.sessionId];\n if (savedValue == null) {\n this.createSession();\n sessionValues[this.sessionId] = {\n [key]: val\n };\n }\n else {\n savedValue[key] = val;\n }\n }\n\n setMany(values: { [key: string]: any }) {\n return Promise.all(\n Object.keys(values).map((key) => {\n return this.set(key, values[key]);\n })\n );\n }\n\n async remove(key: string) {\n const savedValue = sessionValues[this.sessionId];\n if (savedValue != null) {\n savedValue[key] = null;\n }\n }\n\n async clear() {\n // remove session values\n delete sessionValues[this.sessionId];\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({\n fileLocation: value.view\n });\n return Mustache.render(viewData, value.model);\n }\n}","import { ErrorHandler, Logger } from \"./models\";\nimport { ViewEngine, XmlParser } from \"./abstracts\";\nimport { EtagOption, FolderMap } from \"./types\";\nimport { GenericSessionProvider, GenericWall } from \"./generics\";\n\nconst isDevelopment = process.env.NODE_ENV === 'development';\nconst isProduction = process.env.NODE_ENV === \"production\";\nexport class FortGlobal {\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\n static logger: Logger;\n\n static get isDevelopment() {\n return isDevelopment;\n }\n\n static get isProduction() {\n return isProduction;\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';","\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 { textResult, getResultBasedOnMiMe } from \"../helpers\";\n\nexport class ControllerResultHandler extends FileHandler {\n\n\n private endResponse_(negotiateMimeType: MIME_TYPE) {\n let data;\n try {\n data = getResultBasedOnMiMe(negotiateMimeType,\n (this.controllerResult_ as HttpResult).responseData\n , (type: MIME_TYPE) => {\n negotiateMimeType = type;\n }\n );\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_ as HttpResult).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_ as HttpResult).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_ as HttpResult;\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.controllerResult_ = result;\n this.handleFinalResult_();\n }\n\n private handleFinalResult_() {\n const result = this.controllerResult_;\n ((this.cookieManager as any).responseCookie_ as string[]).forEach(value => {\n this.response.setHeader(__SetCookie, value);\n });\n\n if ((result as HttpResult).shouldRedirect === true) {\n this.handleRedirectResult_();\n }\n else {\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 }\n\n\n async onResultFromController(result: HttpResult | HttpFormatResult) {\n this.controllerResult_ = result || textResult(\"\");\n try {\n await this.runWallOutgoing();\n } catch (ex) {\n this.onErrorOccured(ex);\n return;\n }\n this.handleFinalResult_();\n }\n}","import { HTTP_STATUS_CODE, MIME_TYPE, ETag_Type } from \"../enums\";\nimport { FortGlobal } from \"../fort_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.handleFileRequestForFolderPath_(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 = FortGlobal.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 handleFileRequestForFolderPath_(absolutePath: string) {\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(this.onErrorOccured.bind(this));\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 sendFileAsResponse_(filePath: string, mimeType: MIME_TYPE) {\n this.response.writeHead(HTTP_STATUS_CODE.Ok, {\n [__ContentType]: mimeType\n });\n const readStream = Fs.createReadStream(filePath);\n // Handle non-existent file\n readStream.on('error', this.onErrorOccured.bind(this));\n readStream.on('open', () => {\n readStream.pipe(this.response);\n });\n }\n\n private getMimeTypeFromFileType_(fileType: string) {\n return fileType[0] === '.' ? getMimeTypeFromExtension(fileType) :\n fileType as MIME_TYPE;\n }\n\n sendFile_: (filePath: string, fileType: string, fileInfo: Fs.Stats) => any;\n}\n\nif (FortGlobal.isProduction) {\n FileHandler.prototype.sendFile_ = function (filePath: string, fileType: string, fileInfo: Fs.Stats) {\n this.runWallOutgoing().then(() => {\n const lastModified = fileInfo.mtime.toUTCString();\n const eTagValue = etag(fileInfo, {\n weak: FortGlobal.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.setHeader('Etag', eTagValue);\n this.response.setHeader('Last-Modified', lastModified);\n this.sendFileAsResponse_(filePath, this.getMimeTypeFromFileType_(fileType));\n }\n }).catch(this.onErrorOccured.bind(this));\n };\n}\nelse {\n FileHandler.prototype.sendFile_ = function (filePath: string, fileType: string, fileInfo: Fs.Stats) {\n this.runWallOutgoing().then(() => {\n this.sendFileAsResponse_(filePath, this.getMimeTypeFromFileType_(fileType));\n }).catch(this.onErrorOccured.bind(this));\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 { FortGlobal } from \"../fort_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 (FortGlobal 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 { FortGlobal } from \"../fort_global\";\nimport { parseCookie, parseAndMatchRoute, promise, compareExpectedAndRemoveUnnecessary } 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\";\nimport { RouteHandler } from \"./route_handler\";\nimport { IException } from \"../interfaces\";\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 = FortGlobal.walls.length;\n const executeWallIncomingByIndex = async () => {\n if (wallLength > index) {\n const wall = FortGlobal.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\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 runController_;\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\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\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 (FortGlobal.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 FortGlobal.sessionProvider();\n this.session_.cookie = this.cookieManager = new CookieManager(parsedCookies);\n this.session_.sessionId = parsedCookies[FortGlobal.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', FortGlobal.appName);\n this.response.setHeader('Vary', 'Accept-Encoding');\n this.response.sendDate = true;\n }\n\n private checkExpectedQuery_() {\n const expectedQuery = RouteHandler.getExpectedQuery(this.routeMatchInfo_.controllerName, this.routeMatchInfo_.workerInfo.workerName);\n if (expectedQuery != null) {\n this.query_ = compareExpectedAndRemoveUnnecessary(expectedQuery, this.query_, true);\n }\n }\n\n private checkExpectedBody_() {\n const expectedBody = RouteHandler.getExpectedBody(this.routeMatchInfo_.controllerName, this.routeMatchInfo_.workerInfo.workerName);\n if (expectedBody != null) {\n this.body = compareExpectedAndRemoveUnnecessary(expectedBody, this.body, false);\n }\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 this.checkExpectedQuery_();\n if (this.query_ == null) {\n this.onBadRequest({\n message: \"Bad query string data - query string data does not match with expected value\"\n } as IException);\n return;\n }\n let shouldExecuteNextComponent = await this.executeShieldsProtection_();\n if (shouldExecuteNextComponent === true) {\n shouldExecuteNextComponent = await this.handlePostData();\n if (shouldExecuteNextComponent === true) {\n this.checkExpectedBody_();\n if (this.body == null) {\n this.onBadRequest({\n message: \"Bad body data - body data does not match with expected value\"\n } as IException);\n return;\n }\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 (FortGlobal.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\n setControllerProps_() {\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 return controllerObj[this.routeMatchInfo_.workerInfo.workerName](...methodArgsValues);\n }\n}\nif (FortGlobal.isProduction) {\n RequestHandler.prototype.runController_ = function () {\n this.setControllerProps_().then(\n this.onResultFromController.bind(this)\n ).catch(this.onErrorOccured.bind(this));\n };\n}\nelse {\n RequestHandler.prototype.runController_ = function () {\n const result = this.setControllerProps_();\n if (Promise.resolve(result) !== result) {\n this.onErrorOccured({\n message: \"Wrong implementation - worker does not return promise\"\n } as IException);\n }\n else {\n result.then(\n this.onResultFromController.bind(this)\n ).catch(this.onErrorOccured.bind(this));\n }\n };\n}","import { HTTP_STATUS_CODE, MIME_TYPE, HTTP_METHOD } from \"../enums\";\nimport * as http from \"http\";\nimport { __ContentType } from \"../constant\";\nimport { FortGlobal } from \"../fort_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\";\nimport { HttpResult, HttpFormatResult } from \"../types\";\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 controllerResult_: HttpResult | HttpFormatResult = {} as any;\n\n protected runWallOutgoing() {\n const outgoingResults: Array> = [];\n reverseLoop(this.wallInstances, (value: Wall) => {\n const methodArgsValues = InjectorHandler.getMethodValues(value.constructor.name, 'onOutgoing');\n methodArgsValues.shift();\n outgoingResults.push(value.onOutgoing(this.controllerResult_, ...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 FortGlobal.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 FortGlobal.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 FortGlobal.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 FortGlobal.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 FortGlobal.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 FortGlobal.errorHandler().onServerError(error);\n }\n catch (ex) {\n errMessage = JsonHelper.stringify(ex);\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 { WorkerInfo, ParentRoute } from \"../types\";\nimport { GenericShield, GenericGuard } from \"../generics\";\nimport { isNull } from \"../utils\";\nimport { RouteInfo } from \"../models\";\nimport { IRouteInfo } from \"../interfaces\";\nimport { getDataType } from \"../helpers\";\n\nconst routerCollection: {\n [controllerName: string]: RouteInfo\n} = {};\n\nconst pushRouterIntoCollection = (route: IRouteInfo) => {\n const routeObj = new RouteInfo();\n routeObj.init(route);\n routerCollection[route.controllerName] = routeObj;\n};\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 get routesAsArray() {\n return Object.keys(routerCollection).map(workerName => {\n return routerCollection[workerName];\n });\n }\n\n static findControllerFromPath(urlParts: string[]) {\n for (const controllerName in routerCollection) {\n let isMatched: boolean = false as any;\n const controller = routerCollection[controllerName];\n const patternSplit = controller.path.split(\"/\");\n\n patternSplit.every((patternPart, i) => {\n isMatched = patternPart === urlParts[i];\n return isMatched;\n });\n if (isMatched === true) {\n return controller;\n }\n }\n }\n\n static get defaultRoute() {\n return routerCollection[RouteHandler.defaultRouteControllerName];\n }\n\n static defaultRouteControllerName: string;\n\n static addToRouterCollection(value: ParentRoute) {\n const route = routerCollection[value.controller.name];\n if (route == null) {\n pushRouterIntoCollection({\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 for (const workerName in route.workers) {\n const actionInfo = route.workers[workerName];\n actionInfo.pattern = getActionPattern(value, actionInfo.pattern);\n }\n }\n }\n\n static addShields(shields: Array, className: string) {\n const route = routerCollection[className];\n if (route == null) {\n pushRouterIntoCollection({\n workers: {},\n controller: null,\n controllerName: className,\n shields: shields,\n path: null,\n values: []\n });\n }\n else {\n route.shields = shields;\n }\n }\n\n static addWorker(newWorker: WorkerInfo, className: string) {\n\n const workerName = newWorker.workerName;\n const route = routerCollection[className];\n if (route == null) {\n pushRouterIntoCollection({\n workers: {\n [workerName]: newWorker\n },\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = route.workers[workerName];\n if (savedAction == null) {\n newWorker.pattern = getActionPattern(route, newWorker.pattern);\n route.workers[workerName] = newWorker;\n }\n else {\n savedAction.methodsAllowed = newWorker.methodsAllowed;\n savedAction.pattern = getActionPattern(route, savedAction.pattern);\n // route.path == null ? savedAction.pattern : `/${route.path}${savedAction.pattern}`;\n }\n }\n }\n\n static addGuards(guards: Array, className: string, workerName: string) {\n\n const route = routerCollection[className];\n const pattern = workerName.toLowerCase();\n if (route == null) {\n pushRouterIntoCollection({\n workers: {\n [workerName]: {\n workerName: workerName,\n guards: guards,\n methodsAllowed: null,\n pattern: pattern,\n values: []\n }\n },\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = route.workers[workerName];\n if (savedAction == null) {\n route.workers[workerName] = {\n workerName: workerName,\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, workerName: string) {\n const route = routerCollection[className];\n if (route == null) {\n pushRouterIntoCollection({\n workers: {\n [workerName]: {\n workerName: workerName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: []\n }\n },\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = route.workers[workerName];\n pattern = getActionPattern(route, pattern);\n if (savedAction == null) {\n route.workers[workerName] = {\n workerName: workerName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: []\n };\n }\n else {\n savedAction.pattern = pattern;\n }\n }\n }\n\n static addExpected(type: string, className: string, workerName: string, expectedValue: any) {\n\n for (const prop in expectedValue) {\n const propValue = expectedValue[prop];\n expectedValue[prop] = getDataType(propValue);\n }\n\n const isQuery = type === 'query';\n const pattern = workerName.toLowerCase();\n const router = routerCollection[className];\n const worker = {\n workerName: workerName,\n guards: [],\n methodsAllowed: null,\n pattern: pattern,\n values: [],\n expectedQuery: isQuery ? expectedValue : null,\n expectedBody: isQuery ? null : expectedValue\n };\n if (router == null) {\n pushRouterIntoCollection({\n workers: {\n [workerName]: worker\n },\n controller: null,\n controllerName: className,\n shields: [],\n path: null,\n values: []\n });\n }\n else {\n const savedAction = router.workers[workerName];\n if (savedAction == null) {\n router.workers[workerName] = worker;\n }\n else {\n savedAction.expectedQuery = worker.expectedQuery;\n savedAction.expectedBody = worker.expectedBody;\n }\n }\n }\n\n static getExpectedQuery(controllerName: string, workerName: string) {\n return routerCollection[controllerName].workers[workerName].expectedQuery;\n }\n\n static getExpectedBody(controllerName: string, workerName: string) {\n return routerCollection[controllerName].workers[workerName].expectedBody;\n }\n\n}","import { getDataType } from \"./get_data_type\";\nimport { DATA_TYPE } from \"../enums/data_type\";\n\nexport const compareExpectedAndRemoveUnnecessary = (expected, actual, isQuery) => {\n const result = {};\n for (const prop in expected) {\n if (isQuery === true && expected[prop] === DATA_TYPE.Number) {\n result[prop] = Number(actual[prop]);\n if (isNaN(result[prop]) === true) {\n return null;\n }\n }\n else {\n result[prop] = actual[prop];\n }\n if (expected[prop] !== getDataType(result[prop])) {\n return null;\n }\n }\n return result;\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};","export const getClassName = (target): string => {\n return target.name || (target.constructor && target.constructor.name);\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 { MIME_TYPE } from \"../enums\";\nimport { ResultMapper } from \"../abstracts\";\n\nexport let getResultBasedOnMiMe: (type: MIME_TYPE, result, setMimeType?: (type) => void) => any;\n\nexport function setResultMapper(mapper: typeof ResultMapper) {\n if (mapper) {\n getResultBasedOnMiMe = (type, result, callBack) => {\n return new (mapper as any)().map(type, result, callBack);\n };\n }\n else {\n getResultBasedOnMiMe = (type, result, callBack) => {\n switch (type) {\n case MIME_TYPE.Json:\n case MIME_TYPE.Text:\n case MIME_TYPE.Html:\n case MIME_TYPE.Xml:\n if (typeof result === 'object' === true) {\n callBack(MIME_TYPE.Json);\n return JSON.stringify(result);\n }\n }\n return result;\n };\n }\n}","import { readFile } from \"fs-extra\";\nimport * as path from \"path\";\nimport { FortGlobal } from \"../fort_global\";\nimport { __CurrentPath } from \"../constant\";\nimport { ViewReadOption } from \"../types\";\n\nconst viewCache = {\n\n};\n\nexport let getViewFromFile: (option: ViewReadOption) => Promise;\n\nconst readView = async (option: ViewReadOption) => {\n const pathOfView = path.join(FortGlobal.viewPath, option.fileLocation);\n const result = await readFile(pathOfView, {\n encoding: 'utf8'\n });\n if (option.mapView != null) {\n return option.mapView(result);\n }\n return result;\n};\nif (FortGlobal.isProduction === true) {\n getViewFromFile = async function (option: ViewReadOption): Promise {\n if (viewCache[option.fileLocation] == null) {\n viewCache[option.fileLocation] = await readView(option);\n }\n return viewCache[option.fileLocation];\n };\n}\nelse {\n getViewFromFile = async function (option: ViewReadOption): Promise {\n return await readView(option);\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 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 \"./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';\nexport * from './compar_expected_and_remove_unnecessary';\nexport * from './get_data_type';\nexport * from './get_class_name';\nexport * from './remove_method_and_null_from_object';\nexport * from './get_result_based_on_mime';","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 \"../models\";\n\nconst regex1 = /{(.*)}(?!.)/;\nconst regex2 = /{(.*)}\\.(\\w+)(?!.)/;\n\nconst checkRouteInWorker = (route: RouteInfo, httpMethod: HTTP_METHOD, urlParts: string[]) => {\n const matchedRoute: RouteMatch = {\n allowedHttpMethod: [],\n controller: route.controller,\n controllerName: route.controllerName\n } as RouteMatch;\n\n const urlPartLength = urlParts.length;\n for (const workerName in route.workers) {\n const worker = route.workers[workerName];\n const patternSplit = worker.pattern.split(\"/\");\n if (urlPartLength === patternSplit.length) {\n let isMatched = true;\n const params = {};\n urlParts.every((urlPart, i) => {\n // if not equal then check for regex match\n if (urlPart !== patternSplit[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 }\n }\n else {\n isMatched = false;\n }\n }\n // means its direct match\n return isMatched;\n });\n if (isMatched === true) {\n if (worker.methodsAllowed.indexOf(httpMethod) >= 0) {\n matchedRoute.workerInfo = worker;\n matchedRoute.params = params;\n matchedRoute.shields = route.shields;\n break;\n }\n else {\n matchedRoute.allowedHttpMethod = [...matchedRoute.allowedHttpMethod, ...worker.methodsAllowed];\n }\n }\n }\n }\n if (matchedRoute.workerInfo == null && matchedRoute.allowedHttpMethod.length === 0) {\n return null;\n }\n return matchedRoute;\n\n};\n\nexport function parseAndMatchRoute(url: string, httpMethod: HTTP_METHOD) {\n url = removeLastSlash(url);\n const urlParts = url.split(\"/\");\n const route = RouteHandler.findControllerFromPath(urlParts);\n return route == null ? checkRouteInWorker(RouteHandler.defaultRoute, httpMethod, urlParts) :\n checkRouteInWorker(route, httpMethod, urlParts);\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 { getDataType } from \"./get_data_type\";\nimport { DATA_TYPE } from \"../enums/data_type\";\n\nexport const removeMethodAndNullFromObject = (value: object) => {\n\n const outputValue = {};\n for (const prop in value) {\n const type = getDataType(value[prop]);\n if (!(value[prop] == null || type === DATA_TYPE.Function)) {\n outputValue[prop] = value[prop];\n }\n }\n\n return outputValue;\n};","import { FortGlobal } from \"../fort_global\";\nimport { LogHelper } from \"./log_helper\";\nimport { ERROR_TYPE } from \"../enums/error_type\";\n\nexport let renderView: (viewName: string, model?: any) => Promise;\n\nif (FortGlobal.isProduction === true) {\n renderView = (viewName: string, model?: any) => {\n return FortGlobal.viewEngine.render({\n view: viewName,\n model\n });\n };\n}\nelse {\n renderView = (viewName: string, model?: any) => {\n if (FortGlobal.viewEngine == null) {\n new LogHelper(ERROR_TYPE.UndefinedViewEngine).throw();\n }\n return FortGlobal.viewEngine.render({\n view: viewName,\n model\n });\n };\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};","export * from './models';\nexport * from './abstracts';\nexport * from './decorators';\nexport * from './enums';\nexport * from './helpers';\nexport * from './types';\nexport * from './extra';\nexport * from './interfaces';","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, ResultMapper } from \"../abstracts\";\nimport { RouteHandler, RequestHandler } from \"../handlers\";\nimport { FortGlobal } from \"../fort_global\";\nimport { MemorySessionProvider, MustacheViewEngine } from \"../extra\";\nimport { ErrorHandler } from \".\";\nimport { __AppName, __CurrentPath } from \"../constant\";\nimport * as http from \"http\";\nimport { ETag_Type, ERROR_TYPE } from \"../enums\";\nimport { LogHelper, promise, removeLastSlash, removeFirstSlash, setResultMapper } from \"../helpers\";\nimport { GenericSessionProvider, GenericXmlParser, GenericController } from \"../generics\";\nimport { isNull, isNullOrEmpty, isArray } from \"../utils\";\nimport { Logger } from \"./logger\";\nimport * as path from \"path\";\n\nexport class Fort {\n\n logger: Logger;\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 resultMapper?: typeof ResultMapper;\n\n private saveAppOption_(option: AppOption) {\n const defaultEtagConfig = {\n type: ETag_Type.Weak\n } as EtagOption;\n\n FortGlobal.port = option.port == null ? 4000 : option.port;\n FortGlobal.shouldParseCookie = option.shouldParseCookie == null ? true : option.shouldParseCookie;\n FortGlobal.shouldParsePost = isNull(option.shouldParsePost) ? true : option.shouldParsePost;\n FortGlobal.sessionTimeOut = isNull(option.sessionTimeOut) ? 60 : option.sessionTimeOut;\n FortGlobal.folders = option.folders == null ? [] : option.folders;\n if (isArray(FortGlobal.folders) === false) {\n throw new Error(`Option folders should be an array`);\n }\n FortGlobal.appName = isNullOrEmpty(option.appName) === true ? __AppName : option.appName;\n FortGlobal.appSessionIdentifier = `${FortGlobal.appName}_session_id`;\n FortGlobal.eTag = isNull(option.eTag) ? defaultEtagConfig : option.eTag;\n FortGlobal.walls = this.walls as any;\n FortGlobal.viewEngine = isNull(this.viewEngine) ? new MustacheViewEngine() : new (this.viewEngine as any)();\n FortGlobal.sessionProvider = isNull(this.sessionProvider) ? MemorySessionProvider as any :\n this.sessionProvider as typeof GenericSessionProvider;\n FortGlobal.errorHandler = isNull(this.errorHandler) ? ErrorHandler : this.errorHandler;\n FortGlobal.xmlParser = isNull(this.xmlParser) ? GenericXmlParser : this.xmlParser;\n FortGlobal.viewPath = isNull(option.viewPath) ? path.join(__CurrentPath, \"views\") : option.viewPath;\n setResultMapper(this.resultMapper);\n if (this.logger) {\n if (typeof this.logger === 'function') {\n this.logger = new (this as any).logger();\n }\n }\n else {\n this.logger = new Logger();\n }\n FortGlobal.logger = this.logger;\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 RouteHandler.addToRouterCollection(route);\n if (route.path === \"/*\") {\n RouteHandler.defaultRouteControllerName = route.controller.name;\n isDefaultRouteExist = true;\n }\n });\n if (isDefaultRouteExist === false) {\n RouteHandler.defaultRouteControllerName = GenericController.name;\n RouteHandler.addToRouterCollection({\n controller: GenericController,\n path: \"/*\"\n });\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 if (this.httpServer != null) {\n return;\n }\n return promise((res, rej) => {\n this.httpServer = http.createServer(this.onNewRequest).once(\"error\", (err) => {\n if ((err as any).code === 'EADDRINUSE') {\n const error = new LogHelper(ERROR_TYPE.PortInUse, FortGlobal.port).get();\n rej(error);\n }\n else {\n rej(err);\n }\n }).once('listening', () => {\n // set default route\n // RouteHandler.defaultRouteControllerName = RouteHandler.getDefaultRoute();\n res();\n }).listen(FortGlobal.port);\n });\n }\n\n onNewRequest(request, response) {\n new RequestHandler(request, response).handle();\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\";\nexport * from \"./logger\";\nexport * from './route_info';","export class Logger {\n info?(...args) {\n this.debug(args);\n }\n error?(...args) {\n this.debug(args);\n }\n log?(...args) {\n this.debug(args);\n }\n debug?(...args) {\n console.log(...args);\n }\n}","import { GenericShield, GenericController } from \"../generics\";\nimport { WorkerInfo } from \"../types\";\nimport { IRouteInfo } from \"../interfaces\";\n\nexport class RouteInfo implements IRouteInfo {\n controller: typeof GenericController;\n controllerName: string;\n path: string;\n workers: {\n [workerName: string]: WorkerInfo\n };\n\n get workersAsArray() {\n return Object.keys(this.workers).map(workerName => {\n return this.workers[workerName];\n return this.workers[workerName];\n });\n }\n\n shields: Array;\n values: any[];\n\n init(value: IRouteInfo) {\n this.controllerName = value.controllerName;\n this.controller = value.controller;\n this.path = value.path;\n this.shields = value.shields;\n this.values = value.values;\n this.workers = value.workers;\n }\n}","import { RouteHandler } from \"../handlers\";\nimport { RouteInfo } from \"./route_info\";\n\nexport class Router {\n get routes() {\n return RouteHandler.routerCollection;\n }\n\n get routesAsArray() {\n return RouteHandler.routesAsArray;\n }\n\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 { FortGlobal } from \"../fort_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 FortGlobal.sessionProvider();\n session.cookie = controllerInstance.cookie;\n session.sessionId = parsedCookies[FortGlobal.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(\"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 diff --git a/src/handlers/request_handler_helper.ts b/src/handlers/request_handler_helper.ts index ec92a0ce..41312024 100644 --- a/src/handlers/request_handler_helper.ts +++ b/src/handlers/request_handler_helper.ts @@ -19,7 +19,7 @@ export class RequestHandlerHelper { protected wallInstances: Wall[] = []; - protected controllerResult_: HttpResult | HttpFormatResult; + protected controllerResult_: HttpResult | HttpFormatResult = {} as any; protected runWallOutgoing() { const outgoingResults: Array> = []; diff --git a/tests/general/controllers/random_controller.ts b/tests/general/controllers/random_controller.ts index 8c2ef060..dc3934a4 100644 --- a/tests/general/controllers/random_controller.ts +++ b/tests/general/controllers/random_controller.ts @@ -3,7 +3,7 @@ import * as path from "path"; export class RandomController extends Controller { - + @DefaultWorker() async format() { const result = { @@ -62,4 +62,10 @@ export class RandomController extends Controller { async null() { } + + @Worker() + @Route("/status-override") + async statusCodeOverrideTestUsingWall() { + return textResult("ok", 202); + } } \ No newline at end of file diff --git a/tests/general/test/random.js b/tests/general/test/random.js index 59a06018..a119ee61 100644 --- a/tests/general/test/random.js +++ b/tests/general/test/random.js @@ -117,4 +117,14 @@ describe("/random", () => { done(); }) }) + + it("/status-override using wall", (done) => { + request.get('/random/status-override').end((err, res) => { + expect(err).to.be.null; + expect(res).to.have.status(200); + expect(res).to.have.header('content-type', 'text/plain'); + expect(res.text).to.be.equal("overrided"); + done(); + }) + }) }) \ No newline at end of file diff --git a/tests/general/test/wall.js b/tests/general/test/wall.js index ed416a86..60af5731 100644 --- a/tests/general/test/wall.js +++ b/tests/general/test/wall.js @@ -52,7 +52,7 @@ describe("wall test", () => { expect(res).to.have.header('custom-header-from-incoming-wall', '*'); expect(res).to.have.header('injection-result', 'wall constructor onIncoming called on outgoing called'); expect(res).to.have.header('wall-without-outgoing-wall', '*'); - expect(res.body).haveOwnProperty('reqCount').equal(108); + expect(res.body).haveOwnProperty('reqCount').equal(109); done(); }) }) diff --git a/tests/general/walls/request_logger.ts b/tests/general/walls/request_logger.ts index 5d697643..2b77238d 100644 --- a/tests/general/walls/request_logger.ts +++ b/tests/general/walls/request_logger.ts @@ -1,4 +1,4 @@ -import { Wall, textResult, Assign } from "fortjs"; +import { Wall, textResult, HttpResult, Assign } from "fortjs"; let reqCount = 0; export class RequestLogger extends Wall { @@ -36,9 +36,14 @@ export class RequestLogger extends Wall { } } - async onOutgoing(result, @Assign('on outgoing called') value: string) { + async onOutgoing(result: HttpResult, @Assign('on outgoing called') value: string) { this.logger.log('executing request logger'); this.response.setHeader('Custom-Header-From-Outgoing-Wall', '*'); this.response.setHeader('injection-result', this.injectionValue + ` ${value}`); + + if (result.statusCode === 202) { + result.statusCode = 200; + result.responseData = "overrided"; + } } } \ No newline at end of file